{"version":3,"file":"SmoothScroller.D2jOXoTG.mjs","names":["useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/xdvC3ZtIOyf8jEqXO0Hy/oP3ST6uAVKavIIFHkwXT/SmoothScroller.js"],"sourcesContent":["// Fix waitForComponentLoader timeout by returning a valid visual React element instead of props-only override behavior.\n// Smooth scroll with slider to control intensity\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useCallback}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Smooth Scroll with Intensity Control\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 100\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */function SmoothScroller(props){const{intensity,style}=props;const isStatic=useIsStaticRenderer();const lastScrollRef=useRef(0);const targetScrollRef=useRef(0);const tickingRef=useRef(false);const animationIdRef=useRef(null);const hasScrollableParent=useCallback(target=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return false;if(!(target instanceof HTMLElement))return false;let el=target;while(el&&el!==document.body&&el!==document.documentElement){const style=window.getComputedStyle(el);const overflowY=style.overflowY;const canScrollY=el.scrollHeight>el.clientHeight;if((overflowY===\"auto\"||overflowY===\"scroll\")&&canScrollY){return true;}el=el.parentElement;}return false;},[]);useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const prefersReduced=window.matchMedia&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;if(prefersReduced)return;let animationFrameRunning=false;const maxScroll=()=>document.documentElement.scrollHeight-window.innerHeight;const clampedIntensity=Math.max(1,Math.min(20,intensity||13));const smoothingFactor=Math.max(.08,Math.min(.24,.24-(clampedIntensity-1)*.004));const speedMultiplier=.7+clampedIntensity*.1;lastScrollRef.current=window.scrollY;targetScrollRef.current=lastScrollRef.current;function animate(){animationFrameRunning=true;const limit=maxScroll();const clampedTarget=Math.max(0,Math.min(limit,targetScrollRef.current));const current=lastScrollRef.current;const diff=clampedTarget-current;if(Math.abs(diff)<.4){lastScrollRef.current=clampedTarget;window.scrollTo(0,clampedTarget);tickingRef.current=false;animationFrameRunning=false;return;}const next=current+diff*smoothingFactor;lastScrollRef.current=next;window.scrollTo(0,next);animationIdRef.current=window.requestAnimationFrame(animate);}function onWheel(e){if(hasScrollableParent(e.target)){// Let native scrolling happen inside scrollable overlays/containers\nreturn;}e.preventDefault();const limit=maxScroll();const delta=e.deltaY;const cappedDelta=Math.max(-200,Math.min(200,delta));targetScrollRef.current=Math.max(0,Math.min(limit,targetScrollRef.current+cappedDelta*speedMultiplier));if(!tickingRef.current){tickingRef.current=true;if(!animationFrameRunning){animationIdRef.current=window.requestAnimationFrame(animate);}}}window.addEventListener(\"wheel\",onWheel,{passive:false});document.body.style.scrollBehavior=\"auto\";return()=>{window.removeEventListener(\"wheel\",onWheel);if(animationIdRef.current!==null)window.cancelAnimationFrame(animationIdRef.current);tickingRef.current=false;animationFrameRunning=false;document.body.style.scrollBehavior=\"\";};},[intensity,isStatic,hasScrollableParent]);// Render a minimal, non-interactive visual element so the component loads correctly\nreturn /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",pointerEvents:\"none\",...style},\"aria-hidden\":true});}addPropertyControls(SmoothScroller,{intensity:{type:ControlType.Number,title:\"Intensity\",defaultValue:13,min:1,max:20,step:1,unit:\"\"}});export default SmoothScroller;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothScroller\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"200\",\"framerIntrinsicHeight\":\"100\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmoothScroller.map"],"mappings":"8MAUG,SAAS,EAAe,EAAM,CAAC,GAAK,CAAC,YA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