{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/1CcuGMPncKZbZxSm9gkF/cOkdbBon7e6xzZTFiy8f/Examples.js", "ssg:https://framer.com/m/framer/store.js@^1.0.0", "ssg:https://framer.com/m/framer/utils.js@^0.9.0"],
  "sourcesContent": ["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{forwardRef,useState,useEffect,useCallback}from\"react\";import React from\"react\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\",firstTitle:\"Test\"});function useLocalStorage(key,initialValue){// Get stored value or default to initialValue\nconst[state,setState]=useState(()=>{const saved=localStorage.getItem(key);return saved?JSON.parse(saved):initialValue;});// Update localStorage whenever state changes\nuseEffect(()=>{localStorage.setItem(key,JSON.stringify(state));},[state]);return[state,setState];}export function withDefault(Component){return props=>{const[state,setState]=useState(()=>{const saved=localStorage.getItem(\"AB_test\");return saved?JSON.parse(saved):Math.random();});useEffect(()=>{localStorage.setItem(\"AB_test\",JSON.stringify(state));},[state]);return /*#__PURE__*/_jsx(Component,{...props,text:`test: ${state.toString()}`});};}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()});}});};}export function withFocus(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props});};}export function triggerIntercom(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>window.Intercom(\"show\")});};}function shouldShowTeamTrainingCalendar(){const[shouldShow,setShouldShow]=useState(false);useEffect(()=>{const params=new URLSearchParams(window.location.search);setShouldShow(params.get(\"calendar\")===\"team-training\");},[]);return shouldShow;}export function withHideWebinarLink(Component){return props=>{if(shouldShowTeamTrainingCalendar()){console.log(\"Hiding\");return null;}console.log(\"Showing\");return /*#__PURE__*/_jsx(Component,{...props});};}export function withConsoleLog(Component){return props=>{console.log(props);return /*#__PURE__*/_jsx(Component,{...props});};}export function withClass(Component){return props=>{props.className+=\" test\"// Remember to add a space\n;return /*#__PURE__*/_jsx(Component,{...props,onClick:event=>{props.onClick(event);console.log(\"clicked\");},text:\"test\"});};}export function withFoo(Component){return /*#__PURE__*/React.forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{...props,ref:ref});});}export function formRedirectOverride(Component){return props=>{useEffect(()=>{// Select the form using the className from Framer props\nconst form=document.querySelector(`.${props.className.replace(/\\s+/g,\".\")}`);if(!form)return;// Exit if the form is not found\n// Extract the first path segment from the current URL\nconst pathSegments=window.location.pathname.split(\"/\");const firstSegment=pathSegments[1]// First segment after the domain\n;// Check if the first segment is a valid locale, otherwise default to \"en\"\nconst locale=firstSegment.length===2?firstSegment:\"en\";// Handle form submission\nconst handleSubmit=event=>{event.preventDefault()// Prevent the default form submission\n;const formData=new FormData(form);const params=new URLSearchParams;console.log(formData);for(const[key,value]of formData.entries()){// Handle multiple checkboxes (if any)\nif(params.has(key)){params.append(key,value);}else{params.set(key,value);}}// Construct the redirect URL using the detected locale\n// const redirectUrl = `https://my.mollie.com/dashboard/signup?lang=${locale}&${params.toString()}`\n// Redirect to the URL with query parameters\n// window.location.href = redirectUrl\nconsole.log(params.toString());};// Attach event listener\nform.addEventListener(\"submit\",handleSubmit);// Cleanup function to remove event listener on unmount\nreturn()=>{form.removeEventListener(\"submit\",handleSubmit);};},[props.className])// Run when className changes\n;return /*#__PURE__*/_jsx(Component,{...props});};}export function setSubmitButton(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();const handleSubmit=useCallback(async()=>{console.log(\"submitted\");fetch(\"api.fetch.tools/emoji\",{method:\"GET\"}).then(response=>response.json()).then(data=>{console.log(data);}).catch(error=>console.error(error));},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleSubmit});});}export function setForm(Component){return /*#__PURE__*/forwardRef((props,ref)=>{console.log(props);useEffect(()=>{// Select the form using the className from Framer props\nconst form=document.querySelector(`.${props.className.replace(/\\s+/g,\".\")}`);if(!form)return;// Exit if the form is not found\nconst handleSubmit=event=>{event.preventDefault();const formData=new FormData(form);console.log(formData.entries());console.log(form);fetch(\"https://api.thecatapi.com/v1/images/search?limit=10\",{method:\"GET\"}).then(response=>response.json()).then(data=>{console.log(data);}).catch(error=>console.error(error));};// Attach event listener\nform.addEventListener(\"submit\",handleSubmit);// Cleanup function to remove event listener on unmount\nreturn()=>{form.removeEventListener(\"submit\",handleSubmit);};},[props.className])// Run when className changes\n;return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function setFormVisibility(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();const[hasSubmitted,setHasSubmitted]=useState(false);useEffect(()=>{setHasSubmitted(localStorage.getItem(\"formSubmitted\")===\"true\");},[]);if(hasSubmitted)return null;return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function setFormSubmitted(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[hasSubmitted,setHasSubmitted]=useState(false);useEffect(()=>{setHasSubmitted(localStorage.getItem(\"formSubmitted\")===\"true\");},[]);useEffect(()=>{// Select the form using the className from Framer props\nconst form=document.querySelector(`.${props.className.replace(/\\s+/g,\".\")}`);if(!form)return;// Exit if the form is not found\nconst handleSubmit=event=>{event.preventDefault();setTimeout(()=>{localStorage.setItem(\"formSubmitted\",\"true\");setHasSubmitted(true);},500);};// Attach event listener\nform.addEventListener(\"submit\",handleSubmit);// Cleanup function to remove event listener on unmount\nreturn()=>{form.removeEventListener(\"submit\",handleSubmit);};},[props.className]);if(hasSubmitted)return null;return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function setFacebookShare(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const handleClick=()=>{const url=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(window.location.href)}`;window.open(url,\"_blank\",\"noopener,noreferrer\");};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withFoo\":{\"type\":\"reactHoc\",\"name\":\"withFoo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHideWebinarLink\":{\"type\":\"reactHoc\",\"name\":\"withHideWebinarLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"triggerIntercom\":{\"type\":\"reactHoc\",\"name\":\"triggerIntercom\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"formRedirectOverride\":{\"type\":\"reactHoc\",\"name\":\"formRedirectOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setFacebookShare\":{\"type\":\"reactHoc\",\"name\":\"setFacebookShare\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFocus\":{\"type\":\"reactHoc\",\"name\":\"withFocus\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withClass\":{\"type\":\"reactHoc\",\"name\":\"withClass\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setSubmitButton\":{\"type\":\"reactHoc\",\"name\":\"setSubmitButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withConsoleLog\":{\"type\":\"reactHoc\",\"name\":\"withConsoleLog\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setForm\":{\"type\":\"reactHoc\",\"name\":\"setForm\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setFormSubmitted\":{\"type\":\"reactHoc\",\"name\":\"setFormSubmitted\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setFormVisibility\":{\"type\":\"reactHoc\",\"name\":\"setFormVisibility\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDefault\":{\"type\":\"reactHoc\",\"name\":\"withDefault\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map", "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"],
  "mappings": "mKAAAA,ICAAC,IAAqF,SAASC,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,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EAAM,QAAQE,GAAO,CAACF,EAAM,QAAQE,CAAK,EAAE,QAAQ,IAAI,SAAS,CAAE,EAAE,KAAK,MAAM,CAAC,EAAI,CAwBoD,SAASC,EAAiBC,EAAU,CAAC,OAAoBC,EAAW,CAACC,EAAMC,IAAyMC,EAAKJ,EAAU,CAAC,IAAIG,EAAI,GAAGD,EAAM,QAAjN,IAAI,CAAC,IAAMG,EAAI,gDAAgD,mBAAmB,OAAO,SAAS,IAAI,CAAC,GAAG,OAAO,KAAKA,EAAI,SAAS,qBAAqB,CAAE,CAA0E,CAAC,CAAG,CAAE",
  "names": ["init_ssg_sandbox_shims", "init_ssg_sandbox_shims", "createStore", "state1", "dataStore", "Data", "setDataStore", "newState", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "init_ssg_sandbox_shims", "centerContent", "defaultContainerStyles", "centerContent", "useStore", "createStore", "withDefault", "Component", "props", "state", "setState", "ye", "saved", "ue", "p", "shouldShowTeamTrainingCalendar", "shouldShow", "setShouldShow", "ye", "ue", "params", "withHideWebinarLink", "Component", "props", "p", "withClass", "Component", "props", "p", "event", "setFacebookShare", "Component", "Y", "props", "ref", "p", "url"]
}
