PageSourceSearch

https://lunesi.co.uk/cdn/shop/t/107/assets/tracking.js?v=180990530816674699501790793230

js lunesi.co.uk collected 2026-10-06 04:50:01 UTC 4,268 bytes, 2 lines download raw bytes

1document.addEventListener("DOMContentLoaded",function(){document.addEventListener("click",function(e){const removeLink=e.target.closest('a[href*="/cart/change"][href*="quantity=0"]');if(removeLink){const variantIdMatch=removeLink.getAttribute("href").match(/id=([^:&]+)/),variantId=variantIdMatch?variantIdMatch[1]:"unknown",ariaLabel=removeLink.getAttribute("aria-label"),productName=ariaLabel?ariaLabel.replace("Remove ",""):"Unknown Product";fetch("/cart.js").then(response=>response.json()).then(cart=>{const cartItem=cart.items.find(item=>item.variant_id==variantId);window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"remove_from_cart",ecommerce:{items:[{item_name:cartItem?cartItem.product_title:productName,item_id:variantId,price:cartItem?(cartItem.price/100).toFixed(2):"0.00",currency:cart.currency,item_brand:cartItem?cartItem.vendor:"Unknown",item_category:cartItem?cartItem.product_type:"Unknown",quantity:cartItem?cartItem.quantity:1}]}})})}})}),document.addEventListener("DOMContentLoaded",function(){(window.location.pathname.includes("/checkout")||window.location.pathname.includes("/cart"))&&document.addEventListener("change",function(e){if(e.target.type==="radio"&&(e.target.name==="checkout[shipping_rate][id]"||e.target.name.includes("shipping"))){const shippingMethod=e.target.closest("label")?.textContent?.trim()||"Standard";fetch("/cart.js").then(response=>response.json()).then(cart=>{const items=cart.items.map(item=>({item_name:item.product_title,item_id:item.variant_id,price:(item.price/100).toFixed(2),currency:cart.currency,item_brand:item.vendor||"Unknown",item_category:item.product_type||"Unknown",quantity:item.quantity}));window.dataLayer.push({event:"add_shipping_info",ecommerce:{shipping_tier:shippingMethod,items}})})}})}),document.addEventListener("DOMContentLoaded",function(){document.addEventListener("click",function(e){(e.target.closest("[data-shopify-buttonpay]")||e.target.closest(".shopify-payment-button")||e.target.textContent.toLowerCase().includes("shop pay"))&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"express_shoppay"})),(e.target.closest("[data-google-pay]")||e.target.closest(".google-pay-button")||e.target.textContent.toLowerCase().includes("google pay")||e.target.textContent.toLowerCase().includes("g pay"))&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"express_gpay"}))})}),document.addEventListener("DOMContentLoaded",function(){document.addEventListener("submit",function(e){const form=e.target;form.querySelector('input[type="email"]')&&(form.action.includes("customer")||form.querySelector('[name*="email"]')||form.classList.contains("newsletter")||form.id.includes("newsletter"))&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"submit_subscription_form"}))})});function applyGiftVisibility(){const giftSection=document.querySelector(".mini-cart__gift-section");giftSection&&(localStorage.getItem("giftHidden")==="true"?giftSection.style.display="none":giftSection.style.display="")}function observeMiniCart(){const miniCart=document.querySelector("mini-cart");if(!miniCart)return;new MutationObserver(applyGiftVisibility).observe(miniCart,{childList:!0,subtree:!0})}document.addEventListener("DOMContentLoaded",function(){observeMiniCart(),applyGiftVisibility()}),document.body.addEventListener("cart:updated",applyGiftVisibility),window.toggleGiftSection=function(hide){localStorage.setItem("giftHidden",hide?"true":"false"),applyGiftVisibility()},(function(){function updateCartCount(){fetch("/cart.js").then(res=>res.json()).then(cart=>{const cartTrigger=document.getElementById("desktop-cart-trigger");if(cartTrigger){const label=cartTrigger.dataset.cartLabel||"CART";cartTrigger.innerHTML=`${label} (${cart.item_count})`}}).catch(()=>{})}document.addEventListener("DOMContentLoaded",updateCartCount);const originalFetch=window.fetch;window.fetch=function(){return originalFetch.apply(this,arguments).then(response=>{try{const url=response.url;(url.includes("/cart/add")||url.includes("/cart/change")||url.includes("/cart/update")||url.includes("/cart/clear"))&&updateCartCount()}catch{}return response})}})();
2//# sourceMappingURL=/cdn/shop/t/107/assets/tracking.js.map?v=180990530816674699501790793230

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.