import{b as t}from"./p-e680e7e4.js";class o{constructor(){this.x=0,this.y=0,this.disabled=!1}static disableSmoothScrolling(){this.setScrollBehavior("auto")}static enableSmoothScrolling(){this.setScrollBehavior("smooth")}static setScrollBehavior(o){var s;if(t.hasDocument){const t=document;document.body.style.scrollBehavior=o;const n=null===(s=t.firstChild)||void 0===s?void 0:s.nextSibling;"smooth"===getComputedStyle(n).scrollBehavior&&(n.style.scrollBehavior=o)}}connect(o){o?this.target=o:t.hasDocument&&(this.target=document),onscroll=null,onkeydown=null}disconnect(){this.disabled&&this.enable(),this.target=void 0,onscroll=null,onkeydown=null}isDisabled(){return this.disabled}enable(){this.target&&t.hasWindow&&t.hasDocument&&(document.body.classList.remove("noscroll"),document.body.style.position="",document.body.style.top="",document.body.style.width="",window.scrollTo(this.x,this.y),this.disabled=!1)}disable(){this.target&&t.hasWindow&&t.hasDocument&&(this.x=window.pageXOffset||document.documentElement.scrollLeft,this.y=window.pageYOffset||document.documentElement.scrollTop,document.body.classList.add("noscroll"),document.body.style.position="fixed",document.body.style.top=`-${this.y}px`,document.body.style.width="100%",this.disabled=!0)}}export{o as B}