export{U as UUID}from"./p-2cb36beb.js";export{F as FileManager}from"./p-9aab8702.js";export{B as BceFile,d as debounce,i as isEmail,r as ripple,v as validator}from"./p-14c9f7f4.js";class t{constructor(t,i={}){this.current=null,this.nodes=[],this.offset=0,this.timeout=0,this.handleScroll=()=>{this.timeout&&window.cancelAnimationFrame(this.timeout),this.timeout=window.requestAnimationFrame(()=>this.detect())},this.selector=t,this.options=Object.assign({class:"active"},i),this.reload(),window.addEventListener("resize",this.handleScroll),window.addEventListener("scroll",this.handleScroll)}get active(){const t=this.nodes[this.nodes.length-1];if(t&&this.bottom&&this.isVisible(t.section))return t;for(let i=this.nodes.length-1;i>=0;i--)if(this.isVisible(this.nodes[i].section))return this.nodes[i];return null}get bottom(){const{root:t}=this;return t.scrollHeight-window.innerHeight<=t.scrollTop}get root(){return document.scrollingElement||document.documentElement}destroy(){this.current&&this.deactivate(this.current),window.removeEventListener("resize",this.handleScroll),window.removeEventListener("scroll",this.handleScroll)}detect(){const{active:t}=this,i=this.current;if(i){if(i===t)return;this.deactivate(i)}t&&this.activate(t),this.current=t}reload(){const{root:t}=this,i=t.querySelectorAll(this.selector);this.nodes=Array.from(i).reduce((t,i)=>{const s=decodeURIComponent(("hash"in i?i.hash:"").slice(1)),e=document.getElementById(s);return e?[...t,{nav:i,section:e}]:t},[]),this.offset=Math.min(...this.nodes.map(t=>t.section.offsetTop)),this.detect()}activate(t){t.nav.classList.add(this.options.class)}deactivate(t){t.nav.classList.remove(this.options.class)}isVisible(t,i){const s=t.getBoundingClientRect();return i?s.bottom<window.innerHeight:s.top<=this.offset}}export{t as ScrollSpy};