{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/5v97LekurpOPVnB4wfLa/F2K9ZeXLZmaR7kjvI5h3/WorkEmailInput.js"],
  "sourcesContent": ["// Custom input field that validates work email addresses, excluding free providers\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useCallback,startTransition,useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Work Email Input Field\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function WorkEmailInput(props){const{name,placeholder,label,showLabel,required,backgroundColor,borderColor,focusBorderColor,errorBorderColor,textColor,errorTextColor,font,borderRadius,padding,errorMessage,successMessage,showValidationMessage,onValueChange}=props;const[value,setValue]=useState(\"\");const[isFocused,setIsFocused]=useState(false);const[validationState,setValidationState]=useState(\"none\");const inputRef=useRef(null);// List of common free email providers to exclude\nconst freeProviders=[\"gmail.com\",\"yahoo.com\",\"hotmail.com\",\"outlook.com\",\"aol.com\",\"icloud.com\",\"mail.com\",\"protonmail.com\",\"yandex.com\",\"zoho.com\",\"live.com\",\"msn.com\",\"yahoo.co.uk\",\"googlemail.com\",\"me.com\",\"mac.com\",\"rocketmail.com\",\"ymail.com\",\"aim.com\",\"fastmail.com\"];const validateEmail=useCallback(email=>{// Basic email regex\nconst emailRegex=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;if(!emailRegex.test(email)){return false;}// Extract domain\nconst domain=email.split(\"@\")[1]?.toLowerCase();if(!domain){return false;}// Check if it's a free provider\nreturn!freeProviders.includes(domain);},[]);const handleChange=useCallback(e=>{const newValue=e.target.value;setValue(newValue);let newValidationState;let isValid=false;if(newValue.trim()===\"\"){newValidationState=\"none\";isValid=!required// If not required, empty is valid\n;}else{isValid=validateEmail(newValue);newValidationState=isValid?\"valid\":\"invalid\";}startTransition(()=>setValidationState(newValidationState));// Use HTML5 validation API to control form submission\nif(inputRef.current){if(newValue.trim()===\"\"&&!required){inputRef.current.setCustomValidity(\"\");}else if(newValue.trim()===\"\"&&required){inputRef.current.setCustomValidity(\"This field is required\");}else if(!isValid){inputRef.current.setCustomValidity(\"Please enter a valid work email address\");}else{inputRef.current.setCustomValidity(\"\");}}// Notify parent component (Framer form) of value and validation state\nif(onValueChange){onValueChange(newValue,isValid);}},[validateEmail,required,onValueChange]);// Notify parent of initial state and set initial validation\nuseEffect(()=>{if(onValueChange){const isValid=value.trim()===\"\"?!required:validateEmail(value);onValueChange(value,isValid);}// Set initial validation state\nif(inputRef.current){if(value.trim()===\"\"&&required){inputRef.current.setCustomValidity(\"This field is required\");}else if(value.trim()!==\"\"&&!validateEmail(value)){inputRef.current.setCustomValidity(\"Please enter a valid work email address\");}else{inputRef.current.setCustomValidity(\"\");}}},[]);const handleFocus=useCallback(()=>{startTransition(()=>setIsFocused(true));},[]);const handleBlur=useCallback(()=>{startTransition(()=>setIsFocused(false));},[]);const getBorderColor=()=>{if(validationState===\"invalid\")return errorBorderColor;if(isFocused)return focusBorderColor;return borderColor;};const getValidationMessage=()=>{if(!showValidationMessage||validationState===\"none\")return null;if(validationState===\"invalid\"){return /*#__PURE__*/_jsx(\"div\",{style:{...font,fontSize:\"12px\",color:errorTextColor,marginTop:\"4px\"},children:errorMessage});}if(validationState===\"valid\"){return /*#__PURE__*/_jsx(\"div\",{style:{...font,fontSize:\"12px\",color:textColor,marginTop:\"4px\"},children:successMessage});}return null;};return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,width:\"100%\",display:\"flex\",flexDirection:\"column\"},children:[showLabel&&/*#__PURE__*/_jsxs(\"label\",{htmlFor:name,style:{...font,color:textColor,marginBottom:\"8px\",fontSize:\"14px\"},children:[label,required&&\" *\"]}),/*#__PURE__*/_jsx(\"input\",{id:name,name:name,type:\"email\",value:value,onChange:handleChange,onFocus:handleFocus,onBlur:handleBlur,placeholder:placeholder,required:required,\"data-framer-form-field\":name,\"data-valid\":validationState===\"valid\"||validationState===\"none\"&&!required,style:{...font,width:\"100%\",padding:`${padding}px`,backgroundColor,border:`2px solid ${getBorderColor()}`,borderRadius:`${borderRadius}px`,color:textColor,fontSize:\"16px\",outline:\"none\",transition:\"border-color 0.2s ease\",boxSizing:\"border-box\"},\"aria-invalid\":validationState===\"invalid\",\"aria-describedby\":showValidationMessage?\"validation-message\":undefined,\"aria-required\":required,ref:inputRef}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:`${name}_validation`,value:validationState===\"valid\"||validationState===\"none\"&&!required?\"valid\":\"\",required:true,\"data-framer-form-field\":`${name}_validation`}),/*#__PURE__*/_jsx(\"div\",{id:\"validation-message\",children:getValidationMessage()})]});}addPropertyControls(WorkEmailInput,{name:{type:ControlType.String,title:\"Field Name\",defaultValue:\"workEmail\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Work Email\"},showLabel:{type:ControlType.Boolean,title:\"Show Label\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},required:{type:ControlType.Boolean,title:\"Required\",defaultValue:true,enabledTitle:\"Required\",disabledTitle:\"Optional\"},placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Enter your work email address\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#EEEEEE\"},focusBorderColor:{type:ControlType.Color,title:\"Focus Border\",defaultValue:\"#000000\"},errorBorderColor:{type:ControlType.Color,title:\"Error Border\",defaultValue:\"#FF5588\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},errorTextColor:{type:ControlType.Color,title:\"Error Text\",defaultValue:\"#FF5588\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,unit:\"px\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:12,min:4,max:24,unit:\"px\"},showValidationMessage:{type:ControlType.Boolean,title:\"Show Validation\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},errorMessage:{type:ControlType.String,title:\"Error Message\",defaultValue:\"Please enter a valid work email address\",hidden:({showValidationMessage})=>!showValidationMessage},successMessage:{type:ControlType.String,title:\"Success Message\",defaultValue:\"Valid work email address\",hidden:({showValidationMessage})=>!showValidationMessage}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WorkEmailInput\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WorkEmailInput.map"],
  "mappings": "mIAMkB,SAARA,EAAgCC,EAAM,CAAC,GAAK,CAAC,KAAAC,EAAK,YAAAC,EAAY,MAAAC,EAAM,UAAAC,EAAU,SAAAC,EAAS,gBAAAC,EAAgB,YAAAC,EAAY,iBAAAC,EAAiB,iBAAAC,EAAiB,UAAAC,EAAU,eAAAC,EAAe,KAAAC,EAAK,aAAAC,EAAa,QAAAC,EAAQ,aAAAC,EAAa,eAAAC,EAAe,sBAAAC,EAAsB,cAAAC,CAAa,EAAElB,EAAW,CAACmB,EAAMC,CAAQ,EAAEC,EAAS,EAAE,EAAO,CAACC,EAAUC,CAAY,EAAEF,EAAS,EAAK,EAAO,CAACG,EAAgBC,CAAkB,EAAEJ,EAAS,MAAM,EAAQK,EAASC,EAAO,IAAI,EACzbC,EAAc,CAAC,YAAY,YAAY,cAAc,cAAc,UAAU,aAAa,WAAW,iBAAiB,aAAa,WAAW,WAAW,UAAU,cAAc,iBAAiB,SAAS,UAAU,iBAAiB,YAAY,UAAU,cAAc,EAAQC,EAAcC,EAAYC,GAAO,CAC3Q,GAAG,CAAhC,6BAA4C,KAAKA,CAAK,EAAG,MAA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,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,EAAE,QAAQ,CAAC,KAAKA,EAAY,OAAO,MAAM,UAAU,aAAa,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,EAAE,sBAAsB,CAAC,KAAKA,EAAY,QAAQ,MAAM,kBAAkB,aAAa,GAAK,aAAa,OAAO,cAAc,MAAM,EAAE,aAAa,CAAC,KAAKA,EAAY,OAAO,MAAM,gBAAgB,aAAa,0CAA0C,OAAO,CAAC,CAAC,sBAAA9B,CAAqB,IAAI,CAACA,CAAqB,EAAE,eAAe,CAAC,KAAK8B,EAAY,OAAO,MAAM,kBAAkB,aAAa,2BAA2B,OAAO,CAAC,CAAC,sBAAA9B,CAAqB,IAAI,CAACA,CAAqB,CAAC,CAAC",
  "names": ["WorkEmailInput", "props", "name", "placeholder", "label", "showLabel", "required", "backgroundColor", "borderColor", "focusBorderColor", "errorBorderColor", "textColor", "errorTextColor", "font", "borderRadius", "padding", "errorMessage", "successMessage", "showValidationMessage", "onValueChange", "value", "setValue", "ye", "isFocused", "setIsFocused", "validationState", "setValidationState", "inputRef", "pe", "freeProviders", "validateEmail", "te", "email", "domain", "handleChange", "e", "newValue", "newValidationState", "isValid", "Z", "ue", "handleFocus", "handleBlur", "getBorderColor", "getValidationMessage", "p", "u", "addPropertyControls", "ControlType"]
}
