define(["require","exports","./dom.amd"],(function(g,s,i){"use strict";if(typeof d>"u")var d=window.Vue;const n=t=>{if(!t||!t.parentElement||!t.offsetHeight)return;if(window.dialogs){const o=t.closest(".ui-dialog");o?.getBoundingClientRect()&&o?.getBoundingClientRect().bottom>document.documentElement.clientHeight&&setTimeout(window.dialogs.onWindowResize)}const e=t.scrollHeight>t.offsetHeight;if(e?(t.parentElement.classList.add("has_scroll_container"),t.classList.add("has_scroll")):(t.parentElement.classList.remove("has_scroll_container"),t.classList.remove("has_scroll")),e){const o=i.offset(t).top-i.offset(t.parentElement).top;t.style.setProperty("--scroll-offset-top",o+"px");const r=t.offsetHeight;t.style.setProperty("--scroll-height",r+"px"),t.scrollTop>0?t.classList.add("has_scroll-started"):t.classList.remove("has_scroll-started"),t.scrollTop>=t.scrollHeight-t.offsetHeight?t.classList.add("has_scroll-finished"):t.classList.remove("has_scroll-finished")}};let c;window.ResizeObserver&&(c=new ResizeObserver(t=>{t.forEach(e=>n(e.target))}));const l=t=>{if(!t)return;if(Array.isArray(t)){t.forEach(o=>l(o));return}const e=t;e.dataset.scrollShadowInited||(e.dataset.scrollShadowInited="true",e.onscroll=()=>n(e),c?.observe(e))},f=t=>{c?.unobserve(t)},h=()=>a(),a=(t=document.documentElement)=>{const e=t.clientHeight,o=t.scrollHeight,r=t.scrollTop;if(o&&r&&e){const u=o-e;return Math.floor(r/u*100)}return 100};s.amountScrolled=h,s.connectScrollShadow=l,s.genHasScroll=n,s.getScrollPercent=a,s.unconnectScrollShadow=f,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
//# sourceMappingURL=scroll.amd.js.map
