{"version":3,"file":"SCNewsletterForm.DPYRvs10.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/oiN12T8wVmlmZVCgeJlN/MamuS59het0MUuALLD4a/SCNewsletterForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Flodesk Newsletter Form\n *\n * Embeds a Flodesk inline form using their universal script loader.\n * The script is injected once into the document head, then the form\n * is initialized to render in the container div.\n *\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function NewsletterForm(props){const{formId=\"6993375037049142d5d0270f\",style}=props;const[error,setError]=useState(null);const[isLoading,setIsLoading]=useState(true);useEffect(()=>{if(typeof window===\"undefined\")return;// Inject Flodesk script into <head> if not already present\nconst existingScript=document.querySelector('script[src*=\"flodesk\"]');if(!existingScript){let scriptLoaded=false;const scriptTimeout=setTimeout(()=>{if(!scriptLoaded){setError(\"Flodesk script failed to load. Please check your connection.\");setIsLoading(false);}},1e4);(function(w,d,t,h,s,n){w.FlodeskObject=n;var fn=function(){(w[n].q=w[n].q||[]).push(arguments);};w[n]=w[n]||fn;var f=d.getElementsByTagName(t)[0];var v=\"?v=\"+Math.floor(new Date().getTime()/(120*1e3))*60;var sm=d.createElement(t);sm.async=true;sm.type=\"module\";sm.src=h+s+\".mjs\"+v;sm.onerror=()=>{clearTimeout(scriptTimeout);setError(\"Failed to load Flodesk script (module).\");setIsLoading(false);};sm.onload=()=>{scriptLoaded=true;clearTimeout(scriptTimeout);};f.parentNode.insertBefore(sm,f);var sn=d.createElement(t);sn.async=true;sn.noModule=true;sn.src=h+s+\".js\"+v;sn.onerror=()=>{clearTimeout(scriptTimeout);setError(\"Failed to load Flodesk script.\");setIsLoading(false);};sn.onload=()=>{scriptLoaded=true;clearTimeout(scriptTimeout);};f.parentNode.insertBefore(sn,f);})(window,document,\"script\",\"https://assets.flodesk.com\",\"/universal\",\"fd\");}// Initialize the form with error handling\nconst initTimeout=setTimeout(()=>{setError(\"Form initialization timed out. Please refresh the page.\");setIsLoading(false);},15e3);const initInterval=setInterval(()=>{if(window.fd){clearInterval(initInterval);try{window.fd(\"form\",{formId:formId,containerEl:`#fd-form-${formId}`});clearTimeout(initTimeout);setIsLoading(false);}catch(err){clearTimeout(initTimeout);setError(`Form initialization failed: ${err instanceof Error?err.message:\"Unknown error\"}`);setIsLoading(false);}}},100);return()=>{clearInterval(initInterval);clearTimeout(initTimeout);};},[formId]);if(error){return /*#__PURE__*/_jsxs(\"div\",{style:{padding:\"20px\",backgroundColor:\"#fef2f2\",border:\"1px solid #ef4444\",borderRadius:\"8px\",color:\"#dc2626\",fontSize:\"14px\",fontFamily:\"system-ui, -apple-system, sans-serif\",...style},children:[/*#__PURE__*/_jsx(\"strong\",{children:\"Error:\"}),\" \",error]});}return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                #fd-form-${formId} {\n                    width: 100% !important;\n                    max-width: 100% !important;\n                }\n                #fd-form-${formId} * {\n                    -webkit-font-smoothing: antialiased !important;\n                    -moz-osx-font-smoothing: grayscale !important;\n                    text-rendering: optimizeLegibility !important;\n                }\n                #fd-form-${formId} input,\n                #fd-form-${formId} button,\n                #fd-form-${formId} label,\n                #fd-form-${formId} p,\n                #fd-form-${formId} span,\n                #fd-form-${formId} div {\n                    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;\n                }\n                @media (max-width: 480px) {\n                    #fd-form-${formId} input,\n                    #fd-form-${formId} button {\n                        font-size: 16px !important;\n                    }\n                }\n            `}),/*#__PURE__*/_jsx(\"div\",{id:`fd-form-${formId}`,style:{width:\"100%\",maxWidth:\"100%\",minHeight:\"300px\",height:\"auto\",position:\"relative\",boxSizing:\"border-box\",...style}})]});}addPropertyControls(NewsletterForm,{formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"6993375037049142d5d0270f\",placeholder:\"Enter your Flodesk form ID...\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NewsletterForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"300\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"320\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SCNewsletterForm.map"],"mappings":"6MAYG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,SAAO,2BAA2B,SAAO,EAAW,CAAC,EAAM,GAAUA,EAAS,KAAK,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAK,CAEyqB,OAFxqB,MAAc,CAAC,GAAU,IAAS,OAAY,OAChK,GAAG,CAApD,SAAS,cAAc,yBAAyB,CAAoB,CAAC,IAAI,EAAa,GAAY,EAAc,eAAe,CAAK,IAAc,EAAS,+DAA+D,CAAC,EAAa,GAAM,GAAI,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,cAAc,EAA0D,EAAE,GAAG,EAAE,IAAxD,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,KAAK,UAAU,EAAiB,IAAI,EAAE,EAAE,qBAAqB,EAAE,CAAC,GAAO,EAAE,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,SAAS,EAAE,IAAI,KAAK,CAAC,GAAO,EAAG,EAAE,cAAc,EAAE,CAAC,EAAG,MAAM,GAAK,EAAG,KAAK,SAAS,EAAG,IAAI,EAAE,EAAE,OAAO,EAAE,EAAG,YAAY,CAAC,aAAa,EAAc,CAAC,EAAS,0CAA0C,CAAC,EAAa,GAAM,EAAG,EAAG,WAAW,CAAC,EAAa,GAAK,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