1import{g as o}from"./index-D3jsOSc0.js";class u{constructor(t){var e;this.element=t,this.button=this.element.querySelector("button"),this.nav=this.element.querySelector("nav"),(e=this.element)==null||e.addEventListener("keydown",this.handleKeydown.bind(this)),this.initialize()}initialize(){this.button&&this.button.addEventListener("click",()=>this.toggleNav())}toggleNav(){if(!this.button||!this.nav)return;this.button.ariaExpanded==="true"?(this.button.ariaExpanded="false",this.nav.ariaHidden="true",this.nav.setAttribute("inert",""),o.to(this.nav,{height:0,duration:.4,ease:"power1.out"})):(this.button.ariaExpanded="true",this.nav.ariaHidden="false",this.nav.removeAttribute("inert"),o.to(this.nav,{height:"auto",duration:.5,ease:"power1.out"}))}handleKeydown(t){if(t.key==="Escape"&&(t.preventDefault(),this.toggleNav()),t.key==="Tab"){const e=["a","button"],i=Array.from(this.element.querySelectorAll(e.join(","))).filter(r=>r instanceof HTMLElement);if(i.length===0)return;const n=i[0],s=i[i.length-1],a=document.activeElement;t.shiftKey?a===n&&(t.preventDefault(),s.focus()):a===s&&(t.preventDefault(),n.focus())}}}export{u as default};
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.