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.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"),document.body.classList.add("slide-cart-active"),Kameleoon.API.Events.trigger("slideCartOpened");var script=document.createElement("script");script.src="//widget.reviews.io/modern-widgets/nuggets.js",document.head.appendChild(script)}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.getSectionsToRender().forEach(section=>{const sectionElement=section.selector?document.querySelector(section.selector):document.getElementById(section.id);sectionElement.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.id],section.selector)}),setTimeout(()=>{this.querySelector("#CartDrawer-Overlay").addEventListener("click",this.close.bind(this)),this.open()})}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}getSectionsToRender(){return[{id:"cart-drawer",selector:"#CartDrawer"},{id:"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",section:"cart-drawer",selector:".drawer__inner"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"}]}}customElements.define("cart-drawer-items",CartDrawerItems);class CartItemConvert extends HTMLElement{constructor(){super(),this.querySelector("a").addEventListener("click",this.convert.bind(this)),this.cart=document.querySelector("cart-notification")||document.querySelector("cart-drawer")}convert(e){e.preventDefault();const{type,cartItem,sellingPlan}=this.dataset;console.log(type,cartItem,sellingPlan);const config=fetchConfig("javascript");config.headers["X-Requested-With"]="XMLHttpRequest",config.body=JSON.stringify({id:cartItem,quantity:this.parentNode.parentNode.querySelector(".quantity__input").value,selling_plan:type=="subscription"?sellingPlan:null,sections:this.cart.getSectionsToRender().map(section=>section.id),sections_url:window.location.pathname}
1),fetch(window.routes.cart_change_url,config).then(response=>response.json()).then(response=>{this.cart.renderContents(response)})}}customElements.define("cart-item-convert",CartItemConvert);class GiftWrapper extends HTMLElement{constructor(){super(),this.querySelector("#gift-cta").addEventListener("click",this.addGift.bind(this)),this.cart=document.querySelector("cart-notification")||document.querySelector("cart-drawer")}addGift(e){e.preventDefault();const giftProductConfig=fetchConfig("javascript");giftProductConfig.headers["X-Requested-With"]="XMLHttpRequest",giftProductConfig.body=JSON.stringify({items:[{id:48705950515548,quantity:1,properties:{_free_gift:!0,_free_flyer:["20240117_Flyer_KijimeaLiquid",1]}}],sections:this.cart.getSectionsToRender().map(section=>section.id),sections_url:window.location.pathname}),fetch(`${routes.cart_add_url}`,giftProductConfig).then(res=>res.json()).then(newresponse=>{this.hasAttribute("data-disable-cart")?(document.querySelector("#cart-icon-bubble").innerHTML=this.cart.getSectionInnerHTML(newresponse.sections["cart-icon-bubble"]),document.querySelector("#CartDrawer").innerHTML=this.cart.getSectionInnerHTML(newresponse.sections["cart-drawer"],"#CartDrawer")):this.cart.renderContents(newresponse)})}}customElements.define("gift-wrapper",GiftWrapper); 2//# sourceMappingURL=/cdn/shop/t/37/assets/cart-drawer.js.map?v=165854178738545213911756909728
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.