{"version":3,"file":"NavScrollLock.ByowHA7-.mjs","names":["React.useRef","React.useCallback"],"sources":["https:/framerusercontent.com/modules/BwzwUa8djcZf63FCsXNj/VQ30Q7hbh7HY9vlNM1mD/NavScrollLock.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";// User request: Create a code override that locks page scroll when the nav is open (height > 100px),\n// and restores scroll when closed, using ResizeObserver with proper cleanup.\nexport function BlockScrollWhenOpen(Component){return /*#__PURE__*/React.forwardRef(function BlockScrollWhenOpenOverride(props,ref){const wrapperRef=React.useRef(null);const setScrollLocked=React.useCallback(isOpen=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;document.body.style.overflow=isOpen?\"hidden\":\"\";},[]);React.useEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;if(!wrapperRef.current)return;if(typeof ResizeObserver===\"undefined\")return;const element=wrapperRef.current;const observer=new ResizeObserver(entries=>{const entry=entries[0];if(!entry)return;const nextHeight=entry.contentRect.height;setScrollLocked(nextHeight>100);});observer.observe(element);// Initial check in case there is no immediate resize callback.\nsetScrollLocked(element.getBoundingClientRect().height>100);return()=>{observer.disconnect();document.body.style.overflow=\"\";};},[setScrollLocked]);return /*#__PURE__*/_jsx(\"div\",{ref:wrapperRef,style:{position:\"relative\",display:\"block\",width:\"100%\"},children:/*#__PURE__*/_jsx(Component,{...props,ref:ref})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"BlockScrollWhenOpen\":{\"type\":\"reactHoc\",\"name\":\"BlockScrollWhenOpen\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NavScrollLock.map"],"mappings":"qJAEA,SAAgB,EAAoB,EAAU,CAAC,OAAoB,EAAiB,SAAqC,EAAM,EAAI,CAAC,IAAM,EAAWA,EAAa,IAAI,EAAQ,EAAgBC,EAAkB,GAAQ,CAAW,IAAS,QAAa,OAAO,SAAW,MAAmB,SAAS,KAAK,MAAM,SAAS,EAAO,SAAS,GAAG,EAAE,CAAC,CAAC,EAC9L,OADgM,MAAoB,CAAoG,GAAzF,IAAS,QAAa,OAAO,SAAW,KAAsB,CAAC,EAAW,SAAkB,OAAO,eAAiB,IAAY,OAAO,IAAM,EAAQ,EAAW,QAAc,EAAS,IAAI,eAAe,GAAS,CAAC,IAAM,EAAM,EAAQ,GAAG,GAAG,CAAC,EAAM,OAAO,IAAM,EAAW,EAAM,YAAY,OAAO,EAAgB,EAAW,GAAG,CAAE,CAAC,EAC9nB,OADgoB,EAAS,QAAQ,CAAO,EACptB,EAAgB,EAAQ,sBAAsB,CAAC,CAAC,OAAO,GAAG,MAAY,CAAC,EAAS,WAAW,EAAE,SAAS,KAAK,MAAM,SAAS,EAAG,CAAE,EAAE,CAAC,CAAe,CAAC,EAAsB,EAAK,MAAM,CAAC,IAAI,EAAW,MAAM,CAAC,SAAS,WAAW,QAAQ,QAAQ,MAAM,MAAM,EAAE,SAAsB,EAAK,EAAU,CAAC,GAAG,EAAU,KAAG,CAAC,CAAC,CAAC,CAAE,CAAC,CAAE,qBAHhR,IAA4B"}