1import{L as c,b as h,a as p}from"./chunked-lazycomponentLoader.js";var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,g=(a,s,r,o)=>{for(var t=o>1?void 0:o?d(s,r):s,n=a.length-1,l;n>=0;n--)(l=a[n])&&(t=(o?l(s,r,t):l(t))||t);return o&&t&&u(s,r,t),t},e;const i=(e=class extends c{constructor(){super(...arguments),this.isVisible=!1}async onInit(){this.reconnect(),this.addListener(this.element,"brilliant:showscroll:reset",this.reconnect)}reconnect(){this.observer&&this.observer.disconnect(),this.observer=new IntersectionObserver(s=>{s.forEach(r=>{if(this.isVisible=r.isIntersecting,this.staggerGroup){this.staggerEntry(r);return}setTimeout(()=>{r.isIntersecting?this.element.setAttribute("showscroll","visible"):this.hide&&this.element.setAttribute("showscroll","hidden")},this.delay||0)})},{root:null,rootMargin:this.margin||"0px",threshold:typeof this.threshold>"u"?.01:this.threshold}),this.observer.observe(this.element)}onUnload(){var s;(s=this.observer)==null||s.disconnect()}staggerEntry(s){e.staggeredElements[this.staggerGroup]||(e.staggeredElements[this.staggerGroup]=new Set),s.isIntersecting&&e.staggeredElements[this.staggerGroup].add(this),clearTimeout(e.staggeredTimeouts[this.staggerGroup]),e.staggeredTimeouts[this.staggerGroup]=setTimeout(()=>{const r=Array.from(e.staggeredElements[this.staggerGroup]);e.staggeredElements[this.staggerGroup].clear(),r.sort((o,t)=>{if(o===t)return 0;{const n=o.element.getBoundingClientRect(),l=t.element.getBoundingClientRect();return n.top===l.top?n.left-l.left:n.top-l.top}}),r.forEach((o,t)=>{e.staggeredElements[this.staggerGroup].delete(o),setTimeout(()=>{o.element.setAttribute("showscroll","visible")},this.stagger*t),t++})},1)}},e.selector="[showscroll]",e.staggeredElements={},e.staggeredTimeouts={},e);g([h("showscroll-hide")],i.prototype,"hide",2);g([h("showscroll-margin")],i.prototype,"margin",2);g([h("=showscroll-threshold")],i.prototype,"threshold",2);g([h("=showscroll-delay")],i.prototype,"delay",2);g([h("=showscroll-stagger")],i.prototype,"stagger",2);g([h("showscroll-stagger-group")],i.prototype,"staggerGroup",2);g([p],i.prototype,"reconnect",1);let f=i;export{f as ShowScroll};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.