{"version":3,"file":"SmoothScroll.1WY6J047.mjs","names":[],"sources":["https:/framerusercontent.com/modules/BALoSVrFt4gYLwiEINNl/p3Yh2KAbowEIypRmMuXf/Y6Lurcwhu.js","https:/framerusercontent.com/modules/NQ9q7g8MDYn8F2OM6hJc/zdhSktpIXcL2boAjHk3J/SmoothScroll.js"],"sourcesContent":["// Generated by Framer (34c068c)\nimport{fontStore}from\"framer\";fontStore.loadFonts([]);export const fonts=[{explicitInter:true,fonts:[]}];export const css=[\".framer-2EHbK .framer-styles-preset-1pub33a:not(.rich-text-wrapper), .framer-2EHbK .framer-styles-preset-1pub33a.rich-text-wrapper a { --framer-link-hover-text-decoration: underline; }\"];export const className=\"framer-2EHbK\";\nexport const __FramerMetadata__ = {\"exports\":{\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function SmoothScroll(props){const{intensity,ease,disableOnTouch}=props;const isStatic=useIsStaticRenderer();useEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\"||isStatic){return;}const isTouchDevice=typeof window.matchMedia===\"function\"&&window.matchMedia(\"(pointer: coarse)\").matches;if(disableOnTouch&&isTouchDevice){return;}let currentY=window.scrollY;let targetY=window.scrollY;let rafId;let running=false;const getMaxScroll=()=>Math.max(0,document.documentElement.scrollHeight-window.innerHeight);const isInsideScrollable=el=>{let node=el;while(node&&node!==document.body){const style=window.getComputedStyle(node);const canScroll=(style.overflowY===\"auto\"||style.overflowY===\"scroll\")&&node.scrollHeight>node.clientHeight;if(canScroll)return true;node=node.parentElement;}return false;};const tick=()=>{const diff=targetY-currentY;if(Math.abs(diff)<.5){currentY=targetY;window.scrollTo(0,currentY);running=false;return;}currentY+=diff*ease;window.scrollTo(0,currentY);rafId=window.requestAnimationFrame(tick);};const handleWheel=event=>{if(isInsideScrollable(event.target))return;event.preventDefault();if(!running){currentY=window.scrollY;targetY=window.scrollY;running=true;rafId=window.requestAnimationFrame(tick);}const maxScroll=getMaxScroll();targetY=Math.min(maxScroll,Math.max(0,targetY+event.deltaY*intensity));};window.addEventListener(\"wheel\",handleWheel,{passive:false});return()=>{window.removeEventListener(\"wheel\",handleWheel);if(rafId)window.cancelAnimationFrame(rafId);};},[intensity,ease,disableOnTouch,isStatic]);return /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1,opacity:0}});}addPropertyControls(SmoothScroll,{intensity:{type:ControlType.Number,title:\"Intensity\",defaultValue:1,min:.2,max:3,step:.1},ease:{type:ControlType.Number,title:\"Smoothness\",defaultValue:.08,min:.02,max:.5,step:.01},disableOnTouch:{type:ControlType.Boolean,title:\"Disable On Touch\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothScroll\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmoothScroll.map"],"mappings":"6NAC6B,EAAC,EAAU,UAAU,CAAC,CAAC,EAAe,EAAM,CAAC,CAAC,cAAc,GAAK,MAAM,CAAC,CAAC,CAAC,EAAe,EAAI,CAAC,0LAA0L,EAAe,EAAU,kBCE3U,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,YAAU,OAAK,kBAAgB,EAAY,EAAS,EAAoB,EAAi7C,OAA/6C,MAAc,CAAC,GAAU,IAAS,QAAa,OAAO,SAAW,KAAa,EAAU,OAAQ,IAAM,EAAc,OAAO,E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