{"version":3,"file":"FormValidation.CFmoYrA9.mjs","names":[],"sources":["https:/framerusercontent.com/modules/t3aC2H1wOVTm56OHKg6q/LpoUsnmKyz5ZIw2q3CRY/FormValidation.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{EmailDomainList}from\"https://framerusercontent.com/modules/4XCbkV06reIR1Un4aQCF/4qeopk5sX2QHq7uBlrwh/EmailDomainList.js\";import{WithSetEmail}from\"https://framerusercontent.com/modules/ugr44lNtDxyUiUtllp4p/UJd3UhZF38ZErssfYGOf/Revenue_Filter.js\";// Learn more: https://www.framer.com/developers/overrides/\nexport function withEmailValidation(Component){return props=>{const setEmail=WithSetEmail();function validateEmail(e){const emailInput=e.target;const emailValue=emailInput.value.trim();// Personal email domains to block\nconst blockedDomains=EmailDomainList;const emailPattern=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;if(!emailPattern.test(emailValue)){emailInput.setCustomValidity(\"Invalid email\");return false;}const emailDomain=emailValue.split(\"@\")[1];// console.log(\"emailDomain Typed: \", emailDomain)\n// console.log(\"Block? \", blockedDomains.includes(emailDomain))\nif(blockedDomains.includes(emailDomain)){// window.posthog &&\n//     window.posthog.capture(\"junk_lead_submission_attempt\", {\n//         email: emailValue,\n//     })\nemailInput.setCustomValidity(\"Please enter a business email.\");return false;}setEmail(emailValue);emailInput.setCustomValidity(\"\");return true;}return /*#__PURE__*/_jsx(Component,{...props,onChange:validateEmail});};}export function withWebsiteValidation(Component){return props=>{useEffect(()=>{const websiteInput=document.querySelector('input[name=\"website\"]');if(websiteInput){websiteInput.addEventListener(\"input\",validateWebsite);}function validateWebsite(){const websiteValue=websiteInput.value.trim();const websitePattern=/^(https?:\\/\\/)?(www\\.)?[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$/// Improved to handle multi-level domains\n;const invalidDomains=[\"example.com\",\"test.com\",\"fake.com\",\"invalid.com\",\"mobileplazza.com\"];if(!websitePattern.test(websiteValue)){websiteInput.setCustomValidity(\"Invalid website\");return;}const websiteDomain=websiteValue.replace(/^(https?:\\/\\/)?(www\\.)?/,\"\");const topLevelDomain=websiteDomain.split(\"/\")[0].toLowerCase();if(invalidDomains.some(domain=>topLevelDomain===domain||topLevelDomain.endsWith(`.${domain}`))){websiteInput.setCustomValidity(\"Blocked website\");return;}websiteInput.setCustomValidity(\"\");}return()=>{if(websiteInput){websiteInput.removeEventListener(\"input\",validateWebsite);}};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withEmailValidation\":{\"type\":\"reactHoc\",\"name\":\"withEmailValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withWebsiteValidation\":{\"type\":\"reactHoc\",\"name\":\"withWebsiteValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"oUACA,SAAgB,EAAoB,EAAU,CAAC,MAAO,CAAA,GAAO,CAAC,IAAM,EAAS,GAAc,CAAC,SAAS,EAAc,EAAE,CAAC,IAAM,EAAW,EAAE,OAAa,EAAW,EAAW,MAAM,MAAM,CAClL,EAAe,EAAsB,EAAa,mDAAmD,IAAI,EAAa,KAAK,EAAW,CAAgD,MAA9C,GAAW,kBAAkB,gBAAgB,EAAQ,MAAa,EAAY,EAAW,MAAM,IAAI,CAAC,GAM/G,MAJhI,GAAe,SAAS,EAAY,EAIvC,EAAW,kBAAkB,iCAAiC,EAAQ,MAAgB,EAAW,CAAC,EAAW,kBAAkB,GAAG,EAAQ,EAAM,OAAoB,GAAK,EAAU,CAAC,GAAG,EAAM,SAAS,CAAc,EAAC,AAAE,CAAE,UAAgB,EAAsB,EAAU,CAAC,MAAO,CAAA,IAAQ,EAAU,IAAI,CAAC,IAAM,EAAa,SAAS,cAAc,wBAAwB,CAAC,AAAG,GAAc,EAAa,iBAAiB,QAAQ,EAAgB,CAAE,SAAS,GAAiB,CAAC,IAA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