{"version":3,"file":"ToggleDemoFormModal.BBHeyBJ3.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/G5xjW7MeVlJLEfraA7nf/El9g0LsM8ovnLxMmKjt3/ToggleDemoFormModal.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useMemo}from\"react\";export function withDemoDataId(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,\"data-demo\":\"true\",id:\"demo\"});});}const trackGoal=code=>{if(typeof window!==\"undefined\"&&window.fathom){window.fathom.trackGoal(code,0);}};export function withDemoSuccessDataID(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,\"data-demo\":\"true\",id:\"demo-success\"});});}// const toggleDemo = () => {\n//     const demoDiv = document.getElementById(\"demo\")\n//     if (!demoDiv) return\n//     if (\n//         !demoDiv.parentNode.style.zIndex ||\n//         demoDiv.parentNode.style.zIndex < 0\n//     ) {\n//         demoDiv.parentNode.style.zIndex = 2\n//         demoDiv.parentNode.style.width = \"100vw\"\n//         demoDiv.parentNode.style.height = \"100vh\"\n//         demoDiv.parentNode.style.top = 0\n//         demoDiv.parentNode.style.left = 0\n//         demoDiv.style.width = \"100%\"\n//         demoDiv.style.height = \"100%\"\n//         document.body.style.overflow = \"hidden\"\n//     } else {\n//         demoDiv.parentNode.style.zIndex = -1\n//         document.body.style.overflow = \"\"\n//     }\n// }\nconst toggleModal=id=>{const modal=document.getElementById(id);if(!modal)return;const parent=modal.parentElement;if(!parent)return;const isHidden=!parent.style.zIndex||parseInt(parent.style.zIndex)<0;if(isHidden){console.log(\"Show\");if(id===\"demo\")trackGoal(\"DEMO_FORM_OPEN_CODE\");// Show modal\nObject.assign(parent.style,{zIndex:\"11\",width:\"100vw\",height:\"100vh\",top:\"0\"});Object.assign(modal.style,{width:\"100%\",height:\"100%\",display:\"flex\"});document.body.style.overflow=\"hidden\";}else{// Hide modal\nconsole.log(\"Hide\");parent.style.zIndex=\"-1\";modal.style.display=\"none\";document.body.style.overflow=\"\";}};export const toggleDemo=()=>toggleModal(\"demo\");export const toggleDemoSuccess=()=>toggleModal(\"demo-success\");export const showDemoSuccessModal=()=>{const demoModal=document.getElementById(\"demo\");const successModal=document.getElementById(\"demo-success\");if(!successModal){console.warn(\"Success modal not found (id='demo-success')\");return;}// Hide the current form modal\nif(demoModal&&demoModal.parentNode){demoModal.parentNode.style.zIndex=\"-1\";demoModal.style.display=\"none\";}// Show the success modal\nif(successModal.parentNode){successModal.parentNode.style.zIndex=\"11\";successModal.parentNode.style.width=\"100vw\";successModal.parentNode.style.height=\"100vh\";successModal.parentNode.style.top=\"0\";}successModal.style.display=\"flex\";document.body.style.overflow=\"hidden\";};export function withToggleDemoSuccess(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:toggleDemoSuccess});});}export function withToggleDemo(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{link,href}=props;const callback=useMemo(()=>{if(!link&&!href){return()=>{trackGoal(\"Q0Q2DVTF\")// Demo CTA Clicked\n;toggleDemo()// opens demo -> will also track \"opened\"\n;};}},[link,href]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:callback});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withToggleDemoSuccess\":{\"type\":\"reactHoc\",\"name\":\"withToggleDemoSuccess\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"toggleDemoSuccess\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDemoSuccessDataID\":{\"type\":\"reactHoc\",\"name\":\"withDemoSuccessDataID\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"toggleDemo\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showDemoSuccessModal\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withToggleDemo\":{\"type\":\"reactHoc\",\"name\":\"withToggleDemo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDemoDataId\":{\"type\":\"reactHoc\",\"name\":\"withDemoDataId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ToggleDemoFormModal.map"],"mappings":"kIAAiF,SAAgB,EAAe,EAAU,CAAC,OAAoB,GAAY,EAAM,IAA2B,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,YAAY,OAAO,GAAG,OAAO,CAAC,CAAG,CAA2G,SAAgB,EAAsB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAA2B,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,YAAY,OAAO,GAAG,eAAe,CAAC,CAAG,CAwBrR,SAAgB,EAAsB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAA2B,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,QAAQ,EAAkB,CAAC,CAAG,CAAE,SAAgB,EAAe,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,OAAK,QAAM,EAAY,EAASA,MAAY,CAAC,GAAG,CAAC,GAAM,CAAC,EAAM,UAAU,CAAC,EAAU,WAAW,CAC7nB,GAAY,GACP,CAAC,EAAK,EAAK,CAAC,CAAC,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,QAAQ,EAAS,CAAC,EAAG,gCA1BlD,IAAsC,CAAqL,EAAU,GAAM,CAAW,IAAS,QAAa,EAAO,QAAQ,EAAO,OAAO,UAAU,EAAK,EAAE,EAoB/V,EAAY,GAAI,CAAC,IAAM,EAAM,SAAS,eAAe,EAAG,CAAC,GAAG,CAAC,EAAM,OAAO,IAAM,EAAO,EAAM,cAAkB,IAA6B,CAAC,EAAO,MAAM,QAAQ,SAAS,EAAO,MAAM,OAAO,CAAC,GAAe,QAAQ,IAAI,OAAO,CAAI,IAAK,QAAO,EAAU,sBAAsB,CACxR,OAAO,OAAO,EAAO,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