1class CartDrawer extends HTMLElement{constructor(){super(),this.addEventListener("keyup",e=>"Escape"===e.code&&this.close()),this.querySelector("#CartDrawer-Overlay").addEventListener("click",this.close.bind(this)),this.setHeaderCartIconAccessibility()}setHeaderCartIconAccessibility(){const t=document.querySelector("#cart-icon-bubble");t?.setAttribute("role","button"),t?.setAttribute("aria-haspopup","dialog"),t?.addEventListener("click",e=>{e.preventDefault(),this.open(t)}),t?.addEventListener("keydown",e=>{"SPACE"===e.code.toUpperCase()&&(e.preventDefault(),this.open(t))})}open(e){e&&this.setActiveElement(e);e=this.querySelector('[id^="Details-"] summary');e&&!e.hasAttribute("role")&&this.setSummaryAccessibility(e),setTimeout(()=>{this.classList.add("animate","active")}),this.addEventListener("transitionend",()=>{var e=this.classList.contains("is-empty")?this.querySelector(".drawer__inner-empty"):document.getElementById("CartDrawer"),t=this.querySelector(".drawer__inner")||this.querySelector(".drawer__close");trapFocus(e,t)},{once:!0}),document.body.classList.add("overflow-hidden")}close(){this.classList.remove("active"),removeTrapFocus(this.activeElement),document.body.classList.remove("overflow-hidden")}setSummaryAccessibility(e){e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),e.nextElementSibling.getAttribute("id")&&e.setAttribute("aria-controls",e.nextElementSibling.id),e.addEventListener("click",e=>{e.currentTarget.setAttribute("aria-expanded",!e.currentTarget.closest("details").hasAttribute("open"))}),e.parentElement.addEventListener("keyup",onKeyUpEscape)}renderContents(t){this.querySelector(".drawer__inner").classList.contains("is-empty")&&this.querySelector(".drawer__inner").classList.remove("is-empty"),this.productId=t.id,this.getSectionsToRender().forEach(e=>{(e.selector?document.querySelector(e.selector):document.getElementById(e.id)).innerHTML=this.getSectionInnerHTML(t.sections[e.id],e.selector)}),setTimeout(()=>{this.querySelector("#CartDrawer-Overlay").addEventListener("click",this.close.bind(this)),this.open()})}getSectionInnerHTML(e,t=".shopify-section"){return(new DOMParser).parseFromString(e,"text/html").querySelector(t).innerHTML}getSectionsToRender(){return[{id:"cart-drawer",selector:"#CartDrawer"},{id:"cart-icon-bubble"}]}getSectionDOM(e,t=".shopify-section"){return(new DOMParser).parseFromString(e,"text/html").querySelector(t)}setActiveElement(e){this.activeElement=e}}customElements.define("cart-drawer",CartDrawer);class CartDrawerItems extends CartItems{getSectionsToRender(){return[{id:"CartDrawer",section:"cart-drawer",selector:".drawer__inner"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"}]}}customElements.define("cart-drawer-items",CartDrawerItems);
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.