{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/store.js@^1.0.0", "ssg:https://framerusercontent.com/modules/a7sWG5aeioQq0gxCpJ4K/d5eOsmQRnxD17Yuz2C2x/TrackingUTM_clickinforeqplace.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}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{default as jsCookie}from\"https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.mjs\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// Mapa de detalles del item\nconst itemDetailsMap={\"B-(MBA+ IA) Solicitar informaci\\xf3n\":{item_name:\"thePowermba\",item_brand:\"The Power MBA\",item_category:\"Programa\",price:999}};// Funci\u00F3n para obtener par\u00E1metros UTM\nconst getUTMParams=()=>{let cookie=jsCookie.get(\"cookie_utms\");let utmParamQueryString=\"\";if(cookie!==undefined){const cookie_mba=JSON.parse(cookie);const cookie_params=[\"source\",\"medium\",\"campaign\",\"variant\",\"country\",\"product\",\"placement\",\"custmpers\",\"page\"];cookie_params.forEach(param=>{const value=cookie_mba[param];if(value){utmParamQueryString+=`&utm_${param}=${value}`;}});}const searchParams=new URLSearchParams(window.location.search);if(!utmParamQueryString&&searchParams.size>0){for(let param of searchParams){const[key,value]=param;if(key.includes(\"utm\")&&!!value){utmParamQueryString+=`&${key}=${value}`;}}}if(utmParamQueryString.length>0){utmParamQueryString=\"?\"+utmParamQueryString.substring(1);}return utmParamQueryString;};// Crea un store para manejar el estado\nconst useStore=createStore({itemSelected:null});export function withSelectItem(Component){return props=>{const[store,setStore]=useStore();const handleClick=itemKey=>{// Limpiar el objeto ecommerce anterior\nwindow.dataLayer.push({ecommerce:null});// Obtener los detalles del item desde el mapa\nconst itemDetails=itemDetailsMap[itemKey];if(itemDetails){// Empujar el evento select_item al dataLayer\nwindow.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\"];console.log(\"Item Name clicked:\",itemKey);handleClick(itemKey);}});};}export function withUTMTracking(Component){return({href,...rest})=>{const[utmParams,setUtmParams]=useState(\"\");useEffect(()=>{const utms=getUTMParams();if(utms.length>0){setUtmParams(utms);}},[]);return /*#__PURE__*/_jsx(Component,{...href?{href:href+utmParams}:{},...rest});};}export function withTags(Component){return props=>{props.className+=\" clickinforeqplace\";return /*#__PURE__*/_jsx(Component,{...props});};}export function withTagsAndUTMTracking(Component){const ComponentWithTags=withTags(Component);const ComponentWithTagsAndUTMTracking=withUTMTracking(ComponentWithTags);return ComponentWithTagsAndUTMTracking;}// Componente del bot\u00F3n\nconst CtaButton=props=>{return /*#__PURE__*/_jsx(\"button\",{...props,\"data-framer-name\":props[\"data-framer-name\"],children:props.children});};// Componente mejorado que incluye seguimiento de eventos y par\u00E1metros UTM\nconst EnhancedCtaButton=withTagsAndUTMTracking(withSelectItem(CtaButton));// Componente principal\nconst Home=()=>{return /*#__PURE__*/_jsx(\"div\",{children:/*#__PURE__*/_jsx(EnhancedCtaButton,{\"data-framer-name\":\"B-(MBA+ IA) Solicitar informaci\\xf3n\",children:\"Solicitar informaci\\xf3n para MBA + IA\"})});};export default Home;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTags\":{\"type\":\"reactHoc\",\"name\":\"withTags\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectItem\":{\"type\":\"reactHoc\",\"name\":\"withSelectItem\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUTMTracking\":{\"type\":\"reactHoc\",\"name\":\"withUTMTracking\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTagsAndUTMTracking\":{\"type\":\"reactHoc\",\"name\":\"withTagsAndUTMTracking\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TrackingUTM_clickinforeqplace.map"],
  "mappings": "yLAAqF,SAASA,EAAYC,EAAO,CACjH,IAAMC,EAAUC,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGF,CAAM,CAAC,CAAC,CAAC,EACjDG,EAAaC,GAAU,CAC1B,OAAOA,GAAW,a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AAKA,EAAKE,CAAS,EAAE,CAAC,EAAE,GAAGD,CAAI,CAAC,CAAE,CAAE,CAAQ,SAASM,EAAShB,EAAU,CAAC,OAAOC,IAAQA,EAAM,WAAW,qBAAyCM,EAAKP,EAAU,CAAC,GAAGC,CAAK,CAAC,EAAI,CAAQ,SAASgB,EAAuBjB,EAAU,CAAC,IAAMkB,EAAkBF,EAAShB,CAAS,EAA2E,OAAnCQ,EAAgBU,CAAiB,CAAyC,CAC7nC,IAAMC,EAAUlB,GAA4BM,EAAK,SAAS,CAAC,GAAGN,EAAM,mBAAmBA,EAAM,kBAAkB,EAAE,SAASA,EAAM,QAAQ,CAAC,EACnImB,EAAkBH,EAAuBlB,EAAeoB,CAAS,CAAC",
  "names": ["createStore", "state1", "dataStore", "Data", "setDataStore", "newState", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "itemDetailsMap", "getUTMParams", "cookie", "api", "utmParamQueryString", "cookie_mba", "param", "value", "searchParams", "window", "key", "useStore", "createStore", "withSelectItem", "Component", "props", "store", "setStore", "handleClick", "itemKey", "itemDetails", "p", "withUTMTracking", "href", "rest", "utmParams", "setUtmParams", "ye", "ue", "utms", "withTags", "withTagsAndUTMTracking", "ComponentWithTags", "CtaButton", "EnhancedCtaButton"]
}
