PageSourceSearch

https://www.lazylama.nl/cdn/shop/t/4/assets/cart-icon.js?v=109428858171217037751788263644

js lazylama.nl collected 2026-10-07 18:56:02 UTC 2,405 bytes, 2 lines download raw bytes

1import{Component}from"@theme/component";import{onAnimationEnd}from"@theme/utilities";import"@theme/events";import{StandardEvents}from"@shopify/events";class CartIcon extends Component{requiredRefs=["cartBubble","cartBubbleText","cartBubbleCount"];get currentCartCount(){return parseInt(this.refs.cartBubbleCount.textContent??"0",10)}set currentCartCount(value){this.refs.cartBubbleCount.textContent=value<100?String(value):""}connectedCallback(){super.connectedCallback(),document.addEventListener(StandardEvents.cartLinesUpdate,this.onCartUpdate),window.addEventListener("pageshow",this.onPageShow),this.ensureCartBubbleIsCorrect()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(StandardEvents.cartLinesUpdate,this.onCartUpdate),window.removeEventListener("pageshow",this.onPageShow)}onPageShow=event=>{event.persisted&&this.ensureCartBubbleIsCorrect()};onCartUpdate=event=>{event.promise?.then(({cart,detail})=>{const itemCount=cart?.totalQuantity??detail?.itemCount??0;this.renderCartBubble(itemCount)}).catch(error=>{error?.name!=="AbortError"&&console.warn("[cart-icon] Event promise rejected:",error)})};renderCartBubble=async(itemCount,animate=!0)=>{this.refs.cartBubbleCount.classList.toggle("hidden",itemCount===0),this.refs.cartBubble.classList.toggle("visually-hidden",itemCount===0),this.currentCartCount=itemCount,this.classList.toggle("header-actions__cart-icon--has-cart",itemCount>0),sessionStorage.setItem("cart-count",JSON.stringify({value:String(this.currentCartCount),timestamp:Date.now()})),!(!animate||itemCount===0)&&(await new Promise(resolve=>requestAnimationFrame(resolve)),this.refs.cartBubble.classList.add("cart-bubble--animating"),await onAnimationEnd(this.refs.cartBubbleText),this.refs.cartBubble.classList.remove("cart-bubble--animating"))};ensureCartBubbleIsCorrect=()=>{if(!this.refs.cartBubbleCount)return;const sessionStorageCount=sessionStorage.getItem("cart-count");if(sessionStorageCount===null)return;const visibleCount=this.refs.cartBubbleCount.textContent;try{const{value,timestamp}=JSON.parse(sessionStorageCount);if(value===visibleCount)return;if(Date.now()-timestamp<1e4){const count=parseInt(value,10);count>=0&&this.renderCartBubble(count,!1)}}catch{}}}customElements.get("cart-icon")||customElements.define("cart-icon",CartIcon);
2//# sourceMappingURL=/cdn/shop/t/4/assets/cart-icon.js.map?v=109428858171217037751788263644

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.