{"version":3,"file":"WorkEmailValidation.CemIjs1h.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/YGYIEQD5f6FvLY2FrgIZ/3JTF04PXI4s3nrpMzHia/WorkEmailValidation.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useState}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\";// 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 workEmailOnly(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[error,setError]=useState(\"\");const workEmailRegex=/^(?!.*@(gmail\\.com|yahoo\\.com|hotmail\\.com|outlook\\.com|icloud\\.com)$).+@.+\\..+$/;const handleSubmit=e=>{e.preventDefault();const form=e.currentTarget.closest(\"form\");if(!form)return;const emailInput=form.querySelector('input[type=\"email\"]');emailInput.setCustomValidity(\"\");emailInput.reportValidity();if(!form.checkValidity()){form.reportValidity();return;}if(!emailInput){return;}const email=emailInput.value.trim();if(!workEmailRegex.test(email)){emailInput.setCustomValidity(\"Please use your work email address.\");emailInput.reportValidity();return;}form.requestSubmit();setTimeout(()=>{form.reset();},500);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleSubmit});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"workEmailOnly\":{\"type\":\"reactHoc\",\"name\":\"workEmailOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WorkEmailValidation.map"],"mappings":"wLACgqB,SAAgB,EAAc,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAO,EAAe,mFAAyF,EAAa,GAAG,CAAC,EAAE,gBAAgB,CAAC,IAAM,EAAK,EAAE,cAAc,QAAQ,OAAO,CAAC,GAAG,CAAC,EAAK,OAAO,IAAM,EAAW,EAAK,cAAc,sBAAsB,CAA8D,GAA7D,EAAW,kBAAkB,GAAG,CAAC,EAAW,gBAAgB,CAAI,CAAC,EAAK,eAAe,CAAC,CAAC,EAAK,gBAAgB,CAAC,OAAQ,GAAG,CAAC,EAAY,OAAQ,IAAM,EAAM,EAAW,MAAM,MAAM,CAAC,GAAG,CAAC,EAAe,KAAK,EAAM,CAAC,CAAC,EAAW,kBAAkB,sCAAsC,CAAC,EAAW,gBAAgB,CAAC,OAAQ,EAAK,eAAe,CAAC,eAAe,CAAC,EAAK,OAAO,EAAG,IAAI,EAAG,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,QAAQ,EAAa,CAAC,EAAG,kBADx7C,IAAuC,IAAqE,IAAqE,CAC7M,EAAY,CAAC,WAAW,UAAU,CAAC"}