{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/Yppqt3Cs3Y8TZqvASnXl/PGrowqBrgWCViHduGfsA/SmoothScroll_Prod.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,withCSS}from\"framer\";import Lenis from\"lenis\";import{useEffect,useRef}from\"react\";function SmoothScrollComponent(props){const{intensity}=props;const lenis=useRef(null);useEffect(()=>{if(lenis.current){try{lenis.current.scrollTo(0,{immediate:true});}catch(error){console.error(\"Error scrolling to top:\",error);}}},[lenis]);// Watch for stop scroll elements\nuseEffect(()=>{const checkForStopScroll=()=>{try{const stopScrollElement=document.querySelector(\"[data-frameruni-stop-scroll]\");const htmlElement=document.documentElement;const hasHiddenOverflow=htmlElement&&htmlElement.style&&htmlElement.style.overflow===\"hidden\";if(lenis.current){if(stopScrollElement||hasHiddenOverflow){lenis.current.stop();}else{lenis.current.start();}}}catch(error){console.error(\"Error in checkForStopScroll:\",error);}};// Initial check\ncheckForStopScroll();// Set up observers\nlet stopScrollObserver;let htmlStyleObserver;try{stopScrollObserver=new MutationObserver(checkForStopScroll);htmlStyleObserver=new MutationObserver(checkForStopScroll);// Observe document for data-frameruni-stop-scroll attribute\nif(document&&document.documentElement){stopScrollObserver.observe(document.documentElement,{childList:true,subtree:true,attributes:true,attributeFilter:[\"data-frameruni-stop-scroll\"]});// Observe only the HTML element for style changes\nhtmlStyleObserver.observe(document.documentElement,{attributes:true,attributeFilter:[\"style\"]});}}catch(error){console.error(\"Error setting up observers:\",error);}return()=>{try{if(stopScrollObserver)stopScrollObserver.disconnect();if(htmlStyleObserver)htmlStyleObserver.disconnect();}catch(error){console.error(\"Error disconnecting observers:\",error);}};},[]);useEffect(()=>{try{if(!document)return;const allElements=document.getElementsByTagName(\"*\");for(let i=0;i<allElements.length;i++){const element=allElements[i];if(!element)continue;try{const computedStyle=window.getComputedStyle(element);if(computedStyle&&computedStyle.getPropertyValue(\"overflow\")===\"auto\"){element.setAttribute(\"data-lenis-prevent\",\"true\");}}catch(styleError){console.error(\"Error getting computed style:\",styleError);}}}catch(error){console.error(\"Error in overflow detection:\",error);}},[]);useEffect(()=>{try{if(typeof Lenis!==\"function\"){console.error(\"Lenis is not available\");return;}lenis.current=new Lenis({duration:(intensity||10)/10});const raf=time=>{if(lenis.current){try{lenis.current.raf(time);requestAnimationFrame(raf);}catch(error){console.error(\"Error in animation frame:\",error);}}};const animationId=requestAnimationFrame(raf);return()=>{cancelAnimationFrame(animationId);if(lenis.current){try{lenis.current.destroy();lenis.current=null;}catch(error){console.error(\"Error destroying Lenis:\",error);}}};}catch(error){console.error(\"Error initializing Lenis:\",error);return()=>{};}},[intensity]);//https://github.com/darkroomengineering/lenis?tab=readme-ov-file#anchor-links\nuseEffect(()=>{try{if(!document||!lenis.current)return;// Get all anchor links and store click handlers with their targets\nconst anchorLinksData=Array.from(document.querySelectorAll(\"a[href]\")||[]).filter(element=>{if(!element)return false;const anchor=element;if(!anchor.href)return false;// Only handle internal anchor links\nconst isInternalLink=anchor.href.startsWith(window.location.origin)||anchor.href.startsWith(\"./\")||anchor.href.startsWith(\"/\");const hasHash=anchor.href.includes(\"#\");return isInternalLink&&hasHash;}).map(anchor=>{try{const anchorElement=anchor;const href=anchorElement.href.includes(\"#\")?`#${anchorElement.href.split(\"#\").pop()}`:\"\";const decodedHref=href?decodeURIComponent(href):\"\";let scrollMargin=0;try{if(decodedHref){const targetElement=document.querySelector(decodedHref);if(targetElement){const marginStyle=window.getComputedStyle(targetElement).scrollMarginTop;scrollMargin=marginStyle?parseInt(marginStyle)||0:0;}}}catch(targetError){console.error(\"Error finding target element:\",targetError);}return{href,scrollMargin,anchorElement:anchorElement};}catch(anchorError){console.error(\"Error processing anchor:\",anchorError);return null;}}).filter(Boolean);const handleClick=(e,href,scrollMargin)=>{try{if(e&&e.preventDefault)e.preventDefault();if(lenis.current&&href){lenis.current.scrollTo(href,{offset:-(scrollMargin||0)});}}catch(error){console.error(\"Error in anchor click handler:\",error);}};const handlers=anchorLinksData.map(({href,scrollMargin})=>e=>handleClick(e,href,scrollMargin));anchorLinksData.forEach(({anchorElement},index)=>{if(anchorElement&&handlers[index]){anchorElement.addEventListener(\"click\",handlers[index]);}});return()=>{anchorLinksData.forEach(({anchorElement},index)=>{if(anchorElement&&handlers[index]){anchorElement.removeEventListener(\"click\",handlers[index]);}});};}catch(error){console.error(\"Error setting up anchor links:\",error);return()=>{};}},[lenis]);return /*#__PURE__*/_jsx(\"div\",{style:props.style});}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n *\n * @framerDisableUnlink\n */const SmoothScroll=withCSS(SmoothScrollComponent,[\"html.lenis { height: auto; }\",\".lenis.lenis-smooth { scroll-behavior: auto !important; }\",\".lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }\",\".lenis.lenis-stopped { overflow: hidden; }\",\".lenis.lenis-scrolling iframe { pointer-events: none; }\"],\"\");export default SmoothScroll;SmoothScroll.displayName=\"Smooth Scroll\";addPropertyControls(SmoothScroll,{intensity:{title:\"Intensity\",type:ControlType.Number,defaultValue:10,min:0,description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothScroll\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmoothScroll_Prod.map"],
  "mappings": "gMAAoK,SAASA,EAAsBC,EAAM,CAAC,GAAK,CAAC,UAAAC,CAAS,EAAED,EAAYE,EAAMC,EAAO,IAAI,EAAE,OAAAC,EAAU,IAAI,CAAC,GAAGF,EAAM,QAAS,GAAG,CAACA,EAAM,QAAQ,SAAS,EAAE,CAAC,UAAU,EAAI,CAAC,CAAE,OAAOG,EAAM,CAAC,QA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CAAG,CAAC,EAAQ,IAAI,CAACf,EAAgB,QAAQ,CAAC,CAAC,cAAAI,CAAa,EAAEW,IAAQ,CAAIX,GAAeU,EAASC,CAAK,GAAGX,EAAc,oBAAoB,QAAQU,EAASC,CAAK,CAAC,CAAG,CAAC,CAAE,CAAE,OAAOhC,EAAM,CAAC,eAAQ,MAAM,iCAAiCA,CAAK,EAAQ,IAAI,CAAC,CAAE,CAAC,EAAE,CAACH,CAAK,CAAC,EAAsBoC,EAAK,MAAM,CAAC,MAAMtC,EAAM,KAAK,CAAC,CAAE,CAKjnD,IAAMuC,EAAaC,EAAQzC,EAAsB,CAAC,+BAA+B,4DAA4D,6EAA6E,6CAA6C,yDAAyD,EAAE,EAAE,EAAS0C,EAAQF,EAAaA,EAAa,YAAY,gBAAgBG,EAAoBH,EAAa,CAAC,UAAU,CAAC,MAAM,YAAY,KAAKI,EAAY,OAAO,aAAa,GAAG,IAAI,EAAE,YAAY,oEAAoE,CAAC,CAAC",
  "names": ["SmoothScrollComponent", "props", "intensity", "lenis", "pe", "ue", "error", "checkForStopScroll", "stopScrollElement", "htmlElement", "hasHiddenOverflow", "stopScrollObserver", "htmlStyleObserver", "allElements", "i", "element", "computedStyle", "window", "styleError", "Lenis", "raf", "time", "animationId", "anchorLinksData", "anchor", "isInternalLink", "hasHash", "anchorElement", "href", "decodedHref", "scrollMargin", "targetElement", "marginStyle", "targetError", "anchorError", "handleClick", "e", "handlers", "index", "p", "SmoothScroll", "withCSS", "SmoothScroll_Prod_default", "addPropertyControls", "ControlType"]
}
