1import{Component}from"@theme/component";import{trapFocus,removeTrapFocus}from"@theme/focus";import{onAnimationEnd,removeWillChangeOnAnimationEnd}from"@theme/utilities";class HeaderDrawer extends Component{requiredRefs=["details","menuDrawer"];connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this.#onKeyUp),this.#setupAnimatedElementListeners()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keyup",this.#onKeyUp)}#onKeyUp=event=>{event.key==="Escape"&&this.#close(this.#getDetailsElement(event))};get isOpen(){return this.refs.details.hasAttribute("open")}#getDetailsElement(event){return event?.target instanceof Element?event.target.closest("details")??this.refs.details:this.refs.details}toggle(){return this.isOpen?this.close():this.open()}open(target,event){const details=this.#getDetailsElement(event),summary=details.querySelector("summary");summary&&(summary.setAttribute("aria-expanded","true"),this.preventInitialAccordionAnimations(details),requestAnimationFrame(()=>{details.classList.add("menu-open"),target&&this.refs.menuDrawer.classList.add("menu-drawer--has-submenu-opened");const drawer=details.querySelector(".menu-drawer, .menu-drawer__submenu");onAnimationEnd(drawer||details,()=>
1trapFocus(details),{subtree:!1})}))}back(event){this.#close(this.#getDetailsElement(event))}close(){this.#close(this.refs.details)}#close(details){const summary=details.querySelector("summary");if(!summary)return;summary.setAttribute("aria-expanded","false"),details.classList.remove("menu-open"),this.refs.menuDrawer.classList.remove("menu-drawer--has-submenu-opened");const drawer=details.querySelector(".menu-drawer, .menu-drawer__submenu");onAnimationEnd(drawer||details,()=>{reset(details),details===this.refs.details?(removeTrapFocus(),this.querySelectorAll("details[open]:not(accordion-custom > details)").forEach(reset)):trapFocus(this.refs.details)},{subtree:!1})}#setupAnimatedElementListeners(){this.querySelectorAll(".menu-drawer__animated-element").forEach(element=>{element.addEventListener("animationend",removeWillChangeOnAnimationEnd)})}preventInitialAccordionAnimations(details){const content=details.querySelectorAll("accordion-custom .details-content");content.forEach(element=>{element instanceof HTMLElement&&element.classList.add("details-content--no-animation")}),setTimeout(()=>{content.forEach(element=>{element instanceof HTMLElement&&element.classList.remove("details-content--no-animation")})},100)}}customElements.get("header-drawer")||customElements.define("header-drawer",HeaderDrawer);function reset(element){element.classList.remove("menu-open"),element.removeAttribute("open"),element.querySelector("summary")?.setAttribute("aria-expanded","false")} 2//# sourceMappingURL=/cdn/shop/t/378/assets/header-drawer.js.map?v=121243031541024704371787069263
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.