PageSourceSearch

https://fantech.id/cdn/shop/t/10/assets/cart-drawer.js?v=117492237216706828011767075966

js fantech.id collected 2026-10-05 10:36:34 UTC 4,631 bytes, 2 lines download raw bytes

1class CartDrawer extends HTMLElement{constructor(){super(),this.addEventListener("keyup",evt=>evt.code==="Escape"&&this.close()),this.querySelector("#CartDrawer-Overlay").addEventListener("click",this.close.bind(this)),this.setHeaderCartIconAccessibility()}setHeaderCartIconAccessibility(){const cartLink=document.querySelector("#cart-icon-bubble");cartLink&&(cartLink.setAttribute("role","button"),cartLink.setAttribute("aria-haspopup","dialog"),cartLink.addEventListener("click",event=>{event.preventDefault(),this.open(cartLink)}),cartLink.addEventListener("keydown",event=>{event.code.toUpperCase()==="SPACE"&&(event.preventDefault(),this.open(cartLink))}))}open(triggeredBy){triggeredBy&&this.setActiveElement(triggeredBy);const cartDrawerNote=this.querySelector('[id^="Details-"] summary');cartDrawerNote&&!cartDrawerNote.hasAttribute("role")&&this.setSummaryAccessibility(cartDrawerNote),setTimeout(()=>{this.classList.add("animate","active")}),this.addEventListener("transitionend",()=>{const containerToTrapFocusOn=this.classList.contains("is-empty")?this.querySelector(".drawer__inner-empty"):document.getElementById("CartDrawer"),focusElement=this.querySelector(".drawer__inner")||this.querySelector(".drawer__close");trapFocus(containerToTrapFocusOn,focusElement)},{once:!0}),document.body.classList.add("overflow-hidden")}close(){this.classList.remove("active"),removeTrapFocus(this.activeElement),document.body.classList.remove("overflow-hidden")}setSummaryAccessibility(cartDrawerNote){cartDrawerNote.setAttribute("role","button"),cartDrawerNote.setAttribute("aria-expanded","false"),cartDrawerNote.nextElementSibling.getAttribute("id")&&cartDrawerNote.setAttribute("aria-controls",cartDrawerNote.nextElementSibling.id),cartDrawerNote.addEventListener("click",event=>{event.currentTarget.setAttribute("aria-expanded",!event.currentTarget.closest("details").hasAttribute("open"))}),cartDrawerNote.parentElement.addEventListener("keyup",onKeyUpEscape)}renderContents(parsedState){this.querySelector(".drawer__inner").classList.contains("is-empty")&&this.querySelector(".drawer__inner").classList.remove("is-empty"),this.productId=parsedState.id,this.classList.contains("is-empty")?fetch(`${window.routes.cart_url}?section_id=cart-drawer`).then(response=>response.text()).then(responseText=>{const html=new DOMParser().parseFromString(responseText,"text/html"),currentDrawerInner=this.querySelector(".drawer__inner"),newDrawerInner=html.querySelector(".drawer__inner");currentDrawerInner&&newDrawerInner&&(currentDrawerInner.innerHTML=newDrawerInner.innerHTML),this.classList.remove("is-empty"),setTimeout(()=>{this.querySelector("#CartDrawer-Overlay").addEventListener("click",this.close.bind(this)),this.open()})}):(this.getSectionsToRender().forEach(section=>{const sectionElement=section.selector?document.querySelector(section.selector):document.getElementById(section.id);if(!sectionElement)return;const sectionKey=section.section||section.id,sectionHTML=parsedState.sections&&parsedState.sections[sectionKey];sectionHTML&&(sectionElement.innerHTML=this.getSectionInnerHTML(sectionHTML,section.selector))}),setTimeout(()=>{this.querySelector("#CartDrawer-Overlay").addEventListener("click",this.close.bind(this)),this.open()})),typeof window.updateCartIconBubble=="function"&&window.updateCartIconBubble()}getSectionInnerHTML(html,selector=".shopify-section"){const parsed=new DOMParser().parseFromString(html,"text/html");let element=parsed.querySelector(selector);if(!element&&selector!==".shopify-section"){const section=parsed.querySelector(".shopify-section");section&&(element=section.querySelector(selector))}return element||(element=parsed.querySelector(".shopify-section")),element?element.innerHTML:""}getSectionsToRender(){return[{id:"cart-drawer",section:"cart-drawer",selector:"#CartDrawer"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:"#shopify-section-cart-icon-bubble"}]}getSectionDOM(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector)}setActiveElement(element){this.activeElement=element}}customElements.define("cart-drawer",CartDrawer);class CartDrawerItems extends CartItems{getSectionsToRender(){return[{id:"CartDrawer-CartItems",section:"cart-drawer",selector:"#CartDrawer-CartItems"},{id:"cart-drawer-footer",section:"cart-drawer",selector:".drawer__footer"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:"#shopify-section-cart-icon-bubble"}]}}customElements.define("cart-drawer-items",CartDrawerItems);
2//# sourceMappingURL=/cdn/shop/t/10/assets/cart-drawer.js.map?v=117492237216706828011767075966

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.