{"version":3,"file":"FormValidation.BwLLJrQJ.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/Z6l5qF9ylZTCHf7Sjow9/YRf4X4kUHKBBO8CZSnlg/Selective_Day_Picker.js","https:/framerusercontent.com/modules/KYneNRzteefLWuC0eHir/sNUY5bhHeQB9Lybivudm/FormValidation.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function EmailInput(props){const[email,setEmail]=React.useState(\"\");const[isValid,setIsValid]=React.useState(true);const[isFocused,setIsFocused]=React.useState(false);const inputRef=React.useRef(null);// Inject dynamic CSS for placeholder color\nReact.useEffect(()=>{const styleTag=document.createElement(\"style\");styleTag.innerHTML=`\n            .dynamic-placeholder::placeholder {\n                color: ${props.placeholderTextColor};\n            }\n        `;document.head.appendChild(styleTag);return()=>{document.head.removeChild(styleTag)// Clean up the style when component unmounts\n;};},[props.placeholderTextColor]);const validateEmail=value=>{const emailRegex=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;const domain=value.split(\"@\")[1];if(emailRegex.test(value)&&!props.blockedDomains.includes(domain)){setIsValid(true);}else{setIsValid(false);}};return /*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"input\",{ref:inputRef,className:\"dynamic-placeholder\",type:\"email\",name:props.name,required:props.required,placeholder:props.placeholder,value:email,onFocus:()=>setIsFocused(true),onBlur:()=>setIsFocused(false),onChange:e=>{const value=e.target.value;setEmail(value);validateEmail(value);},style:{color:props.inputTextColor,borderColor:isFocused?props.focus.focusBorderColor:props.border.borderColor,backgroundColor:isFocused?props.focus.focusBackgroundColor:props.backgroundColor,borderRadius:`${props.borderRadius}px`,borderWidth:`${props.border.borderWidth}px`,borderStyle:\"solid\",padding:`${props.padding}px`,width:\"100%\",boxSizing:\"border-box\",fontFamily:props.fontStyle.fontFamily,fontSize:props.fontStyle.fontSize,fontWeight:props.fontStyle.fontWeight,lineHeight:props.fontStyle.lineHeight,letterSpacing:props.fontStyle.letterSpacing,textAlign:props.fontStyle.textAlign,outline:isValid?\"none\":\"1px solid red\",marginBottom:!isValid?\"4px\":\"0px\"}}),!isValid&&/*#__PURE__*/_jsx(\"span\",{style:{color:\"red\",marginTop:\"4px\"},className:\"_email_error\",children:\"Use business email only\"})]});}// Set default values for properties\nEmailInput.defaultProps={name:\"email\",required:true,placeholder:\"Enter your email\",inputTextColor:\"#999999\",placeholderTextColor:\"#999999\",backgroundColor:\"rgba(187, 187, 187, 0.15)\",borderRadius:10,borderWidth:1,padding:10,blockedDomains:[\"gmail.com\",\"yahoo.com\",\"hotmail.com\"]};// Property controls for customization in Framer UI\naddPropertyControls(EmailInput,{name:{type:ControlType.String,title:\"Field Name\"},required:{type:ControlType.Boolean,title:\"Required\"},fontStyle:{type:ControlType.Font,controls:\"extended\",displayFontSize:true,displayTextAlignment:false,defaultFontType:\"sans-serif\",defaultValue:{fontSize:14,lineHeight:\"1.2em\"}},placeholder:{type:ControlType.String,title:\"Placeholder\"},inputTextColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#999999\"},placeholderTextColor:{type:ControlType.Color,title:\"Placeholder Color\",defaultValue:\"#999999\"},backgroundColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"rgba(187, 187, 187, 0.15)\"},borderRadius:{type:ControlType.Number,title:\"Radius\",min:0,max:50,defaultValue:10},padding:{type:ControlType.Number,title:\"Padding\",min:0,max:50,defaultValue:10},focus:{type:ControlType.Object,title:\"Focus Style\",controls:{focusBorderColor:{type:ControlType.Color,title:\"Focus Border Color\",defaultValue:\"#0099FF\"},focusBackgroundColor:{type:ControlType.Color,title:\"Focus Fill\",defaultValue:\"#f5f5f5\"}}},border:{type:ControlType.Object,title:\"Border Style\",controls:{borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"rgba(136, 136, 136, 0.15)\"},borderWidth:{type:ControlType.Number,title:\"Border Stroke Width\",min:1,max:10,defaultValue:1}}},blockedDomains:{type:ControlType.Array,title:\"Blocked Domains\",propertyControl:{type:ControlType.String},defaultValue:[\"gmail.com\",\"yahoo.com\",\"hotmail.com\"]}});// Add the new prop for validation callback\nEmailInput.defaultProps={...EmailInput.defaultProps,onValidationChange:undefined};\nexport const __FramerMetadata__ = {\"exports\":{\"EmailInput\":{\"type\":\"reactComponent\",\"name\":\"EmailInput\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Selective_Day_Picker.map","import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";// Learn more: https://www.framer.com/developers/overrides/\nexport function withFormId(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,id:\"book_demo_form\"});};}export function withValidateEmail(Component){return props=>{const sub=React.useRef();console.log(\"render\",props);const submit=()=>{const elem=document.getElementsByClassName(\"_email_error\");if(elem===null||elem===void 0?void 0:elem.length){console.log(\"表单错误，阻止提交\");return false;}console.log(\"表单正确，提交表单\");sub.current.click();return true;};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"input\",{type:\"submit\",ref:sub,style:{visibility:\"hidden\",position:\"absolute\",zIndex:-1}}),/*#__PURE__*/_jsx(Component,{...props,type:\"button\",onClick:submit,style:{zIndex:1}})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withFormId\":{\"type\":\"reactHoc\",\"name\":\"withFormId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withValidateEmail\":{\"type\":\"reactHoc\",\"name\":\"withValidateEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormValidation.map"],"mappings":"gSAAyI,SAAgB,EAAW,EAAM,CAAC,GAAK,CAAC,EAAM,EAAS,CAAA,EAAgB,IAAS,CAAC,EAAQ,EAAW,CAAA,EAAgB,IAAW,CAA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