{"version":3,"file":"RecaptchaInput_2.Bo-RhoJD.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/q6yicKls4iKdMpngB1wK/fEjC9ZjNcnYV0aftdcZo/RecaptchaInput_2.js"],"sourcesContent":["// RecaptchaInput: Framer reCAPTCHA input that is required by Framer Form. Fixes hidden input to allow required validation.\n//The error you’re seeing on the reCAPTCHA component onframer project canvas is normal — it won’t appear on the published domain.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * RecaptchaInput\n *\n * Framer reCAPTCHA input that is required by Framer Form. Hidden input is not readOnly so required validation works.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function RecaptchaInput(props){const{siteKey,size,errorMessage,style}=props;const containerRef=useRef(null);const inputRef=useRef(null);const[verified,setVerified]=useState(false);const[error,setError]=useState(\"\");// Load reCAPTCHA script\nuseEffect(()=>{if(typeof window===\"undefined\"||!siteKey)return;const existingScript=document.querySelector(\"#google-recaptcha-script\");if(!existingScript){const script=document.createElement(\"script\");script.id=\"google-recaptcha-script\";script.src=`https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit&_=${Date.now()}`;script.async=true;script.defer=true;document.body.appendChild(script);}else{if(window.grecaptcha?.render){window.onRecaptchaLoad();}}window.onRecaptchaLoad=()=>{if(!window.grecaptcha||!containerRef.current)return;try{window.grecaptcha.render(containerRef.current,{sitekey:siteKey.trim(),size,callback:token=>{startTransition(()=>{const valid=!!token;setVerified(valid);setError(valid?\"\":errorMessage);});},\"expired-callback\":()=>{startTransition(()=>{setVerified(false);setError(errorMessage);});},\"error-callback\":()=>{startTransition(()=>{setVerified(false);setError(\"Invalid site key or configuration.\");});}});}catch(err){console.error(\"reCAPTCHA render error:\",err);setError(\"Failed to render reCAPTCHA.\");}};},[siteKey,size]);// Trigger input + change events for Framer Form validation\nuseEffect(()=>{if(!inputRef.current)return;const input=inputRef.current;const event=new Event(\"input\",{bubbles:true});const change=new Event(\"change\",{bubbles:true});input.value=verified?\"1\":\"\";input.dispatchEvent(event);input.dispatchEvent(change);},[verified]);if(!siteKey||siteKey.trim().length<30){return /*#__PURE__*/_jsx(\"div\",{style:{color:\"#c00\",fontSize:13},children:\"⚠️ Invalid reCAPTCHA site key. Add a valid key in Property Controls.\"});}if(RenderTarget.current()===RenderTarget.thumbnail)return null;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"flex-start\",...style},children:[/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{minHeight:size===\"compact\"?60:80,width:size===\"compact\"?180:304}}),error&&/*#__PURE__*/_jsx(\"span\",{style:{color:\"#c00\",fontSize:13,marginTop:6},children:error}),/*#__PURE__*/_jsx(\"input\",{ref:inputRef,type:\"text\",name:\"recaptcha\",value:verified?\"1\":\"\",required:true,style:{opacity:0,height:0,width:0,position:\"absolute\"},tabIndex:-1,\"aria-hidden\":\"true\",autoComplete:\"off\"})]});}addPropertyControls(RecaptchaInput,{siteKey:{type:ControlType.String,title:\"Site Key\",placeholder:\"Paste reCAPTCHA site key\"},size:{type:ControlType.Enum,title:\"Size\",options:[\"normal\",\"compact\"],optionTitles:[\"Normal\",\"Compact\"],defaultValue:\"normal\",displaySegmentedControl:true},errorMessage:{type:ControlType.String,title:\"Error Message\",defaultValue:\"Please verify you are not a robot.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RecaptchaInput\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RecaptchaInput_2.map"],"mappings":"uNASG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,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