PageSourceSearch

https://hudabeauty.com/cdn/shop/t/339/assets/cart-notification.js?v=126021337146120685591790669444

js hudabeauty.com collected 2026-10-02 03:12:32 UTC 4,582 bytes, 2 lines download raw bytes

1class CartNotification extends HTMLElement{constructor(){super(),this.notification=document.getElementById("cart-notification"),this.backdrop=document.getElementById("cart-notification-backdrop"),this.header=document.querySelector("sticky-header"),this.notification.addEventListener("keyup",evt=>evt.code==="Escape"&&this.close()),this.querySelectorAll('button[type="button"]').forEach(btn=>btn.addEventListener("click",this.close.bind(this))),this.querySelectorAll("a[href]").forEach(link=>link.addEventListener("click",this.close.bind(this))),window.addEventListener("pageshow",e=>{e.persisted&&this.close()}),this.backdrop&&this.backdrop.addEventListener("click",this.close.bind(this));const cartIconLink=document.getElementById("cart-icon-bubble");cartIconLink&&cartIconLink.addEventListener("click",()=>{this.classList.contains("active")&&this.close()}),this._hovered=!1,this.notification.addEventListener("pointerenter",e=>{e.pointerType==="mouse"&&(this._hovered=!0)}),this.notification.addEventListener("pointerleave",e=>{e.pointerType==="mouse"&&(this._hovered=!1)})}_isHovered(){return this._hovered}_scheduleAutoClose(ms){this._autoCloseTimer&&clearTimeout(this._autoCloseTimer),this._autoCloseTimer=setTimeout(()=>{if(this._autoCloseTimer=null,this._isHovered()){this._scheduleAutoClose(1e3);return}this.close()},ms)}open(){this._autoCloseTimer&&clearTimeout(this._autoCloseTimer),this.classList.add("active"),this.notification.addEventListener("transitionend",()=>{this.notification.focus(),trapFocus(this.notification)},{once:!0}),this._scheduleAutoClose(5e3)}close(){this._autoCloseTimer&&(clearTimeout(this._autoCloseTimer),this._autoCloseTimer=null),this.classList.remove("active"),this._hovered=!1;const activeElement=document.activeElement;removeTrapFocus(),activeElement&&this.notification.contains(activeElement)&&activeElement?.blur()}renderContents(parsedState){this.cartItemKey=parsedState.key||parsedState.items&&parsedState.items.length&&parsedState.items[0].key||void 0,this.cartItemVariantId=parsedState.variant_id||parsedState.items&&parsedState.items.length&&parsedState.items[0].variant_id||void 0;const isCartPage=window.location.pathname.includes("/cart");if(isCartPage&&this.clearCartPageEmptyState(),this.getSectionsToRender().forEach(section=>{const el=document.getElementById(section.id);if(!el)return;const sectionKey=section.section||section.id,html=parsedState.sections&&parsedState.sections[sectionKey];if(html)if(isCartPage){const target=section.selector&&el.querySelector(section.selector)||el;target.innerHTML=this.getSectionInnerHTML(html,section.selector,section.fallbackSelector)}else el.innerHTML=this.getSectionInnerHTML(html,section.selector,section.fallbackSelector)}),!isCartPage){if(typeof window.__pdpInlineHeadingOverride=="string"&&window.__pdpInlineHeadingOverride){const headingEl=this.notification?.querySelector(".cart-notification__heading");headingEl&&(headingEl.textContent=window.__pdpInlineHeadingOverride)}window.__pdpInlineHeadingOverride=null,this.header&&this.header.reveal(),this.open()}}clearCartPageEmptyState(){document.querySelector("cart-items.cart-page")?.classList.remove("is-empty"),document.getElementById("main-cart-footer")?.classList.remove("is-empty"),document.getElementById("cart-page-milestone-progress")?.classList.remove("is-empty")}getSectionsToRender(){return window.location.pathname.includes("/cart")?[{id:"cart-page-milestone-progress",section:document.getElementById("cart-page-milestone-progress")?.dataset.id,selector:".progress-section"},{id:"cart-samples-gifts-tabs",section:document.getElementById("cart-samples-gifts-tabs")?.dataset.id,selector:".js-contents"},{id:"main-cart-items",section:document.getElementById("main-cart-items")?.dataset.id,selector:".js-contents"},{id:"main-cart-footer",section:document.getElementById("main-cart-footer")?.dataset.id,selector:".cart__footer"}].filter(s=>s.section):[{id:"cart-notification-product",selector:`[id="cart-notification-product-${this.cartItemKey}"]`,fallbackSelector:this.cartItemVariantId?`[data-cart-notification-variant-id="${this.cartItemVariantId}
1"]`:".cart-item"},{id:"cart-icon-bubble"}]}getSectionInnerHTML(html,selector=".shopify-section",fallbackSelector){const parsedHtml=new DOMParser().parseFromString(html,"text/html"),node=parsedHtml.querySelector(selector)||fallbackSelector&&parsedHtml.querySelector(fallbackSelector);return node?node.innerHTML:""}}customElements.define("cart-notification",CartNotification);
2//# sourceMappingURL=/cdn/shop/t/339/assets/cart-notification.js.map?v=126021337146120685591790669444

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.