{"version":3,"file":"index53.cjs","sources":["../src/hooks/useScrollDisable.ts"],"sourcesContent":["import { useEffect } from 'react';\n\n/**\n * Hook to disable body scrolling when a modal or overlay is open\n * @param isScrollDisabled - Boolean to determine if body scrolling should be disabled\n */\nconst useScrollDisable = (isScrollDisabled: boolean): void => {\n  useEffect(() => {\n    // Save the original body style\n    const originalStyle = window.getComputedStyle(document.body).overflow;\n    \n    if (isScrollDisabled) {\n      // Disable scrolling\n      document.body.style.overflow = 'hidden';\n      \n      // On iOS Safari, we need additional measures to prevent background scrolling\n      document.body.style.position = 'fixed';\n      document.body.style.width = '100%';\n      document.body.style.top = `-${window.scrollY}px`;\n    }\n    \n    // Cleanup function to restore original body style when component unmounts or isScrollDisabled changes\n    return () => {\n      if (isScrollDisabled) {\n        const scrollY = document.body.style.top;\n        document.body.style.overflow = originalStyle;\n        document.body.style.position = '';\n        document.body.style.width = '';\n        document.body.style.top = '';\n        \n        // Restore scroll position\n        window.scrollTo(0, parseInt(scrollY || '0', 10) * -1);\n      }\n    };\n  }, [isScrollDisabled]);\n};\n\nexport default useScrollDisable;"],"names":["useEffect"],"mappings":";;AAMM,MAAA,mBAAmB,CAAC,qBAAoC;AAC5DA,QAAAA,UAAU,MAAM;AAEd,UAAM,gBAAgB,OAAO,iBAAiB,SAAS,IAAI,EAAE;AAE7D,QAAI,kBAAkB;AAEX,eAAA,KAAK,MAAM,WAAW;AAGtB,eAAA,KAAK,MAAM,WAAW;AACtB,eAAA,KAAK,MAAM,QAAQ;AAC5B,eAAS,KAAK,MAAM,MAAM,IAAI,OAAO,OAAO;AAAA,IAAA;AAI9C,WAAO,MAAM;AACX,UAAI,kBAAkB;AACd,cAAA,UAAU,SAAS,KAAK,MAAM;AAC3B,iBAAA,KAAK,MAAM,WAAW;AACtB,iBAAA,KAAK,MAAM,WAAW;AACtB,iBAAA,KAAK,MAAM,QAAQ;AACnB,iBAAA,KAAK,MAAM,MAAM;AAG1B,eAAO,SAAS,GAAG,SAAS,WAAW,KAAK,EAAE,IAAI,EAAE;AAAA,MAAA;AAAA,IAExD;AAAA,EAAA,GACC,CAAC,gBAAgB,CAAC;AACvB;;"}