{"version":3,"file":"Recaptcha.BaFoteAI.mjs","names":["useRef","useState","__esmMin","init_ssg_sandbox_shims","_e","de","init_jsx_runtime","c","p","init_npm_react_18_3_1","ce","window","addPropertyControls","init_framer_CN96F41L","ControlType","useIsStaticRenderer","loadRecaptcha","resolve","script","reject","Recaptcha","props","key","siteKey","DEFAULT_SITE_KEY","isStatic","hostRef","widgetRef","verifiedRef","activeRef","showError","setShowError","host","form","cancelled","widgetId","block","event","target","submitter","theme","size","width","height","errorColor","errorText","init_Recaptcha"],"sources":["https:/framerusercontent.com/modules/2pTsSJu9omUuVqnQXRO8/mVFI4AHHad6sHyQnxzb9/Recaptcha.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";// Paste the reCAPTCHA v2 (\"I'm not a robot\" checkbox) SITE key here once.\n// Every reCAPTCHA instance on the site uses it unless its own Site Key control is filled in.\n// While this is empty the widget is hidden on the live site and forms submit as normal.\nconst DEFAULT_SITE_KEY=\"6Lc9MgUuAAAAAJU_7BOazIq9t_sS8JouFKYl8S-q\";function loadRecaptcha(){if(window.grecaptcha&&window.grecaptcha.render)return Promise.resolve();if(window.__ctadRecaptchaLoad)return window.__ctadRecaptchaLoad;window.__ctadRecaptchaLoad=new Promise((resolve,reject)=>{window.__ctadRecaptchaReady=()=>resolve();const script=document.createElement(\"script\");script.src=\"https://www.google.com/recaptcha/api.js?onload=__ctadRecaptchaReady&render=explicit\";script.async=true;script.defer=true;script.onerror=()=>{window.__ctadRecaptchaLoad=undefined;reject(new Error(\"reCAPTCHA failed to load\"));};document.head.appendChild(script);});return window.__ctadRecaptchaLoad;}/**\n * reCAPTCHA v2 checkbox for native Framer forms.\n * Place it inside a form. Until the visitor ticks the box, submitting that form is blocked\n * and a short message is shown.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Recaptcha(props){const{siteKey,theme,size,errorText,errorColor}=props;const key=(siteKey||DEFAULT_SITE_KEY||\"\").trim();const isStatic=useIsStaticRenderer();const hostRef=useRef(null);const widgetRef=useRef(null);const verifiedRef=useRef(false);const activeRef=useRef(false);const[showError,setShowError]=useState(false);useEffect(()=>{if(isStatic||!key||typeof window===\"undefined\")return;const host=hostRef.current;const form=host?host.closest(\"form\"):null;let cancelled=false;let widgetId;loadRecaptcha().then(()=>{window.grecaptcha.ready(()=>{if(cancelled||!widgetRef.current)return;widgetId=window.grecaptcha.render(widgetRef.current,{sitekey:key,theme,size,callback:()=>{verifiedRef.current=true;setShowError(false);},\"expired-callback\":()=>{verifiedRef.current=false;},\"error-callback\":()=>{verifiedRef.current=false;}});activeRef.current=true;});}).catch(()=>{// If Google's script can't load, don't lock real visitors out of the form.\nactiveRef.current=false;});const block=event=>{if(!activeRef.current||verifiedRef.current)return;if(event.type===\"click\"){const target=event.target;const submitter=target?target.closest(\"button, [type=submit]\"):null;if(!submitter||submitter.getAttribute(\"type\")===\"button\")return;}event.preventDefault();event.stopPropagation();event.stopImmediatePropagation();setShowError(true);};if(form){form.addEventListener(\"submit\",block,true);form.addEventListener(\"click\",block,true);}return()=>{cancelled=true;if(form){form.removeEventListener(\"submit\",block,true);form.removeEventListener(\"click\",block,true);}try{if(widgetId!==undefined&&window.grecaptcha)window.grecaptcha.reset(widgetId);}catch(e){}};},[key,theme,size,isStatic]);const width=size===\"compact\"?164:304;const height=size===\"compact\"?144:78;if(isStatic){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:6},children:[/*#__PURE__*/_jsxs(\"div\",{style:{width,height,boxSizing:\"border-box\",border:\"1px solid #d3d3d3\",borderRadius:3,background:theme===\"dark\"?\"#222\":\"#f9f9f9\",boxShadow:\"0 0 4px 1px rgba(0,0,0,0.08)\",display:\"flex\",alignItems:\"center\",gap:12,padding:\"0 12px\",fontFamily:\"Roboto, Helvetica, Arial, sans-serif\",fontSize:14,color:theme===\"dark\"?\"#fff\":\"#000\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:24,height:24,border:\"2px solid #c1c1c1\",borderRadius:2,background:\"#fff\",flexShrink:0}}),/*#__PURE__*/_jsx(\"span\",{children:\"I'm not a robot\"})]}),!key&&/*#__PURE__*/_jsx(\"span\",{style:{fontSize:12,color:\"#b42318\",fontFamily:\"Inter, sans-serif\"},children:\"reCAPTCHA preview: add the site key to switch it on\"})]});}if(!key)return null;return /*#__PURE__*/_jsxs(\"div\",{ref:hostRef,style:{display:\"flex\",flexDirection:\"column\",gap:6},children:[/*#__PURE__*/_jsx(\"div\",{ref:widgetRef,style:{minWidth:width,minHeight:height}}),showError&&/*#__PURE__*/_jsx(\"span\",{role:\"alert\",style:{fontSize:14,lineHeight:1.4,color:errorColor,fontFamily:\"inherit\"},children:errorText})]});}Recaptcha.defaultProps={siteKey:\"\",theme:\"light\",size:\"normal\",errorText:\"Please confirm you're not a robot before sending.\",errorColor:\"#D92D20\"};addPropertyControls(Recaptcha,{siteKey:{type:ControlType.String,title:\"Site Key\",placeholder:\"Uses the key in the code file\"},theme:{type:ControlType.Enum,title:\"Theme\",options:[\"light\",\"dark\"],optionTitles:[\"Light\",\"Dark\"],displaySegmentedControl:true},size:{type:ControlType.Enum,title:\"Size\",options:[\"normal\",\"compact\"],optionTitles:[\"Normal\",\"Compact\"],displaySegmentedControl:true},errorText:{type:ControlType.String,title:\"Error Text\"},errorColor:{type:ControlType.Color,title:\"Error Color\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Recaptcha\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Recaptcha.map"],"mappings":"A,sNAGkE,SAASgB,GAAe,CAA8iB,OAA1iBL,EAAO,YAAYA,EAAO,WAAW,OAAc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