{"version":3,"file":"FastActionFormSubscribers.B3cv0xOG.mjs","names":["React.useState","React.useMemo","p"],"sources":["https:/framerusercontent.com/modules/7hBbbGRLnnncJlMTYO3o/W9Q6FcDhyc3Q78cxCfbO/FastActionFormSubscribers.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Instructions:\n * Create a Framer component that follows the Framer component rules and achieves the user's goal.\n * If the user is asking a question, answer it without creating a component.\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 420\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function FastActionFormSubscribers(props){const{formUrl,endpoint,thankYouUrl,inlineErrors,noLogin,mobileAutofocus,className,loadPoppins,poppinsHref,loadTypekit,typekitHref,injectCustomCSS,customCSS,placeholderText,placeholderBackground,placeholderTextColor,placeholderFont,style}=props;const isStatic=useIsStaticRenderer();const[iframeHeight,setIframeHeight]=React.useState(null);const isHeightFixed=!!style&&style.height===\"100%\";React.useEffect(()=>{if(typeof window===\"undefined\")return;const handler=event=>{const data=event?.data;if(!data||typeof data!==\"object\")return;if(data.type===\"FASTACTION_REDIRECT\"){const url=typeof data.url===\"string\"?data.url:\"\";if(!url)return;if(url.startsWith(\"about:\"))return;try{window.location.assign(url);}catch(e){try{window.location.href=url;}catch(e2){}}return;}if(data.type===\"FASTACTION_HEIGHT\"){const h=typeof data.height===\"number\"?data.height:Number(data.height);if(!Number.isFinite(h)||h<=0)return;if(isHeightFixed)return;React.startTransition(()=>setIframeHeight(Math.ceil(h)));}};window.addEventListener(\"message\",handler);return()=>window.removeEventListener(\"message\",handler);},[isHeightFixed]);const defaultCSS=\".at-title { font-family: 'fatfrank', sans-serif !important; text-transform: uppercase; color: #27397C !important; font-size: 3rem !important; line-height: 0.8em; }\"+\" .at-legend { font-family: 'fatfrank', sans-serif !important; text-transform: capitalize; color: #27397C !important; font-size: 1.63rem !important; }\"+\" .ngp-form input, .ngp-form select, .ngp-form textarea, .ngp-form label { font-family: 'Poppins', sans-serif; color: #27397C; }\"+\" .ngp-form p { color: #062A44; }\"+\" .btn-at-primary { text-transform: uppercase; font-weight: 1000 !important; letter-spacing: 0.02em; font-size: 16px !important; background-color: #C4292D !important; border-radius: 10px !important; border: 1px solid #C4292D !important; color: #FFFFFF !important; transition: 0.4s ease; }\"+\" .btn-at-primary:hover { background-color: #FFFFFF !important; color: #C4292D !important; }\";const cssToInject=React.useMemo(()=>{if(!injectCustomCSS)return\"\";return(customCSS||\"\").trim()||defaultCSS;},[injectCustomCSS,customCSS]);const iframeSrcDoc=React.useMemo(()=>{const linkTags=[];if(loadPoppins&&poppinsHref)linkTags.push(`<link rel=\"stylesheet\" href=\"${poppinsHref}\">`);if(loadTypekit&&typekitHref)linkTags.push(`<link rel=\"stylesheet\" href=\"${typekitHref}\">`);const safeClassName=(className||\"\").replace(/\"/g,\"&quot;\");const safeFormUrl=(formUrl||\"\").replace(/\"/g,\"&quot;\");const safeEndpoint=(endpoint||\"\").replace(/\"/g,\"&quot;\");const safeThankYouUrl=(thankYouUrl||\"\").replace(/\"/g,\"&quot;\");const styleTag=cssToInject?`<style>${cssToInject}</style>`:\"\";return`<!doctype html>\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <base target=\"_top\" />\n    ${linkTags.join(\"\\n\")}\n    ${styleTag}\n  </head>\n  <body style=\"margin:0;padding:0;\">\n    <div\n      class=\"${safeClassName}\"\n      data-form-url=\"${safeFormUrl}\"\n      data-fastaction-endpoint=\"${safeEndpoint}\"\n      data-inline-errors=\"${inlineErrors?\"true\":\"false\"}\"\n      data-fastaction-nologin=\"${noLogin?\"true\":\"false\"}\"\n      data-mobile-autofocus=\"${mobileAutofocus?\"true\":\"false\"}\"\n      data-thank-you-url=\"${safeThankYouUrl}\"\n      style=\"width:100%;height:100%;\"\n    ></div>\n\n    <script>\n      (function(){\n        var THANK_YOU_URL = ${JSON.stringify(thankYouUrl||\"\")};\n\n        function postToParent(msg){\n          try { window.parent.postMessage(msg, '*') } catch(e) {}\n        }\n\n        function reportHeight(){\n          try {\n            var b = document.body\n            var d = document.documentElement\n            if (!b || !d) return\n            var h = Math.max(\n              b.scrollHeight,\n              d.scrollHeight,\n              b.offsetHeight,\n              d.offsetHeight,\n              b.clientHeight,\n              d.clientHeight\n            )\n            if (h && isFinite(h)) postToParent({ type: 'FASTACTION_HEIGHT', height: h })\n          } catch (e) {}\n        }\n\n        function redirectTop(url){\n          if (!url) return\n          try {\n            window.parent.postMessage({ type: 'FASTACTION_REDIRECT', url: String(url) }, '*')\n          } catch(e) {}\n        }\n\n        function mapRedirectUrl(url){\n          try {\n            var u = String(url || \"\")\n            if (!u) return \"\"\n            if (u.indexOf('secure.actblue.com') !== -1 && THANK_YOU_URL) return THANK_YOU_URL\n            if (u.indexOf('actblue.com') !== -1 && THANK_YOU_URL) return THANK_YOU_URL\n            if (u.indexOf('about:srcdoc') !== -1) return \"\"\n            if (u.indexOf('about:blank') !== -1) return \"\"\n            return u\n          } catch (e) {\n            return \"\"\n          }\n        }\n\n        // Force any navigation attempts (including programmatic redirects) to happen at the top-level.\n        try {\n          var originalOpen = window.open\n          window.open = function(url){ var u = mapRedirectUrl(url); if (u) redirectTop(u); return null }\n          if (window.location && window.location.assign) window.location.assign = function(url){ var u = mapRedirectUrl(url); if (u) redirectTop(u) }\n          if (window.location && window.location.replace) window.location.replace = function(url){ var u = mapRedirectUrl(url); if (u) redirectTop(u) }\n        } catch (e) {}\n\n        function forceTopNavigation(){\n          try {\n            var anchors = document.querySelectorAll('a[href]');\n            for (var i = 0; i < anchors.length; i++) {\n              anchors[i].setAttribute('target', '_top');\n              anchors[i].setAttribute('rel', 'noopener noreferrer');\n            }\n            var forms = document.querySelectorAll('form');\n            for (var j = 0; j < forms.length; j++) {\n              forms[j].setAttribute('target', '_top');\n            }\n          } catch (e) {}\n        }\n\n        // Proactively intercept user navigation so the iframe never tries to frame CSP-blocked destinations (e.g. secure.actblue.com).\n        try {\n          document.addEventListener('click', function(e){\n            var el = e && e.target\n            while (el && el !== document.documentElement) {\n              if (el.tagName === 'A' && el.getAttribute('href')) break\n              el = el.parentNode\n            }\n            if (!el || el.tagName !== 'A') return\n            var href = el.getAttribute('href')\n            if (!href) return\n            // Only intercept real navigations (ignore hash-only).\n            if (href.charAt(0) === '#') return\n            var mapped = mapRedirectUrl(href)\n            if (!mapped) return\n            e.preventDefault()\n            redirectTop(mapped)\n          }, true)\n\n          document.addEventListener('submit', function(e){\n            var form = e && e.target\n            if (!form) return\n            var mapped = mapRedirectUrl(form.action)\n            if (!mapped && THANK_YOU_URL) mapped = THANK_YOU_URL\n            if (!mapped) return\n            e.preventDefault()\n            redirectTop(mapped)\n          }, true)\n        } catch (e) {}\n\n        function boot(){\n          try {\n            if (window.FastAction) {\n              if (typeof window.FastAction.reload === 'function') window.FastAction.reload();\n              else if (typeof window.FastAction.init === 'function') window.FastAction.init();\n            }\n          } catch (e) {}\n          forceTopNavigation();\n          reportHeight();\n        }\n\n        var obs;\n        try {\n          obs = new MutationObserver(function(){ forceTopNavigation(); reportHeight(); });\n          obs.observe(document.documentElement, { childList: true, subtree: true });\n        } catch (e) {}\n\n        try {\n          if (window.ResizeObserver) {\n            var ro = new ResizeObserver(function(){ reportHeight(); });\n            ro.observe(document.body);\n          }\n        } catch (e) {}\n\n        try {\n          window.addEventListener('load', function(){ setTimeout(reportHeight, 0); setTimeout(reportHeight, 250); setTimeout(reportHeight, 1000); });\n          window.addEventListener('resize', function(){ setTimeout(reportHeight, 0); });\n        } catch (e) {}\n\n        var s = document.createElement('script');\n        s.src = 'https://static.everyaction.com/ea-actiontag/at.js';\n        s.async = true;\n        s.onload = boot;\n        s.onerror = function(){};\n        document.body.appendChild(s);\n\n        if (document.readyState === 'complete' || document.readyState === 'interactive') {\n          setTimeout(boot, 0);\n        } else {\n          document.addEventListener('DOMContentLoaded', function(){ setTimeout(boot, 0); }, { once: true });\n        }\n\n        forceTopNavigation();\n        reportHeight();\n      })();\n    </script>\n  </body>\n</html>`;},[loadPoppins,poppinsHref,loadTypekit,typekitHref,cssToInject,className,formUrl,endpoint,thankYouUrl,inlineErrors,noLogin,mobileAutofocus]);if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:16,boxSizing:\"border-box\",background:placeholderBackground,color:placeholderTextColor,borderRadius:12,border:\"1px solid rgba(0,0,0,0.08)\",...placeholderFont,...style},\"aria-label\":\"FastAction form placeholder\",children:/*#__PURE__*/_jsx(\"span\",{style:{width:\"max-content\",textAlign:\"center\"},children:placeholderText})});}return /*#__PURE__*/_jsx(\"iframe\",{title:\"FastAction form\",srcDoc:iframeSrcDoc,sandbox:\"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation\",style:{position:\"relative\",width:\"100%\",height:isHeightFixed?\"100%\":iframeHeight?`${iframeHeight}px`:\"420px\",border:\"none\",display:\"block\",...style}});}addPropertyControls(FastActionFormSubscribers,{formUrl:{type:ControlType.String,title:\"Form URL\",defaultValue:\"https://secure.ngpvan.com/v1/Forms/1p95bZoJeE2U4xTJQ6kyLg2\"},endpoint:{type:ControlType.String,title:\"Endpoint\",defaultValue:\"https://fastaction.ngpvan.com\"},thankYouUrl:{type:ControlType.String,title:\"Thank You URL\",defaultValue:\"https://secure.actblue.com/donate/fl-mcd-rd-ty?refcode=WEB_FL_MCD_signup_form\"},inlineErrors:{type:ControlType.Boolean,title:\"Inline Errors\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},noLogin:{type:ControlType.Boolean,title:\"No Login\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},mobileAutofocus:{type:ControlType.Boolean,title:\"Autofocus\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},className:{type:ControlType.String,title:\"Class\",defaultValue:\"ngp-form\"},loadPoppins:{type:ControlType.Boolean,title:\"Load Poppins\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},poppinsHref:{type:ControlType.String,title:\"Poppins URL\",defaultValue:\"https://fonts.googleapis.com/css?family=Poppins\",hidden:p=>!p.loadPoppins},loadTypekit:{type:ControlType.Boolean,title:\"Load Typekit\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},typekitHref:{type:ControlType.String,title:\"Typekit URL\",defaultValue:\"https://use.typekit.net/jwi3gmn.css\",hidden:p=>!p.loadTypekit},injectCustomCSS:{type:ControlType.Boolean,title:\"Inject CSS\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},customCSS:{type:ControlType.String,title:\"Custom CSS\",defaultValue:\"\",displayTextArea:true,hidden:p=>!p.injectCustomCSS},placeholderText:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"FastAction form loads in Preview/Publish\"},placeholderBackground:{type:ControlType.Color,title:\"PH Bg\",defaultValue:\"#F5F5F5\"},placeholderTextColor:{type:ControlType.Color,title:\"PH Text\",defaultValue:\"#000000\"},placeholderFont:{type:ControlType.Font,title:\"PH Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FastActionFormSubscribers\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"420\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FastActionFormSubscribers.map"],"mappings":"qNAUG,SAAwB,EAA0B,EAAM,CAAC,GAAK,CAAC,UAAQ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