{"version":3,"file":"ScrollToTopOnLoad.TYeFQ7T2.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/A4nrWJlHDxOwLY8DGMnp/TsK6JeTJzKAVCDlnBB7A/ScrollToTopOnLoad.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";export function ScrollToTopOnLoad(){useEffect(()=>{const stopScrollAndScrollToTop=()=>{const mainElement=document.querySelector(\"#main\");// if (mainElement) {\n//     // Step 1: Calculate scrollbar width\n//     const scrollbarWidth =\n//         window.innerWidth - mainElement.clientWidth\n//     // Step 2: Add padding to body to compensate for the scrollbar width\n//     document.body.style.paddingRight = `${scrollbarWidth}px`\n// }\n// Temporarily disable scrolling to stop momentum\ndocument.body.style.overflow=\"hidden\";// Step 3: Scroll to the top of the page\ndocument.body.scrollTo({top:0,left:0,behavior:\"auto\"});// Step 4: Re-enable scrolling after the scroll is ensured to be at the top\nsetTimeout(()=>{document.body.style.overflow=\"\";// Remove the padding that was added\n// document.body.style.paddingRight = \"\"\n// Optionally restore smooth scrolling for future interactions\ndocument.documentElement.style.scrollBehavior=\"smooth\";},50)// Adding a delay to ensure scroll finishes before re-enabling scroll\n;};// Trigger the function when the component is mounted\nstopScrollAndScrollToTop();},[]);return{};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withScrollToTopOnLoad(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ScrollToTopOnLoad(props)});};}withScrollToTopOnLoad.displayName=\"ScrollToTopOnLoad\";\nexport const __FramerMetadata__ = {\"exports\":{\"ScrollToTopOnLoad\":{\"type\":\"override\",\"name\":\"ScrollToTopOnLoad\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollToTopOnLoad\":{\"type\":\"reactHoc\",\"name\":\"withScrollToTopOnLoad\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTopOnLoad.map"],"mappings":"yPAAwE,SAAgB,GAAmB,CAe1E,OAf2E,MAAc,CAAuD,SAAS,cAAc,QAAQ,CAQhN,SAAS,KAAK,MAAM,SAAS,SAC7B,SAAS,KAAK,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,OAAO,CAAC,CACtD,eAAe,CAAC,SAAS,KAAK,MAAM,SAAS,GAG7C,SAAS,gBAAgB,MAAM,eAAe,UAAW,GAAG,EAE/B,EAAE,CAAC,CAAO,EAAE,CAAqJ,SAAgB,EAAsB,EAAE,CAAC,MAAO,KAAQ,EAA+BA,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAkB,EAAM,CAAC,CAAC,mBAfxU,IAA6B,IAesH,CAAyL,EAAsB,YAAY"}