{"version":3,"file":"CustomForm.CJUW28q9.mjs","names":["useState","__esmMin","init_ssg_sandbox_shims","_e","p","c","init_jsx_runtime","init_npm_react_18_3_1","window","init_framer_motion_DhsWWWsN","motion","addPropertyControls","init_framer_Bf4_tcb2","ControlType","SignupForm","formData","setFormData","props","handleInputChange","event","name","value","handleSubmit","response","token","setToken","error","expiration","domain","utmSource","init_CustomForm"],"sources":["https:/framerusercontent.com/modules/Z7YloXiGodh2j9LSufkn/IjFJLOP6UD7Z5Y9jt6Fo/CustomForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function SignupForm(props){const[formData,setFormData]=useState({name:\"\",email:\"\",password:\"\",utmSource:props.UTMCode});const handleInputChange=event=>{const{name,value}=event.target;setFormData({...formData,[name]:value});};const handleSubmit=async event=>{event.preventDefault();try{const response=await fetch(\"https://api.brain.fm/v2/auth/email-signup\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(formData)});const token=await response.json();if(response.ok){setToken(token.result,formData.utmSource);}else{console.error(\"Signup failed\",token);}}catch(error){console.error(\"Error:\",error);}};const setToken=(token,utmSource,options={})=>{const expiration=new Date;expiration.setFullYear(2030);const domain=\"brain.fm\";document.cookie=`token=${token}; expires=${expiration.toUTCString()}; domain=${domain}`;try{document.cookie=`expires=${expiration.toUTCString()}; domain=${domain}`;}catch(error){console.error(\"setToken(): could not set device id\",{reason:error});}window.location.href=\"https://my.brain.fm/welcome?extended_promo=30&utm_medium=lp&utm_source=\"+utmSource;};const getDeviceId=()=>{// Implementation for getting device ID\n};return /*#__PURE__*/_jsxs(\"div\",{className:\"container\",children:[/*#__PURE__*/_jsx(\"h1\",{children:\"Get Started for FREE\"}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,children:[/*#__PURE__*/_jsxs(\"div\",{className:\"input-wrapper\",children:[/*#__PURE__*/_jsxs(\"div\",{className:\"form-group\",children:[/*#__PURE__*/_jsx(\"label\",{className:formData.name.length>0?\"filled\":\"\",htmlFor:\"name\",children:\"First Name\"}),/*#__PURE__*/_jsx(\"input\",{type:\"text\",id:\"name\",name:\"name\",value:formData.name,onChange:handleInputChange,placeholder:\"First Name\"})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"form-group\",children:[/*#__PURE__*/_jsx(\"label\",{className:formData.email.length>0?\"filled\":\"\",htmlFor:\"email\",children:\"Email\"}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",id:\"email\",name:\"email\",className:\"email\",value:formData.email,onChange:handleInputChange,placeholder:\"Email\"})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"form-group\",children:[/*#__PURE__*/_jsx(\"label\",{className:formData.password.length>0?\"filled\":\"\",htmlFor:\"password\",children:\"Password\"}),/*#__PURE__*/_jsx(\"input\",{type:\"password\",id:\"password\",name:\"password\",value:formData.password,onChange:handleInputChange,placeholder:\"Password\"})]})]}),/*#__PURE__*/_jsx(motion.button,{type:\"submit\",className:\"submit-button\",whileHover:{scale:1.05},whileTap:{scale:.95},children:\"Start Listening\"})]}),/*#__PURE__*/_jsx(\"style\",{jsx:true,children:`\n                .container {\n                    // display: flex;\n                    flex-direction: column;\n                    align-items: center;\n                    justify-content: center;\n                    color: #fff;\n                    font-family: Arial, sans-serif;\n                    padding: 40px;\n                    border-radius: 10px;\n                }\n\n                h1 {\n                    margin-bottom: 20px;\n                    text-align:center;\n                }\n\n                .form-group {\n                    text-align: left;\n                    position:relative;\n                }\n\n                .input-wrapper {\n                    margin-bottom:20px;\n                    overflow:hidden;\n                    border-radius:8px;\n                }\n\n                .form-group label {\n                    position:absolute;\n                    top:8px;\n                    left:10px;\n                    display: none;\n                    margin-bottom: 5px;\n                    color: #aaa;\n                }\n                .form-group label.filled {\n                    display:block;\n                }\n\n                .form-group input {\n                    width: 100%;\n                    padding: 30px 10px 20px 10px;\n                    border: none;\n                    background-color: #272329;\n                    color: #fff;\n                    font-size: 16px;\n                    outline:none;\n                }\n                .form-group input.email {\n                    border-top:1px solid black;                    \n                    border-bottom:1px solid black;\n                }\n\n                .form-group input::placeholder {\n                    color: #888;\n                }\n\n                .submit-button {\n                    width: 100%;\n                    padding: 15px;\n                    border: none;\n                    border-radius: 30px;\n                    background: #FFF;\n                    text-transform:uppercase;\n                    color: #000;\n                    font-weight:bold;\n                    font-size: 14px;\n                    cursor: pointer;\n                    letter-spacing:1px;\n                }\n\n                .submit-button:hover {\n\n                }\n            `})]});}addPropertyControls(SignupForm,{UTMCode:{title:\"UTM Code\",type:ControlType.String,defaultValue:\"Type...\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SignupForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomForm.map"],"mappings":"A,gPAA2K,SAAwBc,EAAW,EAAM,CAAC,GAAK,CAACC,EAASC,GAAahB,EAAS,CAAC,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,UAAUiB,EAAM,OAAO,CAAC,EAAQC,EAAkB,GAAO,CAAC,GAAK,CAAC,OAAK,SAAOC,EAAM,OAAOH,EAAY,CAAC,GAAGD,GAAUK,GAAMC,CAAK,CAAC,CAAE,EAAQC,EAAa,KAAM,IAAO,CAACH,EAAM,eAAe,EAAE,GAAG,CAAC,IAAMI,EAAS,MAAM,MAAM,4CAA4C,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,kBAAkB,EAAE,KAAK,KAAK,UAAUR,CAAQ,CAAC,CAAC,EAAQS,EAAM,MAAMD,EAAS,KAAK,EAAKA,EAAS,GAAIE,EAASD,EAAM,OAAOT,EAAS,SAAS,EAAQ,QAAQ,MAAM,gBAAgBS,CAAK,CAAG,OAAOE,EAAM,CAAC,QAAQ,MAAM,SAASA,CAAK,CAAE,CAAC,EAAQD,GAAU,EAAM,EAAU,EAAQ,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