{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/store.js@^1.0.0", "ssg:https://framer.com/m/framer/utils.js@^0.9.0", "ssg:https://framerusercontent.com/modules/Sm3iMbEMKMfudoHG3xjk/FL0SModplOBrHbaO4qRH/SignupButton.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", "export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";import{useEffect,useState}from\"react\";// Learn more: https://www.framer.com/docs/guides/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withTracking(Component){return props=>{const[fullUrl,setFullUrl]=useState(\"\");useEffect(()=>{const signupUrl=new URL(\"https://app.magicpost.in/signup\");// R\u00E9cup\u00E9rer les param\u00E8tres UTM stock\u00E9s\nconst utmParams=getStoredUTMParameters();Object.entries(utmParams).forEach(([key,value])=>{signupUrl.searchParams.append(key,value);});// Mise \u00E0 jour de l'URL compl\u00E8te dans l'\u00E9tat\nsetFullUrl(signupUrl.toString());},[]);return /*#__PURE__*/_jsx(Component,{...props,href:fullUrl});};}export function withTrackingOld(Component){return props=>{// Utilisation des hooks useState pour stocker l'URL compl\u00E8te\nconst[fullUrl,setFullUrl]=useState(\"\");// Utilisation de useEffect pour capturer tous les param\u00E8tres de l'URL lors du chargement du composant\nuseEffect(()=>{const currentUrl=new URL(window.location.href);const params=new URLSearchParams(currentUrl.search);const signupUrl=new URL(\"https://app.magicpost.in/signup\");if(!params.toString()){// Aucun param\u00E8tre existant, donc on g\u00E9n\u00E8re les param\u00E8tres UTM selon le referrer\nconst utmParams=getUTMParametersBasedOnReferrer();Object.entries(utmParams).forEach(([key,value])=>{signupUrl.searchParams.append(key,value);});}else{// Ajout de tous les param\u00E8tres existants\nparams.forEach((value,key)=>{signupUrl.searchParams.append(key,value);});}// Mise \u00E0 jour de l'URL compl\u00E8te dans l'\u00E9tat\nsetFullUrl(signupUrl.toString());},[]);return /*#__PURE__*/_jsx(Component,{...props,href:fullUrl});};}function getStoredUTMParameters(){return{utm_source:sessionStorage.getItem(\"utm_source\")||\"direct\",utm_medium:sessionStorage.getItem(\"utm_medium\")||\"none\",utm_campaign:sessionStorage.getItem(\"utm_campaign\")||\"referral_tracking\",utm_content:sessionStorage.getItem(\"utm_content\")||\"/\",utm_term:sessionStorage.getItem(\"utm_term\")||window.location.pathname};}function getUTMParametersBasedOnReferrer(){var referrer=document.referrer||window.location.hostname;console.log(\"Referrer: \"+referrer);const currentHost=window.location.hostname;let utmSource=\"direct\"// Valeur par d\u00E9faut si aucun referrer\n;let regex=new RegExp(`https?://${currentHost}([^?]*)`);let match=referrer.match(regex);let utmMedium=match?match[1]:\"none\";let currentPathName=window.location.pathname;let utmTerm=window.location.pathname;if(!sessionStorage.getItem(\"firstPage\")){// If not, set the key with the current URL\nsessionStorage.setItem(\"firstPage\",currentPathName);}// Retrieve the first page visited\nconst firstPage=sessionStorage.getItem(\"firstPage\");let utmContent=firstPage;// G\u00E9rer les r\u00E9f\u00E9rents externes\nconst refDomains={\"google.\":[\"google\",\"organic\"],\"facebook.\":[\"facebook\",\"social\"],\"twitter.\":[\"twitter\",\"social\"],\"linkedin.\":[\"linkedin\",\"social\"],\"youtube.\":[\"youtube\",\"social\"]};let found=false;for(const domain in refDomains){if(referrer.includes(domain)){[utmSource,utmMedium]=refDomains[domain];found=true;break;}}return{utm_source:utmSource,utm_medium:utmMedium,utm_campaign:\"referral_tracking\",utm_content:utmContent,utm_term:utmTerm};}export function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.05}});};}export function withRandomColor(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withTrackingOld\":{\"type\":\"reactHoc\",\"name\":\"withTrackingOld\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTracking\":{\"type\":\"reactHoc\",\"name\":\"withTracking\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SignupButton.map"],
  "mappings": "gJAAqF,SAASA,EAAYC,EAAO,CACjH,IAAMC,EAAUC,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGF,CAAM,CAAC,CAAC,CAAC,EACjDG,EAAaC,GAAU,CAC1B,OAAOA,GAAW,aAAYA,EAASA,EAASH,EAAU,KAAK,GAAGA,EAAU,MAAM,OAAO,OAAO,CAAC,GAAGA,EAAU,MAAM,GAAGG,CAAQ,CAAC,CAAE,EACjIC,EAAW,OAAOL,GAAS,SAAS,OAAO,OAAO,CAAC,GAAGA,CAAM,CAAC,EAAEA,EAC7DM,EAAa,IAAI,IACjBC,EAAcH,GAAU,CAC3B,OAAOA,GAAW,aAAYA,EAASA,EAASC,CAAU,GAAGA,EAAW,OAAOD,GAAW,SAAS,OAAO,OAAO,CAAC,GAAGC,EAAW,GAAGD,CAAQ,CAAC,EAAEA,EACjJE,EAAa,QAAQE,GAAQA,EAAOH,CAAU,CAAC,CAAE,EACjD,SAASI,GAAU,CACnB,GAAK,CAACC,EAAMC,CAAQ,EAAEC,EAASP,CAAU,EAIzC,OAFAQ,EAAU,KACVP,EAAa,IAAIK,CAAQ,EAAQ,IAAIL,EAAa,OAAOK,CAAQ,GAAI,CAAC,CAAC,EACpEG,EAAe,IAAI,IAAMA,EAAe,EAAQ,CAACb,EAAU,MAAME,CAAY,GAC1E,CAACO,EAAMH,CAAa,CAAG,CAAC,OAAOE,CAAS,CCfvC,IAAMM,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,QAChB,EASO,IAAMC,EAAyB,CAClC,GAAGC,EACH,SAAU,QACd,ECfA,IAAMC,EAASC,EAAY,CAAC,WAAW,SAAS,CAAC,EAAS,SAASC,EAAaC,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,EAAQC,CAAU,EAAEC,EAAS,EAAE,EAAE,OAAAC,EAAU,IAAI,CAAC,IAAMC,EAAU,IAAI,IAAI,iCAAiC,EACnNC,EAAUC,EAAuB,EAAE,OAAO,QAAQD,CAAS,EAAE,QAAQ,CAAC,CAACE,EAAIC,CAAK,IAAI,CAACJ,EAAU,aAAa,OAAOG,EAAIC,CAAK,CAAE,CAAC,EACrIP,EAAWG,EAAU,SAAS,CAAC,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAKN,EAAU,CAAC,GAAGC,EAAM,KAAKC,CAAO,CAAC,CAAE,CAAE,CAKC,SAASS,GAAwB,CAAC,MAAM,CAAC,WAAW,eAAe,QAAQ,YAAY,GAAG,SAAS,WAAW,eAAe,QAAQ,YAAY,GAAG,OAAO,aAAa,eAAe,QAAQ,cAAc,GAAG,oBAAoB,YAAY,eAAe,QAAQ,aAAa,GAAG,IAAI,SAAS,eAAe,QAAQ,UAAU,GAAGC,EAAO,SAAS,QAAQ,CAAE",
  "names": ["createStore", "state1", "dataStore", "Data", "setDataStore", "newState", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "centerContent", "defaultContainerStyles", "centerContent", "useStore", "createStore", "withTracking", "Component", "props", "fullUrl", "setFullUrl", "ye", "ue", "signupUrl", "utmParams", "getStoredUTMParameters", "key", "value", "getStoredUTMParameters", "window"]
}
