{"version":3,"file":"SmoothScroll.C2JC2GOI.mjs","names":["src","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","c","init_jsx_runtime","ce","init_framer_DcxuU94H","RenderTarget","ControlType","addPropertyControls","SmoothScroll","props","respectReducedMotion","lenis","frame","cancelled","css","LENIS_CSS","LENIS_URL","Lenis","smoothness","raf","time","style","init_SmoothScroll"],"sources":["https:/framerusercontent.com/modules/lJQhqw5DBSisOxFTWWOW/Pq6JUX2qtBR8it4IuBUv/SmoothScroll.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// Lenis is loaded at runtime from jsDelivr, pinned to one version\nconst LENIS_URL=\"https://cdn.jsdelivr.net/npm/lenis@1.3.27/dist/lenis.mjs\";const LENIS_CSS=`\nhtml.lenis, html.lenis body { height: auto; }\n.lenis.lenis-smooth { scroll-behavior: auto !important; }\n.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }\n.lenis.lenis-stopped { overflow: hidden; }\n`;/**\n * Smooths mouse-wheel and trackpad scrolling for the whole page. Touch scrolling stays native.\n * By default nothing changes for visitors who ask their system for reduced motion.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function SmoothScroll(props){const{smoothness,respectReducedMotion,style}=props;useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas)return;if(respectReducedMotion&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;let lenis=null;let frame=0;let cancelled=false;const css=document.createElement(\"style\");css.textContent=LENIS_CSS;document.head.appendChild(css);const src=LENIS_URL;import(/* webpackIgnore: true *//* @vite-ignore */src).then(({default:Lenis})=>{if(cancelled)return;// Lower lerp = longer glide. 0.06–0.12 feels calm without lagging behind the wheel.\nlenis=new Lenis({lerp:.18-smoothness*.12,smoothWheel:true,anchors:true});const raf=time=>{lenis.raf(time);frame=requestAnimationFrame(raf);};frame=requestAnimationFrame(raf);}).catch(()=>{// Native scrolling stays in place if the library can't load\n});return()=>{cancelled=true;cancelAnimationFrame(frame);lenis?.destroy();css.remove();};},[smoothness,respectReducedMotion]);return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{...style,width:1,height:1,pointerEvents:\"none\"}});}SmoothScroll.defaultProps={smoothness:.6,respectReducedMotion:true};addPropertyControls(SmoothScroll,{smoothness:{type:ControlType.Number,title:\"Smoothness\",min:0,max:1,step:.05,defaultValue:.6,description:\"Higher glides longer after each scroll.\"},respectReducedMotion:{type:ControlType.Boolean,title:\"Reduced Motion\",enabledTitle:\"Respect\",disabledTitle:\"Ignore\",defaultValue:true,description:\"Respect turns smoothing off for visitors whose system asks for less motion.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothScroll\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmoothScroll.map"],"mappings":"A,gMAYG,SAAwBY,EAAa,EAAM,CAAC,GAAK,CAAC,aAAW,uBAAqB,SAAOC,EAEkC,OAF5BN,MAAc,CAAwD,GAApDE,EAAa,QAAQ,IAAIA,EAAa,QAAiBK,GAAsBV,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAQ,OAAO,IAAIW,EAAM,KAASC,EAAM,EAAMC,EAAU,GAAYC,EAAI,SAAS,cAAc,OAAO,EAE1V,MAF4V,GAAI,YAAYC,EAAU,SAAS,KAAK,YAAYD,CAAG,EAAsB;;;AAAkDlB,EAAI,CAAC,MAAM,CAAC,QAAQqB,KAAS,CAAC,GAAGJ,EAAU,OACzgB,EAAM,IAAII,EAAM,CAAC,KAAK,IAAIC,EAAW,IAAI,YAAY,GAAK,QAAQ,EAAI,CAAC,EAAE,IAAMC,EAAI,GAAM,CAACR,EAAM,I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