1import{mediaQueryLarge,isMobileBreakpoint}from"@theme/utilities";class AccordionCustom extends HTMLElement{get details(){const details=this.querySelector("details");if(!(details instanceof HTMLDetailsElement))throw new Error("Details element not found");return details}get summary(){const summary=this.details.querySelector("summary");if(!(summary instanceof HTMLElement))throw new Error("Summary element not found");return summary}get#disableOnMobile(){return this.dataset.disableOnMobile==="true"}get#disableOnDesktop(){return this.dataset.disableOnDesktop==="true"}get#closeWithEscape(){return this.dataset.closeWithEscape==="true"}#controller=new AbortController;connectedCallback(){const{signal}=this.#controller;this.#setDefaultOpenState(),this.addEventListener("keydown",this.#handleKeyDown,{signal}),this.summary.addEventListener("click",this.handleClick,{signal}),this.details.addEventListener("click",this.#handleContentClick,{signal}),mediaQueryLarge.addEventListener("change",this.#handleMediaQueryChange,{signal})}disconnectedCallback(){this.#controller.abort()}handleClick=event=>{const isMobile=isMobileBreakpoint(),isDesktop=!isMobile;if(isMobile&&this.#disableOnMobile||isDesktop&&this.#disableOnDesktop){event.preventDefault();return}};#handleContentClick=event=>{this.details.open&&event.target.closest("[data-accordion-close]")&&(this.summary.focus({preventScroll:!0}),this.details.open=!1)};#handleMediaQueryChange=()=>{this.#setDefaultOpenState()};#setDefaultOpenState(){const isMobile=isMobileBreakpoint();this.details.open=isMobile&&this.hasAttribute("open-by-default-on-mobile")||!isMobile&&this.hasAttribute("open-by-default-on-desktop")}#handleKeyDown(event){event.key==="Escape"&&this.#closeWithEscape&&(event.preventDefault(),this.summary.focus(),this.details.open=!1)}}customElements.get("accordion-custom")||customElements.define("accordion-custom",AccordionCustom); 2//# sourceMappingURL=/cdn/shop/t/3/assets/accordion-custom.js.map?v=105323356731531709191782122108
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.