{"version":3,"file":"HeyflowEmbed.Bonpyjyk.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/THSaLBPMGBvKYdZiOwO7/3khXcID1IESGtBtTbvD9/HeyflowEmbed.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * FRANKLIN - HEYFLOW EMBED\n *\n * Renders a Heyflow funnel. This exists so the cashback-calculator landing\n * pages survive the migration to this project: Meta ads point at\n * /cashback-calculator, -nl and -be on the old site, those three pages are\n * nothing but a Heyflow embed, and if the domain moves before they exist\n * here every live ad lands on a 404.\n *\n * The markup is copied verbatim from what the old site actually serves\n * (read off https://www.hifranklin.com/cashback-calculator on 29 Sep 2026):\n *\n *   <script src=\"https://assets.prd.heyflow.com/builder/widget/latest/webview.js\">\n *   <heyflow-wrapper\n *     flow-id=\"...\"\n *     dynamic-height\n *     scroll-up-on-navigation\n *     style-config='{\"width\":\"100%\"}'>\n *\n * Do not \"tidy\" those attributes. dynamic-height is what stops the funnel\n * being clipped at a fixed height, and scroll-up-on-navigation is what moves\n * the viewport to the top of each new step - without it the visitor lands\n * mid-question on step two and the drop-off is invisible to us.\n *\n * The wrapper is a custom element, so it is built with the DOM API rather\n * than JSX: React would otherwise have to be trusted to pass through\n * unknown attributes on an unknown tag, which it does inconsistently across\n * versions. Building it by hand is boring and exact.\n *\n * ON CANVAS this renders a labelled placeholder. The widget injects a script\n * and measures its own height, neither of which the Framer canvas handles\n * gracefully. Preview and the published site render the real funnel.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 900\n * @framerIntrinsicHeight 700\n */const WIDGET_SRC=\"https://assets.prd.heyflow.com/builder/widget/latest/webview.js\";const INK=\"#232323\";const HAIRLINE=\"rgba(35, 35, 35, 0.12)\";const SERIF='\"Instrument Serif\", \"Instrument Serif Placeholder\", serif';const GEIST='\"Geist\", \"Geist Placeholder\", sans-serif';const MONO='\"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, monospace';export default function HeyflowEmbed(props){const{flowId,minHeight,style}=props;const host=useRef(null);const isCanvas=RenderTarget.current()===RenderTarget.canvas;/* One script for the whole document, however many funnels are on it. */useEffect(()=>{if(isCanvas)return;if(document.querySelector(`script[src=\"${WIDGET_SRC}\"]`))return;const script=document.createElement(\"script\");script.src=WIDGET_SRC;script.async=true;document.head.appendChild(script);},[isCanvas]);useEffect(()=>{if(isCanvas)return;const node=host.current;if(!node)return;node.innerHTML=\"\";if(!flowId)return;const wrapper=document.createElement(\"heyflow-wrapper\");wrapper.setAttribute(\"flow-id\",flowId);wrapper.setAttribute(\"dynamic-height\",\"\");wrapper.setAttribute(\"scroll-up-on-navigation\",\"\");wrapper.setAttribute(\"style-config\",JSON.stringify({width:\"100%\"}));node.appendChild(wrapper);return()=>{node.innerHTML=\"\";};},[flowId,isCanvas]);if(isCanvas){return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",minHeight,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:10,border:`1px dashed ${HAIRLINE}`,borderRadius:8,padding:24,boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:SERIF,fontSize:30,color:INK},children:\"Heyflow funnel\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:MONO,fontSize:13,color:INK,opacity:.6},children:flowId||\"no flow id set\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:GEIST,fontSize:14,color:INK,opacity:.6,textAlign:\"center\",maxWidth:380},children:\"The funnel renders in Preview and on the live site.\"})]});}return /*#__PURE__*/_jsx(\"div\",{ref:host,style:{...style,width:\"100%\",minHeight}});}HeyflowEmbed.defaultProps={flowId:\"\",minHeight:700};addPropertyControls(HeyflowEmbed,{flowId:{type:ControlType.String,title:\"Flow ID\",placeholder:\"d3O6KF8U1w84EamWYYlW\",description:\"DK d3O6KF8U1w84EamWYYlW \\xb7 NL rvSPWdn0E97Dyg5Z82gL \\xb7 BE wyltklt8dxq1e7c6onwgofp6\"},minHeight:{type:ControlType.Number,title:\"Min height\",defaultValue:700,min:200,max:2e3,step:10,unit:\"px\",description:\"Holds the space before the funnel measures itself, so the page does not jump.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HeyflowEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HeyflowEmbed.map"],"mappings":"+LAqC2V,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,SAAO,YAAU,SAAO,EAAY,EAAKA,EAAO,IAAI,EAAQ,EAAS,EAAa,QAAQ,IAAI,EAAa,OAA+4C,OAAh0C,MAAc,CAAoB,GAAhB,GAAmB,SAAS,cAAc,eAAe,EAAW,GAAG,EAAE,OAAO,IAAM,EAAO,SAAS,cAAc,QAAQ,EAAE,EAAO,IAAI,EAAW,EAAO,MAAM,GAAK,SAAS,KAAK,YAAY,CAAM,CAAE,EAAE,CAAC,CAAQ,CAAC,EAAE,MAAc,CAAC,GAAG,EAAS,OAAO,IAAM,EAAK,EAAK,QAA0C,GAA/B,CAAC,IAAY,EAAK,UAAU,GAAM,CAAC,GAAO,OAAO,IAAM,EAAQ,SAAS,cAAc,iBAAiB,EAAoO,OAAlO,EAAQ,aAAa,UAAU,CAAM,EAAE,EAAQ,aAAa,iBAAiB,EAAE,EAAE,EAAQ,aAAa,0BAA0B,EAAE,EAAE,EAAQ,aAAa,eAAe,KAAK,UAAU,CAAC,MAAM,MAAM,CAAC,CAAC,EAAE,EAAK,YAAY,CAAO,MAAY,CAAC,EAAK,UAAU,EAAG,CAAE,EAAE,CAAC,EAAO,CAAQ,CAAC,EAAK,EAA8B,EAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,YAAU,QAAQ,OAAO,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