{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/Yppqt3Cs3Y8TZqvASnXl/ALzPzo9ZL7qsyNt6jnNi/Smooth_Scroll.js"],
  "sourcesContent": ["import{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import Lenis from\"@studio-freight/lenis\";import{useEffect,useRef}from\"react\";/**\n * @framerDisableUnlink\n */export default function SmoothScroll(props){const{intensity}=props;const lenis=useRef(null);useEffect(()=>{if(lenis.current)lenis.current.scrollTo(0,{immediate:true});},[lenis]);useEffect(()=>{const overlayElement=document.getElementById(\"overlay\");if(overlayElement){const handleMutation=(mutationsList,observer)=>{for(const mutation of mutationsList){if(mutation.type===\"childList\"){const hasChildren=overlayElement.children.length>0;if(hasChildren){// Check if the html tag has the style \"overflow: hidden;\"\nconst htmlElement=document.documentElement;const computedStyle=window.getComputedStyle(htmlElement);const isOverflowHidden=computedStyle.getPropertyValue(\"overflow\")===\"hidden\";if(isOverflowHidden){lenis.current.stop();}else{lenis.current.start();}}else{lenis.current.start();}}}};const observer=new MutationObserver(handleMutation);const config={childList:true};observer.observe(overlayElement,config);return()=>observer.disconnect();}},[]);useEffect(()=>{lenis.current=new Lenis({duration:intensity/10});const raf=time=>{lenis.current.raf(time);requestAnimationFrame(raf);};requestAnimationFrame(raf);return()=>{lenis.current.destroy();lenis.current=null;};},[]);return /*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(\"style\",{children:`\n      html.lenis {\n        height: auto;\n      }\n\n      .lenis.lenis-smooth {\n        scroll-behavior: auto !important;\n      }\n\n      .lenis.lenis-smooth [data-lenis-prevent] {\n        overscroll-behavior: contain;\n      }\n\n      .lenis.lenis-stopped {\n        overflow: hidden;\n      }\n\n      .lenis.lenis-scrolling iframe {\n        pointer-events: none;\n      }\n    `})});}SmoothScroll.displayName=\"Smooth Scroll\";addPropertyControls(SmoothScroll,{intensity:{title:\"Intensity\",type:ControlType.Number,defaultValue:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothScroll\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Smooth_Scroll.map"],
  "mappings": "gMAEkB,SAARA,EAA8BC,EAAM,CAAC,GAAK,CAAC,UAAAC,CAAS,EAAED,EAAYE,EAAMC,EAAO,IAAI,EAAE,OAAAC,EAAU,IAAI,CAAIF,EAAM,SAAQA,EAAM,QAAQ,SAAS,EAAE,CAAC,UAAU,EAAI,CAAC,CAAE,EAAE,CAACA,CAAK,CAAC,EAAEE,EAAU,IAAI,CAAC,IAAMC,EAAe,SAAS,eAAe,SAAS,EAAE,GAAGA,EAAe,CAAC,IAAMC,EAAe,CAACC,EAAcC,IAAW,CAAC,QAAUC,KAAYF,EAAe,GAAGE,EAAS,OAAO,YAAgE,GAAjCJ,EAAe,SAAS,OAAO,EAAiB,CACtc,IAAMK,EAAY,SAAS,gBAAoCC,EAAO,iBAAiBD,CAAW,EAAuC,iBAAiB,UAAU,IAAI,SAA8BR,EAAM,QAAQ,KAAK,EAAQA,EAAM,QAAQ,MAAM,OAASA,EAAM,QAAQ,MAAM,CAAK,EAAQM,EAAS,IAAI,iBAAiBF,CAAc,EAAQM,EAAO,CAAC,UAAU,EAAI,EAAE,OAAAJ,EAAS,QAAQH,EAAeO,CAAM,EAAQ,IAAIJ,EAAS,WAAW,EAAG,EAAE,CAAC,CAAC,EAAEJ,EAAU,IAAI,CAACF,EAAM,QAAQ,IAAIW,EAAM,CAAC,SAASZ,EAAU,EAAE,CAAC,EAAE,IAAMa,EAAIC,GAAM,CAACb,EAAM,QAAQ,IAAIa,CAAI,EAAE,sBAAsBD,CAAG,CAAE,EAAE,6BAAsBA,CAAG,EAAQ,IAAI,CAACZ,EAAM,QAAQ,QAAQ,EAAEA,EAAM,QAAQ,IAAK,CAAE,EAAE,CAAC,CAAC,EAAsBc,EAAKC,EAAU,CAAC,SAAsBD,EAAK,QAAQ,CAAC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAoBruB,CAAC,CAAC,CAAC,CAAE,CAACjB,EAAa,YAAY,gBAAgBmB,EAAoBnB,EAAa,CAAC,UAAU,CAAC,MAAM,YAAY,KAAKoB,EAAY,OAAO,aAAa,EAAE,CAAC,CAAC",
  "names": ["SmoothScroll", "props", "intensity", "lenis", "pe", "ue", "overlayElement", "handleMutation", "mutationsList", "observer", "mutation", "htmlElement", "window", "config", "Lenis", "raf", "time", "p", "l", "addPropertyControls", "ControlType"]
}
