import{b as balBrowser}from"./browser-a623d3a0.js";var BalScrollHandler=function(){function o(){this.x=0;this.y=0;this.disabled=false}o.disableSmoothScrolling=function(){this.setScrollBehavior("auto")};o.enableSmoothScrolling=function(){this.setScrollBehavior("smooth")};o.setScrollBehavior=function(o){var n;if(balBrowser.hasDocument){var t=document;var i=document.body;i.style.scrollBehavior=o;var s=(n=t.firstChild)===null||n===void 0?void 0:n.nextSibling;var e=getComputedStyle(s);if(e.scrollBehavior==="smooth"){s.style.scrollBehavior=o}}};o.prototype.connect=function(o){if(o){this.target=o}else{if(balBrowser.hasDocument){this.target=document}}onscroll=null;onkeydown=null};o.prototype.disconnect=function(){if(this.disabled){this.enable()}this.target=undefined;onscroll=null;onkeydown=null};o.prototype.isDisabled=function(){return this.disabled};o.prototype.enable=function(){if(this.target){if(balBrowser.hasWindow&&balBrowser.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=false}}};o.prototype.disable=function(){if(this.target){if(balBrowser.hasWindow&&balBrowser.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="-".concat(this.y,"px");document.body.style.width="100%";this.disabled=true}}};return o}();export{BalScrollHandler as B};