1import{Component}from"@theme/component";class DevDrawerNav extends Component{#parentDetails=null;connectedCallback(){super.connectedCallback(),this.#parentDetails=this.closest("details"),this.#parentDetails?.addEventListener("toggle",this.#handleDrawerToggle),this.addEventListener("click",this.#handleSameUrlLinkClick)}disconnectedCallback(){super.disconnectedCallback(),this.#parentDetails?.removeEventListener("toggle",this.#handleDrawerToggle),this.removeEventListener("click",this.#handleSameUrlLinkClick),this.#parentDetails=null}#handleDrawerToggle=()=>{this.#parentDetails?.open||this.#resetAll()};#handleSameUrlLinkClick=event=>{if(event.defaultPrevented||event.button!==0||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)return;const target=event.target;if(!(target instanceof Element))return;const link=target.closest("a[href]");if(!(link instanceof HTMLAnchorElement)||!this.contains(link))return;let url;try{url=new URL(link.href,location.href)}catch{return}url.origin===location.origin&&url.pathname===location.pathname&&url.search===location.search&&(url.hash&&url.hash!==location.hash||event.preventDefault())};openColumn(handle,event){const target=this.querySelector(`[data-
1parent="${handle}"]`);if(!target||!(target instanceof HTMLElement))return;const level=parseInt(target.dataset.level??"0",10),button=event?.target instanceof Element?event.target.closest("button"):null;this.#closeColumnsAtOrAbove(level),this.#deactivateButtonsAtLevel(level-1),button&&(button.classList.add("drawer-nav__link--active"),button.setAttribute("aria-expanded","true")),target.classList.add("is-active"),this.#promoteColumnImages(target),this.dataset.depth=String(level),this.#updateDrawerWidth(level)}#promoteColumnImages(column){for(const img of column.querySelectorAll("[data-drawer-nav-promo-img]"))img instanceof HTMLImageElement&&img.loading==="lazy"&&(img.loading="eager")}closeColumn(event){const column=event?.target instanceof Element?event.target.closest(".drawer-nav__column"):null;if(!column||!(column instanceof HTMLElement))return;const level=parseInt(column.dataset.level??"0",10);this.#closeColumnsAtOrAbove(level),this.#deactivateButtonsAtLevel(level-1);const newDepth=level-1;this.dataset.depth=String(newDepth),this.#updateDrawerWidth(newDepth)}#closeColumnsAtOrAbove(level){for(const col of this.querySelectorAll(".drawer-nav__column.is-active"))col instanceof HTMLElement&&parseInt(col.dataset.level??"0",10)>=level&&col.classList.remove("is-active")}#deactivateButtonsAtLevel(level){const selector=level===1?".drawer-nav__column--l1":`.drawer-nav__column--l2.is-active, .drawer-nav__column--l2[data-level="${level}"]`;for(const col of this.querySelectorAll(selector))for(const btn of col.querySelectorAll(".drawer-nav__link--active"))btn.classList.remove("drawer-nav__link--active"),btn.setAttribute("aria-expanded","false")}#updateDrawerWidth(depth){const drawer=this.closest(".menu-drawer");drawer instanceof HTMLElement&&drawer.style.setProperty("--drawer-nav-columns",String(depth))}#resetAll(){for(const col of this.querySelectorAll(".drawer-nav__column.is-active"))col.classList.remove("is-active");for(const btn of this.querySelectorAll(".drawer-nav__link--active"))btn.classList.remove("drawer-nav__link--active"),btn.setAttribute("aria-expanded","false");this.dataset.depth="1",this.#updateDrawerWidth(1)}}customElements.get("dev-drawer-nav")||customElements.define("dev-drawer-nav",DevDrawerNav); 2//# sourceMappingURL=/cdn/shop/t/332/assets/dev-drawer-nav.js.map?v=184347644383377651491787217853
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.