{"version":3,"file":"WindowScrollPresesrve.CItHlPPS.mjs","names":[],"sources":["https:/framerusercontent.com/modules/O7Uhutd95NZkuHS420LD/dirE3fJlUrifbH2uAjLp/WindowScrollPresesrve.js"],"sourcesContent":["// scrollRestore.tsx — Framer Code Override\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";const SCROLL_KEY=\"shopAll_scrollY\";export function withScrollRestore(Component){return props=>{useEffect(()=>{// Restore scroll position on mount\nconst saved=sessionStorage.getItem(SCROLL_KEY);if(saved){const y=parseInt(saved,10);// Small delay to let the page render before scrolling\nrequestAnimationFrame(()=>{window.scrollTo(0,y);});sessionStorage.removeItem(SCROLL_KEY);}// Save scroll position before navigating away\nconst handleBeforeUnload=()=>{sessionStorage.setItem(SCROLL_KEY,String(window.scrollY));};// Also capture clicks on links/items that trigger navigation\nconst handleClick=e=>{const link=e.target.closest(\"a\");if(link){sessionStorage.setItem(SCROLL_KEY,String(window.scrollY));}};window.addEventListener(\"beforeunload\",handleBeforeUnload);document.addEventListener(\"click\",handleClick,true);return()=>{window.removeEventListener(\"beforeunload\",handleBeforeUnload);document.removeEventListener(\"click\",handleClick,true);};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withScrollRestore\":{\"type\":\"reactHoc\",\"name\":\"withScrollRestore\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WindowScrollPresesrve.map"],"mappings":"2HAC2G,SAAgB,EAAkB,EAAU,CAAC,MAAO,KAAQ,MAAc,CACrL,IAAM,EAAM,eAAe,QAAQ,EAAW,CAAC,GAAG,EAAM,CAAC,IAAM,EAAE,SAAS,EAAM,GAAG,CACnF,0BAA0B,CAAC,EAAO,SAAS,EAAE,EAAE,EAAG,CAAC,eAAe,WAAW,EAAW,CACxF,IAAM,MAAuB,CAAC,eAAe,QAAQ,EAAW,OAAO,EAAO,QAAQ,CAAC,EACjF,EAAY,GAAG,CAAY,EAAE,OAAO,QAAQ,IAAI,EAAU,eAAe,QAAQ,EAAW,OAAO,EAAO,QAAQ,CAAC,EAAmH,OAA/G,EAAO,iBAAiB,eAAe,EAAmB,CAAC,SAAS,iBAAiB,QAAQ,EAAY,GAAK,KAAW,CAAC,EAAO,oBAAoB,eAAe,EAAmB,CAAC,SAAS,oBAAoB,QAAQ,EAAY,GAAK,GAAK,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,yBAJvX,IAA6B,CAAM,EAAW"}