{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/LTiDVJjck6SSTlFhMJBt/S0lunmRcGLdLBsRjcuZ3/RecapchaInput.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState}from\"react\";import{HiddenInput}from\"https://framerusercontent.com/modules/DwWOdDzQZGCuvkNlbUjZ/p64C0n6xNEFY9NovSiJw/FramerFormsShared.js\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function RecaptchaInput(props){const[verified,setVerified]=useState(false);if(!props.siteKey){return /*#__PURE__*/_jsx(\"div\",{style:{...props.style},children:/*#__PURE__*/_jsx(InvalideSetupMessage,{})});}return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style},children:[/*#__PURE__*/_jsx(RepatchaContainer,{siteKey:props.siteKey,onVerifiedChange:setVerified}),/*#__PURE__*/_jsx(HiddenInput,{name:\"recaptcha\",required:true,value:verified?\"Yes\":\"\"})]});}RecaptchaInput.displayName=\"reCAPTCHA Input\";addPropertyControls(RecaptchaInput,{siteKey:{type:ControlType.String,title:\"Site Key\",defaultValue:\"\",placeholder:\"Paste your site key here\"}});const RepatchaContainer=props=>{const captchaContainerRef=useRef(null);useEffect(()=>{if(!document.getElementById(\"recaptcha-script\")){const script=document.createElement(\"script\");script.id=\"recaptcha-script\";script.src=\"https://www.google.com/recaptcha/api.js?render=explicit\";script.async=true;script.defer=true;document.body.appendChild(script);}},[]);useEffect(()=>{if(!props.siteKey)return;const interval=setInterval(()=>{const reCaptchaInitialized=!!window.grecaptcha&&window.grecaptcha.render;const captchaContainer=captchaContainerRef.current;if(!captchaContainer)return;if(!reCaptchaInitialized)return;window.grecaptcha.render(captchaContainer,{sitekey:props.siteKey,callback:()=>props.onVerifiedChange(true),\"expired-callback\":()=>props.onVerifiedChange(false)});clearInterval(interval);},500);return()=>clearInterval(interval);},[props.siteKey]);return /*#__PURE__*/_jsx(\"div\",{ref:captchaContainerRef});};const InvalideSetupMessage=()=>{return /*#__PURE__*/_jsx(\"div\",{style:{padding:\"12px\",background:\"#f5f5f5\",color:\"#888\",borderRadius:\"6px\",fontSize:\"14px\",textAlign:\"center\"},children:\"Enter your reCAPTCHA site key in the properties panel\"});};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RecaptchaInput\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RecapchaInput.map"],
  "mappings": "uMAGkB,SAARA,EAAgCC,EAAM,CAAC,GAAK,CAACC,EAASC,CAAW,EAAEC,EAAS,EAAK,EAAE,OAAIH,EAAM,QAA2II,EAAM,MAAM,CAAC,MAAM,CAAC,GAAGJ,EAAM,KAAK,EAAE,SAAS,CAAcK,EAAKC,EAAkB,CAAC,QAAQN,EAAM,QAAQ,iBAAiBE,CAAW,CAAC,EAAeG,EAAKE,EAAY,CAAC,KAAK,YAAY,SAAS,GAAK,MAAMN,EAAS,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAA/UI,EAAK,MAAM,CAAC,MAAM,CAAC,GAAGL,EAAM,KAAK,EAAE,SAAsBK,EAAKG,EAAqB,CAAC,CAAC,CAAC,CAAC,CAA0P,CAACT,EAAe,YAAY,kBAAkBU,EAAoBV,EAAe,CAAC,QAAQ,CAAC,KAAKW,EAAY,OAAO,MAAM,WAAW,aAAa,GAAG,YAAY,0BAA0B,CAAC,CAAC,EAAE,IAAMJ,EAAkBN,GAAO,CAAC,IAAMW,EAAoBC,EAAO,IAAI,EAAE,OAAAC,EAAU,IAAI,CAAC,GAAG,CAAC,SAAS,eAAe,kBAAkB,EAAE,CAAC,IAAMC,EAAO,SAAS,cAAc,QAAQ,EAAEA,EAAO,GAAG,mBAAmBA,EAAO,IAAI,0DAA0DA,EAAO,MAAM,GAAKA,EAAO,MAAM,GAAK,SAAS,KAAK,YAAYA,CAAM,CAAE,CAAC,EAAE,CAAC,CAAC,EAAED,EAAU,IAAI,CAAC,GAAG,CAACb,EAAM,QAAQ,OAAO,IAAMe,EAAS,YAAY,IAAI,CAAC,IAAMC,EAAqB,CAAC,CAACC,EAAO,YAAYA,EAAO,WAAW,OAAaC,EAAiBP,EAAoB,QAAYO,GAA4BF,IAA4BC,EAAO,WAAW,OAAOC,EAAiB,CAAC,QAAQlB,EAAM,QAAQ,SAAS,IAAIA,EAAM,iBAAiB,EAAI,EAAE,mBAAmB,IAAIA,EAAM,iBAAiB,EAAK,CAAC,CAAC,EAAE,cAAce,CAAQ,EAAE,EAAE,GAAG,EAAE,MAAM,IAAI,cAAcA,CAAQ,CAAE,EAAE,CAACf,EAAM,OAAO,CAAC,EAAsBK,EAAK,MAAM,CAAC,IAAIM,CAAmB,CAAC,CAAE,EAAQH,EAAqB,IAAyBH,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,WAAW,UAAU,MAAM,OAAO,aAAa,MAAM,SAAS,OAAO,UAAU,QAAQ,EAAE,SAAS,uDAAuD,CAAC",
  "names": ["RecaptchaInput", "props", "verified", "setVerified", "ye", "u", "p", "RepatchaContainer", "HiddenInput", "InvalideSetupMessage", "addPropertyControls", "ControlType", "captchaContainerRef", "pe", "ue", "script", "interval", "reCaptchaInitialized", "window", "captchaContainer"]
}
