PageSourceSearch

https://georgetowncupcake.com/cdn/shop/t/5/assets/purchase-blocking-popup.js?v=150430832903943341841763799245

js georgetowncupcake.com collected 2026-09-24 18:15:56 UTC 2,355 bytes, 2 lines download raw bytes

1import{CartAddEvent,CartErrorEvent,CartUpdateEvent}from"@theme/events";class PurchaseBlockingPopup extends HTMLElement{constructor(){super(),this.init()}init(){this.initEvents()}initEvents(){document.addEventListener("open-purchase-blocking-popup",()=>this.open()),this.querySelectorAll(".js-close-popup").forEach(btn=>btn.addEventListener("click",()=>this.close())),this.querySelector(".js-cart-clear")?.addEventListener("click",()=>this.clearCart()),this.querySelector(".popup__background")?.addEventListener("click",e=>{e.target===this.querySelector(".popup__background")&&this.close()})}clearCart(){this.dataset.cartType==="local"&&(localStorage.removeItem("delivery-location"),localStorage.removeItem("delivery-type"),localStorage.removeItem("delivery-time")),fetch("/cart/clear.js",{method:"POST",headers:{"Content-Type":"application/json"}}).then(response=>response.json()).then(response=>{if(response.status)this.dispatchEvent(new CartErrorEvent("cart-clear",response.message,response.description,response.errors));else{const sectionsToUpdate=document.getElementById("header-component")?.dataset.sectionId?document.getElementById("header-component")?.dataset.sectionId:"";fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:{activeType:null},sections:sectionsToUpdate,sections_url:window.location.pathname})}).then(response2=>response2.json()).then(response2=>{if(response2.status)this.dispatchEvent(new CartErrorEvent("cart-attributes-clear",response2.message,response2.description,response2.errors));else{const newCartHiddenItemCount=new DOMParser().parseFromString(response2.sections[sectionsToUpdate],"text/html").querySelector('[ref="cartItemCount"]')?.textContent,newCartItemCount=newCartHiddenItemCount?parseInt(newCartHiddenItemCount,10):0;this.dispatchEvent(new CartUpdateEvent({},sectionsToUpdate,{itemCount:newCartItemCount,source:"cart-items-component",sections:response2.sections})),this.close(),document.querySelector("[data-cart-type]")?.setAttribute("data-cart-type",""),self.dispatchEvent(new CartAddEvent)}})}})}open(){this.style.display="block"}close(){this.style.display="none"}}window.customElements.define("purchase-blocking-popup",PurchaseBlockingPopup);
2//# sourceMappingURL=/cdn/shop/t/5/assets/purchase-blocking-popup.js.map?v=150430832903943341841763799245

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.