{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/mqfJgwCRKtjUdOJG4TQF/Ou2HzqFyItwAQcU1iNji/Email_save.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{EmailDomainList}from\"https://framerusercontent.com/modules/4XCbkV06reIR1Un4aQCF/JAqmSbYMyrVYBUKrO7fa/EmailDomainList.js\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({email:\"\"});//helper function\nexport function validateEmail(email){const emailValue=email.trim();const blockedDomains=EmailDomainList;const emailPattern=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;if(!emailPattern.test(emailValue)){return false;}const emailDomain=emailValue.split(\"@\")[1];if(blockedDomains.includes(emailDomain)){// if (typeof window !== \"undefined\" && (window as any).posthog) {\n//     ;(window as any).posthog.capture(\"junk_lead_submission_attempt\", {\n//         email: emailValue,\n//     })\n// }\nreturn false;}return true;}export function withEmailPass(Component){return props=>{const[store]=useStore();// const getEmail = WithEmailValue() // \u2705 Hook inside a function component\nreturn /*#__PURE__*/_jsx(Component,{...props,getEmail:validateEmail(store.email)?store.email:\"\"});};}function validateEmailInput(input){const value=input.value.trim();const emailPattern=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;if(!emailPattern.test(value)){input.setCustomValidity(\"Invalid email\");return false;}const domain=value.split(\"@\")[1];if(EmailDomainList.includes(domain)){// window.posthog?.capture(\"junk_lead_submission_attempt\", {\n//     email: value || \"email@notfound.com\",\n// })\ninput.setCustomValidity(\"Please enter your business email\");return false;}input.setCustomValidity(\"\");return true;}export function withEmailSave(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,onChange:e=>{const target=e.target;validateEmailInput(target);setStore({email:target.value});}});};}export function withFormEmailInsert(Component){return props=>{const[store,setStore]=useStore();useEffect(()=>{const selector=window.location.href.includes(\"/sale\")?'input[type=\"email\"]':'.focus-form-full input[type=\"email\"]';const emailField=document.querySelector(selector);if(emailField){emailField.value=store.email;validateEmailInput(emailField);}},[store.email]);return /*#__PURE__*/_jsx(Component,{...props,onChange:e=>{const target=e.target;validateEmailInput(target);setStore({email:target.value});}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"validateEmail\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailSave\":{\"type\":\"reactHoc\",\"name\":\"withEmailSave\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFormEmailInsert\":{\"type\":\"reactHoc\",\"name\":\"withFormEmailInsert\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailPass\":{\"type\":\"reactHoc\",\"name\":\"withEmailPass\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Email_save.map"],
  "mappings": "uLAAAA,IACA,IAAMC,EAASC,EAAY,CAAC,MAAM,EAAE,CAAC,EAC9B,SAASC,EAAcC,EAAM,CAAC,IAAMC,EAAWD,EAAM,KAAK,EAAQE,EAAeC,EAAsF,GAAG,CAAtD,mDAAoE,KAAKF,CAAU,EAAG,MAAO,GAAO,IAAMG,EAAYH,EAAW,MAAM,GAAG,EAAE,CAAC,EAAE,MAAG,CAAAC,EAAe,SAASE,CAAW,CAKtR,CAAQ,SAASC,EAAcC,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,CAAK,EAAEX,EAAS,EACzG,OAAoBY,EAAKH,EAAU,CAAC,GAAGC,EAAM,SAASR,EAAcS,EAAM,KAAK,EAAEA,EAAM,MAAM,EAAE,CAAC,CAAE,CAAE,CAAC,SAASE,EAAmBC,EAAM,CAAC,IAAMC,EAAMD,EAAM,MAAM,KAAK,EAAwE,GAAG,CAAtD,mDAAoE,KAAKC,CAAK,EAAG,OAAAD,EAAM,kBAAkB,eAAe,EAAS,GAAO,IAAME,EAAOD,EAAM,MAAM,GAAG,EAAE,CAAC,EAAE,OAAGT,EAAgB,SAASU,CAAM,GAGrYF,EAAM,kBAAkB,kCAAkC,EAAS,KAAOA,EAAM,kBAAkB,EAAE,EAAS,GAAK,CAAQ,SAASG,EAAcR,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,EAAMO,CAAQ,EAAElB,EAAS,EAAE,OAAoBY,EAAKH,EAAU,CAAC,GAAGC,EAAM,SAASS,GAAG,CAAC,IAAMC,EAAOD,EAAE,OAAON,EAAmBO,CAAM,EAAEF,EAAS,CAAC,MAAME,EAAO,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAE,CAAQ,SAASC,EAAoBZ,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,EAAMO,CAAQ,EAAElB,EAAS,EAAE,OAAAsB,EAAU,IAAI,CAAC,IAAMC,EAAS,OAAO,SAAS,KAAK,SAAS,OAAO,EAAE,sBAAsB,uCAA6CC,EAAW,SAAS,cAAcD,CAAQ,EAAKC,IAAYA,EAAW,MAAMb,EAAM,MAAME,EAAmBW,CAAU,EAAG,EAAE,CAACb,EAAM,KAAK,CAAC,EAAsBC,EAAKH,EAAU,CAAC,GAAGC,EAAM,SAASS,GAAG,CAAC,IAAMC,EAAOD,EAAE,OAAON,EAAmBO,CAAM,EAAEF,EAAS,CAAC,MAAME,EAAO,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAE",
  "names": ["init_ssg_sandbox_shims", "useStore", "createStore", "validateEmail", "email", "emailValue", "blockedDomains", "EmailDomainList", "emailDomain", "withEmailPass", "Component", "props", "store", "p", "validateEmailInput", "input", "value", "domain", "withEmailSave", "setStore", "e", "target", "withFormEmailInsert", "ue", "selector", "emailField"]
}
