{"version":3,"file":"Select_item.RIijOfbr.mjs","names":["useStore","useState"],"sources":["https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/D180xQzsn77CBbK4Wctw/rYxZ9PP0KoH7AtXq4ztd/Select_item.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const itemDetailsMap={\"data analytics presencial\":{item_name:\"Data Analytics Presencial Hackio\",item_brand:\"Data Analytics Presencial Hackio\",item_category:\"Programa\",price:0},\"data science presencial\":{item_name:\"Data Science Presencial Hackio\",item_brand:\"Data Science Presencial Hackio\",item_category:\"Programa\",price:0},\"marketing data presencial\":{item_name:\"Marketing Data Presencial Hackio\",item_brand:\"Marketing Data Presencial Hackio\",item_category:\"Programa\",price:0},\"desarrollador ia online\":{item_name:\"Desarrollador IA Online Hackio\",item_brand:\"Desarrollador IA Online Hackio\",item_category:\"Programa\",price:0},\"fullstack online\":{item_name:\"Fullstack Online Hackio\",item_brand:\"Fullstack Online Hackio\",item_category:\"Programa\",price:0},\"data science online\":{item_name:\"Data Science Online Hackio\",item_brand:\"Data Science Online Hackio\",item_category:\"Programa\",price:0},\"data analytics online\":{item_name:\"Data Analytics Online\",item_brand:\"Data Analytics Online\",item_category:\"Programa\",price:0},\"power bi\":{item_name:\"Power BI\",item_brand:\"Power BI\",item_category:\"Programa\",price:695}};const useStore=createStore({itemSelected:null});export function withSelectItem(Component){return props=>{const[store,setStore]=useStore();const handleClick=itemKey=>{if(!itemKey){console.error(\"Item key is undefined or null.\");return;}window.dataLayer.push({ecommerce:null});itemKey=itemKey.toLowerCase();const itemDetails=itemDetailsMap[itemKey];if(itemDetails){window.dataLayer.push({event:\"select_item\",ecommerce:{items:[{item_name:itemDetails.item_name,affiliation:itemDetails.item_brand,price:itemDetails.price,item_category:itemDetails.item_category}]}});console.log(\"select_item event pushed for:\",itemDetails);setStore({itemSelected:itemDetails});}else{console.error(\"Item details not found for key:\",itemKey);}};return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>{const itemKey=props[\"data-framer-name\"]||props[\"name\"];if(!itemKey){console.error(\"Neither data-framer-name nor name is provided.\");return;}console.log(\"Item Name clicked:\",itemKey);handleClick(itemKey);}});};}const CtaButton=props=>{return /*#__PURE__*/_jsx(\"button\",{...props,\"data-framer-name\":props[\"data-framer-name\"],name:props[\"name\"],children:props.children});};const EnhancedCtaButton1=withSelectItem(CtaButton);const EnhancedCtaButton2=withSelectItem(CtaButton);const EnhancedCtaButton3=withSelectItem(CtaButton);const EnhancedCtaButton4=withSelectItem(CtaButton);const EnhancedCtaButton5=withSelectItem(CtaButton);const EnhancedCtaButton6=withSelectItem(CtaButton);const EnhancedCtaButton7=withSelectItem(CtaButton);const EnhancedCtaButton8=withSelectItem(CtaButton);const Home=()=>{return /*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(EnhancedCtaButton1,{\"data-framer-name\":\"data analytics presencial\",name:\"data analytics presencial\",children:\"Data Analytics Presencial\"}),/*#__PURE__*/_jsx(EnhancedCtaButton2,{\"data-framer-name\":\"data science presencial\",name:\"data science presencial\",children:\"Data Science Presencial\"}),/*#__PURE__*/_jsx(EnhancedCtaButton3,{\"data-framer-name\":\"marketing data presencial\",name:\"marketing data presencial\",children:\"Marketing Data Presencial\"}),/*#__PURE__*/_jsx(EnhancedCtaButton4,{\"data-framer-name\":\"desarrollador ia online\",name:\"desarrollador ia online\",children:\"Desarrollador IA Online\"}),/*#__PURE__*/_jsx(EnhancedCtaButton5,{\"data-framer-name\":\"fullstack online\",name:\"fullstack online\",children:\"Fullstack Online\"}),/*#__PURE__*/_jsx(EnhancedCtaButton6,{\"data-framer-name\":\"data science online\",name:\"data science online\",children:\"Data Science Online\"}),/*#__PURE__*/_jsx(EnhancedCtaButton7,{\"data-framer-name\":\"data analytics online\",name:\"data analytics online\",children:\"data analytics online\"}),/*#__PURE__*/_jsx(EnhancedCtaButton8,{\"data-framer-name\":\"power bi\",name:\"power bi\",children:\"power bi\"})]});};export default Home;\nexport const __FramerMetadata__ = {\"exports\":{\"withSelectItem\":{\"type\":\"reactHoc\",\"name\":\"withSelectItem\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Select_item.map"],"mappings":"sSAA8E,SAAgB,EAAY,EAA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