{"version":3,"file":"Anchor_Scroll_Fix.CUe8oj3V.mjs","names":[],"sources":["https:/framerusercontent.com/modules/CRsgeTEZrhqTu9gKsF7n/DYmnMw7xMzOkKSP4I6Vy/Anchor_Scroll_Fix.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";// AST-24 anchor settle fix: on a cold page load with a #hash, Framer scrolls\n// during hydration and late-mounting content (the Explorer grid) then grows the\n// page, leaving the viewport short of the target section. Re-checks the target\n// position after layout settles and corrects once. Client-side navigation is\n// already exact and hits the <=8px no-op path.\n// S68 (AUD-01 M25): /booking#faq mis-landed at phone and tablet because the\n// cal.com iframe grows (458 -> ~1,300-1,700px) AFTER the fragment scroll. The\n// FAQ Block is now a target, and the settle re-runs whenever the document\n// grows during the first 8 s (ResizeObserver on <body>, plus later timers).\n// Any wheel / touch / key from the visitor cancels the assist immediately.\nconst TARGET_BY_HASH={\"the-system\":\"The System\",pricing:\"Pricing Section\",\"add-ons\":\"Add-ons Online\",partner:\"Tier Partner\",corporate:\"Tier Corporate\",premium:\"Tier Premium\",faq:\"FAQ Block\"};export function withAnchorScrollFix(Component){return props=>{React.useEffect(()=>{if(typeof window===\"undefined\")return;const hash=window.location.hash.replace(\"#\",\"\");const name=TARGET_BY_HASH[hash];if(!name)return;let cancelled=false;const cancel=()=>{cancelled=true;};const settle=()=>{if(cancelled)return;const el=Array.from(document.querySelectorAll('[data-framer-name=\"'+name+'\"]')).find(e=>e.getClientRects().length>0);if(!el)return;const top=el.getBoundingClientRect().top;if(Math.abs(top)<=8)return;window.scrollTo({top:window.scrollY+top,behavior:\"auto\"});};const timers=[350,1200,2500,4500,7e3].map(ms=>window.setTimeout(settle,ms));let ro=null;let roRaf=0;if(typeof ResizeObserver!==\"undefined\"){ro=new ResizeObserver(()=>{if(cancelled||roRaf)return;roRaf=window.requestAnimationFrame(()=>{roRaf=0;settle();});});ro.observe(document.body);}const stopRo=window.setTimeout(()=>{if(ro)ro.disconnect();ro=null;},8e3);window.addEventListener(\"wheel\",cancel,{passive:true});window.addEventListener(\"touchstart\",cancel,{passive:true});window.addEventListener(\"keydown\",cancel);return()=>{cancelled=true;timers.forEach(t=>window.clearTimeout(t));window.clearTimeout(stopRo);if(ro)ro.disconnect();window.removeEventListener(\"wheel\",cancel);window.removeEventListener(\"touchstart\",cancel);window.removeEventListener(\"keydown\",cancel);};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withAnchorScrollFix\":{\"type\":\"reactHoc\",\"name\":\"withAnchorScrollFix\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Anchor_Scroll_Fix.map"],"mappings":"gIAU+L,SAAgB,EAAoB,EAAU,CAAC,MAAO,KAAQ,MAAoB,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAK,EAAO,SAAS,KAAK,QAAQ,IAAI,EAAE,EAAQ,EAAK,EAAe,GAAM,GAAG,CAAC,EAAK,OAAO,IAAI,EAAU,GAAY,MAAW,CAAC,EAAU,EAAK,EAAQ,MAAW,CAAC,GAAG,EAAU,OAAO,IAAM,EAAG,MAAM,KAAK,SAAS,iBAAiB,sBAAsB,EAAK,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,eAAe,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,EAAG,OAAO,IAAM,EAAI,EAAG,sBAAsB,CAAC,CAAC,IAAO,KAAK,IAAI,CAAG,GAAG,GAAS,EAAO,SAAS,CAAC,IAAI,EAAO,QAAQ,EAAI,SAAS,MAAM,CAAC,CAAE,EAAQ,EAAO,CAAC,IAAI,KAAK,KAAK,KAAK,GAAG,CAAC,CAAC,IAAI,GAAI,EAAO,WAAW,EAAO,CAAE,CAAC,EAAM,EAAG,KAAS,EAAM,EAAK,OAAO,eAAiB,MAAa,EAAG,IAAI,mBAAmB,CAAI,GAAW,IAAa,EAAM,EAAO,0B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