{"version":3,"file":"NewSignUp.C7ECe9mR.mjs","names":[],"sources":["https:/framerusercontent.com/modules/NjWuKpqbsHrgXZ4AHyJQ/biPQ4CiWwIKcYcWfOJ0E/NewSignUp.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({baseApiUrl:\"https://app.meetdex.ai\",email:\"\",submitted:false,loading:false,success:false,failed:false,touched:false});const isValid=store=>{return/.+@.+\\..+/.test(store.email);};export function withSignUpSubmit(Component){return(props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:async()=>{setStore({...store,submitted:true});const urlParams=new URLSearchParams(window.location.search);const referrerCode=urlParams.get(\"referrer_code\");console.log(\"body\",JSON.stringify({email:store.email,...referrerCode&&{referrer_code:referrerCode}}));try{const result=await fetch(`${store.baseApiUrl}/api/user`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({email:store.email,...referrerCode&&{referrer_code:referrerCode}})});}catch(error){console.error(error);}const baseUrl=window.location.origin;console.log(\"baseUrl\",baseUrl);window.location.href=baseUrl+\"/onboarding?email=\"+store.email;}});};}export function withSignUpEmail(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,value:store.email,onChange:event=>setStore({...store,email:event.target.value,failed:false,touched:true})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withSignUpSubmit\":{\"type\":\"reactHoc\",\"name\":\"withSignUpSubmit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSignUpEmail\":{\"type\":\"reactHoc\",\"name\":\"withSignUpEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NewSignUp.map"],"mappings":"qRAA4V,SAAgB,EAAiB,EAAU,CAAC,OAAO,EAAM,IA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