{"version":3,"file":"toggleScrollAndFocusForOverlay.BN_p74VB.mjs","names":[],"sources":["https:/framerusercontent.com/modules/5xHj4XO7vjZ0IKnRi95x/ZxpcAN5x4xOWfN6CXPDP/toggleScrollAndFocusForOverlay.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";export function toggleScrollForChatOverlay(Component){return props=>{useEffect(()=>{const overlay=document.getElementById(\"chat-widget-overlay\");const disableScroll=()=>{document.body.style.overflow=\"hidden\";};const enableScroll=()=>{document.body.style.overflow=\"\";};const checkOverlayVisibility=()=>{if(overlay&&getComputedStyle(overlay).display!==\"none\"){disableScroll();}else{enableScroll();}};// Set up a MutationObserver to monitor changes in overlay visibility\nconst observer=new MutationObserver(()=>{checkOverlayVisibility();});if(overlay){observer.observe(overlay,{attributes:true,attributeFilter:[\"style\",\"class\"]});// Initial check in case it's already open\ncheckOverlayVisibility();}return()=>{enableScroll()// Ensure scroll is enabled when unmounting\n;observer.disconnect();};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"toggleScrollForChatOverlay\":{\"type\":\"reactHoc\",\"name\":\"toggleScrollForChatOverlay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./toggleScrollAndFocusForOverlay.map"],"mappings":"kHAAwE,SAAgB,EAA2B,EAAU,CAAC,MAAO,KAAQ,MAAc,CAAC,IAAM,EAAQ,SAAS,eAAe,sBAAsB,CAAO,MAAkB,CAAC,SAAS,KAAK,MAAM,SAAS,UAAiB,MAAiB,CAAC,SAAS,KAAK,MAAM,SAAS,IAAW,MAA2B,CAAI,GAAS,iBAAiB,EAAQ,CAAC,UAAU,OAAQ,GAAe,CAAO,GAAc,EAC5c,EAAS,IAAI,qBAAqB,CAAC,GAAwB,EAAG,CAC1C,OAD8C,IAAS,EAAS,QAAQ,EAAQ,CAAC,WAAW,GAAK,gBAAgB,CAAC,QAAQ,QAAQ,CAAC,CAAC,CAC9J,GAAwB,MAAY,CAAC,GAAc,CAClD,EAAS,YAAY,GAAK,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,mBAHlC,IAA6B"}