PageSourceSearch

https://creedboutique.com/cdn/shop/t/1010/assets/component-header.js?v=58410752489069954141788785904

js creedboutique.com collected 2026-09-24 21:23:58 UTC 3,095 bytes, 5 lines download raw bytes

1import{LitElement,html,utils}from"@hh/global.js";const{getCart,addToCart,updateCart,reRenderShopifySections}=utils;class HHHeader extends LitElement{constructor(){super()}connectedCallback(){super.connectedCallback(),window.addEventListener("mini-cart:toggle",this.toggleCart.bind(this)),window.addEventListener("cart:changed",this.validateGwp.bind(this)),this.menuButtons=this.querySelectorAll(".js-menu-button"),this.menuButtons.forEach(button=>{button.addEventListener("mouseover",this.handleMouseOver.bind(this))}),this.checkGwp()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mini-cart:toggle",this.toggleCart),window.removeEventListener("cart:changed",this.validateGwp),this.menuButtons.forEach(button=>{button.removeEventListener("mouseover",this.handleMouseOver)})}handleMouseOver(e){this.dispatchEvent(new CustomEvent("triggerMegaMenu",{bubbles:!0,detail:{mouseoverEvent:e}}))}closeOpenModals(e){utils.all("hh-details-modal",this).map(element=>{element!==e.detail.value&&element.setAttribute("open",!1)})}toggleCart(e){e?.detail?.event?.preventDefault(),utils.toggle(document.body,["mini-cart-is-visible"]),setTimeout(()=>{utils.toggle(document.querySelector("html"),["overflow-hidden"]),utils.toggle(document.body,["mini-cart-is-active"]),utils.toggle(document.querySelector(".js-mega-menu-overlay"),["active"])})}async checkGwp(){const cart=await getCart();this.validateGwp({detail:{cart}})}async validateGwp(event){if(!window.gwp.enabled)return;const{items,items_subtotal_price:subTotal}=event.detail.cart;let cart;const updates={},discountsByAmounts=window.gwp.discounts.filter(discount=>discount.minimums==="minimum-purchase-amt"&&subTotal>=discount.minPurchaseAmount*100);items.filter(item=>!!item.properties?._gwp).filter(item=>{const appliedDiscount=discountsByAmounts.find(discount=>discount.id===item.properties._gwp);return!(appliedDiscount?.id==item.properties._gwp&&item.quantity===appliedDiscount.giftQuantity)}).map(item=>updates[item.key]=0);let itemsToAdd=discountsByAmounts.map(discount=>{const itemInCart=items.find(item=>item.properties?._gwp===discount.id);return{id:discount.giftId,quantity:discount.giftQuantity-(itemInCart?.quantity||0),properties:{_gwp:discount.id}}}).filter(item=>item.quantity>0);if(window.gwp.disableAutoAdd){const removedItems=(sessionStorage.getItem("removedGWP")||"").split(",").filter(item=>!!item).map(item=>+item);itemsToAdd=itemsToAdd.filter(item=>!removedItems.includes(item.properties._gwp))}const sections=document.querySelector("#inline-cart")?.dataset?.id?`${document.querySelector("#inline-cart")?.dataset?.id},header`:"mini-cart,header";Object.keys(updates).length>0&&(cart=await updateCart({updates,sections})),itemsToAdd.length>0&&(cart=await addToCart({items:itemsToAdd,sections})),cart&&reRenderShopifySections(cart)}render(){return html`<slot
2      @modalOpened="${this.closeOpenModals}"
3      @toggleCart="${this.toggleCart}"
4    ></slot>`}}customElements.define("hh-header",HHHeader);
5//# sourceMappingURL=/cdn/shop/t/1010/assets/component-header.js.map?v=58410752489069954141788785904

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.