{"version":3,"file":"shared-lib.DX3SbDIn.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/l6f9OeDDoTgAh6ucHpAx/Hhl37MDIommTwwtxJxdn/ScrollToTop.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export function withScrollToTop(Component){return props=>{const[isVisible,setIsVisible]=useState(false);const[offsetY,setOffsetY]=useState(0);useEffect(()=>{const handleScroll=()=>{// Show button when page is scrolled down 300px\nif(window.scrollY>600){setIsVisible(true);}else{setIsVisible(false);}// Calculate distance from bottom\nconst scrollHeight=document.documentElement.scrollHeight;const scrollTop=window.scrollY;const clientHeight=window.innerHeight;const distanceFromBottom=scrollHeight-(scrollTop+clientHeight);// Move button up when near bottom (within 100px)\nif(distanceFromBottom<70){setOffsetY(-(160-distanceFromBottom));}else{setOffsetY(0);}};window.addEventListener(\"scroll\",handleScroll);return()=>{window.removeEventListener(\"scroll\",handleScroll);};},[]);const scrollToTop=()=>{window.scrollTo({top:0,behavior:\"smooth\"});};return /*#__PURE__*/_jsx(Component,{...props,onClick:scrollToTop,style:{...props.style,opacity:isVisible?1:0,pointerEvents:isVisible?\"auto\":\"none\",transform:`translateY(${offsetY}px)`,transition:\"opacity 0.3s ease-in-out, transform 0.3s ease-in-out\",cursor:\"pointer\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withScrollToTop\":{\"type\":\"reactHoc\",\"name\":\"withScrollToTop\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTop.map"],"mappings":"uIAAiF,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAQ,GAAYA,EAAS,EAAE,CAAC,MAAc,CAAC,IAAM,MAAiB,CAClQ,EAAO,QAAQ,IAAK,EAAa,GAAK,CAAO,EAAa,GAAM,CAC2D,IAAM,EAAjH,SAAS,gBAAgB,cAA6B,EAAO,QAA2B,EAAO,aACxF,EAAvB,EAAmB,GAAe,EAAE,IAAI,GAAsC,EAAE,EAAmD,OAA/C,EAAO,iBAAiB,SAAS,EAAa,KAAW,CAAC,EAAO,oBAAoB,SAAS,EAAa,GAAK,EAAE,CAAC,CAAC,IAAM,MAAgB,CAAC,EAAO,SAAS,CAAC,IAAI,EAAE,SAAS,SAAS,CAAC,EAAG,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,EAAY,MAAM,CAAC,GAAG,EAAM,MAAM,QAAQ,EAAU,EAAE,EAAE,cAAc,EAAU,OAAO,OAAO,UAAU,cAAc,EAAQ,KAAK,WAAW,uDAAuD,OAAO,UAAU,CAAC,CAAC,uBAHjf,IAAsC"}