1class MiniCart extends HTMLElement{constructor(){super(),this.drawer=document.querySelector("cart-drawer"),new IntersectionObserver(this.handleIntersection.bind(this)).observe(this),this.addEventListener("click",event=>{event.target.closest(".close-cart-drawer button")&&(event.preventDefault(),this.close())})}handleIntersection(entries,observer){entries[0].isIntersecting&&(observer.unobserve(this),fetch(this.dataset.url).then(response=>response.text()).then(html=>{document.getElementById("mini-cart").innerHTML=this.getSectionInnerHTML(html,".shopify-section"),this.refreshFocusTrap()}).catch(e=>{console.error(e)}))}open(){if(this.drawer.querySelector("details").hasAttribute("open"))return;this.drawer.querySelector("summary").click(),setTimeout(()=>{setHeaderHeight()},250)}close(){if(!this.drawer.querySelector("details").hasAttribute("open"))return;this.drawer.querySelector("summary").click()}refreshFocusTrap(){const detailsElement=this.drawer.querySelector("details");if(!detailsElement||!detailsElement.hasAttribute("open"))return;const firstFocusable=this.querySelector('button, a[href], input:not([type=hidden]):enabled, select:enabled, textarea:enabled, [tabindex]:not([tabindex^="-"])');
1firstFocusable&&trapFocus(detailsElement,firstFocusable)}renderContents(parsedState){this.productId=parsedState.id,this.getSectionsToRender().forEach((section=>{document.getElementById(section.id).innerHTML=this.getSectionInnerHTML(parsedState.sections[section.id],section.selector)})),this.header&&this.header.reveal(),this.open(),this.refreshFocusTrap()}getSectionsToRender(){return[{id:"mini-cart",section:"mini-cart",selector:".shopify-section"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"}]}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}}customElements.define("mini-cart",MiniCart); 2//# sourceMappingURL=/cdn/shop/t/510/assets/cart-drawer.js.map?v=41221854580560271821788269880
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.