{"version":3,"file":"Examples_1.D2pDRfd_.mjs","names":["useStore","useState","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/pQNU9x6u2sHRPiPmAGcf/ciKPOcy7j9C0u5lURpMG/Examples_1.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","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","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","/*\n * Utils (framer/utils@0.9.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{Data}from\"framer\";import{forwardRef}from\"react\";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\";// @frameroverrides\n// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{rotate:90},transition:{duration:2}});});}export function withHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{scale:1.05}});});}export function withRandomColor(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});});}export function DebugButton(){return{onTap:()=>{console.log(\"✅ Button tapped\");}};}// Store for button state management\nconst store=Data({variant:\"Default\",message:\"\",isSubmitting:false});export function WaitlistButtonOverride(){return{// Connect button text based on state\ntext:store.isSubmitting?\"Submitting...\":store.variant===\"Success\"?\"Notified!\":store.variant===\"Error\"?\"Try again\":\"Get notified!\",// Visual feedback through variants or opacity\nopacity:store.isSubmitting?.7:1,onTap:async()=>{// Prevent double submissions\nif(store.isSubmitting)return;// Ensure we're on the client side\nif(typeof window===\"undefined\")return;// Try multiple selectors to find the email input\nlet emailInput=document.querySelector('input[type=\"email\"]');// If not found, try other common selectors\nif(!emailInput){emailInput=document.querySelector('input[placeholder*=\"gmail\"]');}if(!emailInput){emailInput=document.querySelector('input[placeholder*=\"email\"]');}if(!emailInput){// Try to find any text input in the form\nconst inputs=document.querySelectorAll('input[type=\"text\"]');if(inputs.length===1){emailInput=inputs[0];}}// Log for debugging\nconsole.log(\"Email input found:\",emailInput);console.log(\"Input value:\",emailInput?.value);const email=emailInput?.value?.trim();// Validate email\nif(!email||email===\"\"){console.error(\"No email provided\");store.variant=\"Error\";store.message=\"Please enter your email\";// Focus the input field\nif(emailInput){emailInput.focus();// Add visual feedback\nemailInput.style.border=\"2px solid red\";setTimeout(()=>{emailInput.style.border=\"\";},3e3);}setTimeout(()=>{store.variant=\"Default\";store.message=\"\";},3e3);return;}// Basic email validation\nconst emailRegex=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;if(!emailRegex.test(email)){console.error(\"Invalid email format:\",email);store.variant=\"Error\";store.message=\"Please enter a valid email\";if(emailInput){emailInput.focus();emailInput.style.border=\"2px solid red\";setTimeout(()=>{emailInput.style.border=\"\";},3e3);}setTimeout(()=>{store.variant=\"Default\";store.message=\"\";},3e3);return;}// Set loading state\nstore.isSubmitting=true;store.variant=\"Loading\";console.log(\"Submitting email:\",email);try{// Your Google Apps Script Web App URL\nconst scriptUrl=\"https://script.google.com/macros/s/AKfycbxgxcqAN9DaQBiHs6WkIWcTYdUNVIC34EpGbFlUbrGR3zP_od--vkF3igsD5Qh80psD7Q/exec\";// Determine the origin to send (must match allowedDomains in your script)\nlet origin=window.location.origin;// For production, ensure it matches your allowed domains\nif(origin.includes(\"localhost\")||origin.includes(\"127.0.0.1\")){// For local testing, use your production domain\norigin=\"https://paxmeet.com\";}else if(origin.includes(\"framer.app\")||origin.includes(\"framercanvas.com\")){// For Framer preview, use your production domain\norigin=\"https://paxmeet.com\";}else if(!origin.startsWith(\"https://\")){// Ensure https\norigin=\"https://paxmeet.com\";}// Make the request to Google Apps Script\nconst response=await fetch(scriptUrl,{method:\"POST\",mode:\"no-cors\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({email:email,origin:origin})});// Note: With no-cors mode, we can't read the response\n// We'll assume success if no error is thrown\nconsole.log(\"✅ Email submitted successfully:\",email);// Set success state\nstore.variant=\"Success\";store.message=\"Awesome! You're on the waitlist!\";// Clear the email input\nif(emailInput){emailInput.value=\"\";// Add success visual feedback\nemailInput.style.border=\"2px solid green\";setTimeout(()=>{emailInput.style.border=\"\";},2e3);}// Reset to default after 5 seconds\nsetTimeout(()=>{store.variant=\"Default\";store.message=\"\";},5e3);}catch(error){console.error(\"❌ Error submitting email:\",error);// Set error state\nstore.variant=\"Error\";store.message=\"Connection error. Please try again.\";// Keep the email in the input for retry\nif(emailInput&&email){emailInput.value=email;emailInput.focus();}// Reset to default after 3 seconds\nsetTimeout(()=>{store.variant=\"Default\";store.message=\"\";},3e3);}finally{store.isSubmitting=false;}}};}// Optional: Override for the email input field to handle Enter key\nexport function EmailInputOverride(){return{onKeyDown:e=>{if(e.key===\"Enter\"){e.preventDefault();// Trigger button click\nconst button=document.querySelector(\"button\");if(button){button.click();}}},placeholder:\"Enter your email\",onChange:value=>{// Clear any error states when user starts typing\nif(store.variant===\"Error\"){store.variant=\"Default\";store.message=\"\";}}};}// Debug helper - apply this to a text element to see current state\nexport function DebugStateOverride(){return{text:`State: ${store.variant} | ${store.message}`,style:{fontSize:\"12px\",color:store.variant===\"Error\"?\"red\":store.variant===\"Success\"?\"green\":\"gray\"}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withDebugButton(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...DebugButton(props)});};}withDebugButton.displayName=\"DebugButton\";export function withWaitlistButtonOverride(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...WaitlistButtonOverride(props)});};}withWaitlistButtonOverride.displayName=\"WaitlistButtonOverride\";export function withEmailInputOverride(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...EmailInputOverride(props)});};}withEmailInputOverride.displayName=\"EmailInputOverride\";export function withDebugStateOverride(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...DebugStateOverride(props)});};}withDebugStateOverride.displayName=\"DebugStateOverride\";\nexport const __FramerMetadata__ = {\"exports\":{\"EmailInputOverride\":{\"type\":\"override\",\"name\":\"EmailInputOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDebugButton\":{\"type\":\"reactHoc\",\"name\":\"withDebugButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withWaitlistButtonOverride\":{\"type\":\"reactHoc\",\"name\":\"withWaitlistButtonOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailInputOverride\":{\"type\":\"reactHoc\",\"name\":\"withEmailInputOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DebugButton\":{\"type\":\"override\",\"name\":\"DebugButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"WaitlistButtonOverride\":{\"type\":\"override\",\"name\":\"WaitlistButtonOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDebugStateOverride\":{\"type\":\"reactHoc\",\"name\":\"withDebugStateOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DebugStateOverride\":{\"type\":\"override\",\"name\":\"DebugStateOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples_1.map"],"mappings":"yMAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,CAAC,CAClD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,MAAM,EAAE,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,EAAS,CAAC,EAChI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,EAC7D,EAAa,IAAI,IACjB,EAAc,GAAU,CAC3B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAW,EAAE,EAAW,OAAO,GAAW,SAAS,OAAO,OAAO,CAAC,GAAG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