{"version":3,"file":"ToggleDemoFormModal.DidqBWFb.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/G5xjW7MeVlJLEfraA7nf/MRdPhTKozOaE0sz1LjJF/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\"});});}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){// Show modal\nObject.assign(parent.style,{zIndex:\"2\",width:\"100vw\",height:\"100vh\",top:\"0\",left:\"0\"});Object.assign(modal.style,{width:\"100%\",height:\"100%\",display:\"flex\"});document.body.style.overflow=\"hidden\";}else{// Hide modal\nparent.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=\"2\";successModal.parentNode.style.width=\"100vw\";successModal.parentNode.style.height=\"100vh\";successModal.parentNode.style.top=\"0\";successModal.parentNode.style.left=\"0\";}successModal.style.display=\"flex\"// or \"block\", depending on how Framer built it\n;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 toggleDemo;}},[link,href]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:callback});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withDemoSuccessDataID\":{\"type\":\"reactHoc\",\"name\":\"withDemoSuccessDataID\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withToggleDemoSuccess\":{\"type\":\"reactHoc\",\"name\":\"withToggleDemoSuccess\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDemoDataId\":{\"type\":\"reactHoc\",\"name\":\"withDemoDataId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withToggleDemo\":{\"type\":\"reactHoc\",\"name\":\"withToggleDemo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showDemoSuccessModal\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"toggleDemoSuccess\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"toggleDemo\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":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