1(function(){"use strict";function unwrapTab(tabItem){if(tabItem){var tmpl=tabItem.querySelector("template");tmpl&&tmpl.content&&(tabItem.appendChild(tmpl.content.cloneNode(!0)),tmpl.remove())}}document.addEventListener("click",function(e){var btn=e.target.closest('hdt-tab[aria-controls="tab-mobile-custom"] button');if(btn){var tabGroup=document.getElementById("tab-mobile-custom");if(tabGroup){var buttons=Array.from(btn.closest("hdt-tab").querySelectorAll("button")),idx=buttons.indexOf(btn);if(idx!==-1){var tabItems=tabGroup.querySelectorAll(":scope > .hdt-tab-item");tabItems[idx]&&unwrapTab(tabItems[idx])}}}},{capture:!0});function formatCartMoney(cents){try{var fmt=window.themeHDN&&window.themeHDN.settings&&window.themeHDN.settings.moneyFormat?window.themeHDN.settings.moneyFormat:"${{amount}}";return fmt.replace(/\{\{\s*amount[\w]*\s*\}\}/,(cents/100).toFixed(2))}catch(e){return"$"+(cents/100).toFixed(2)}}function updateBadge(n,totalFormatted){var hdtCart=document.querySelector("hdt-cart-drawer");hdtCart&&hdtCart.setAttribute("data-count",n),document.querySelectorAll("hdt-cart-count").forEach(function(el){el.textContent=n,el.style.display=n>0?"":"none",n>0&&el.removeAttribute("hidden")}),totalFormatted&&document.querySelectorAll("hdt-cart-total").forEach(function(el){el.textContent=totalFormatted}),[".hdt-mini-cart__count",".hdt-header__cart-count","[data-cart-count]","[data-header-cart-count]","#cart-icon-bubble",".cart-count-bubble span",".t4s-cart-count",".t4s-cart-icon__count"].forEach(function(s){document.querySelectorAll(s).forEach(function(el){el.textContent=n,n>0&&(el.removeAttribute("hidden"),el.style.display="")})})}function openHDTCart(){var hdtCart=document.querySelector("hdt-cart-drawer");if(hdtCart&&typeof hdtCart.open=="function"){hdtCart.open();return}for(var triggers=['[aria-controls="CartDrawer"]',"[data-cart-drawer-trigger]",".hdt-header__cart",".hdt-header__icon--cart","button[data-cart]",'a[href="/cart"].hdt-header__icon',".t4s-site-nav__cart > a","[data-t4s-open-quickcart]","[data-open-quickcart]",".t4s-cart-icon a"],i=0;i<triggers.length;i++){var el=document.querySelector(triggers[i]);if(el&&!el.closest("#CartDrawer")&&!el.closest("hdt-cart-drawer")){el.click();return}}document.dispatchEvent(new CustomEvent("hdt:cart:open",{bubbles:!0}))}function refreshCart(){fetch("/cart.js",{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(function(r){return r.json()}).then(function(cart){updateBadge(cart.item_count,formatCartMoney(cart.total_price));var hdtCart=document.querySelector("hdt-cart-drawer");if(!hdtCart){openHDTCart();return}if(typeof hdtCart.renderContents=="function"){hdtCart.renderContents(),openHDTCart();return}if(typeof hdtCart.refresh=="function"){hdtCart.refresh(),openHDTCart();return}var sectionId=hdtCart.getAttribute("section-id")||"cart-drawer";fetch("/?sections="+sectionId,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(function(r){return r.json()}).then(function(data){var html=data[sectionId];if(html){var doc=new DOMParser().parseFromString(html,"text/html"),fresh=doc.querySelector("cart-items-component"),live=document.querySelector("cart-items-component");fresh&&live&&live.replaceWith(fresh)}openHDTCart()}).catch(function(){openHDTCart()})}).catch(function(){openHDTCart()})}var _compInFlight={};function doCompATC(variantId,card){if(!_compInFlight[variantId]){_compInFlight[variantId]=!0;var btn=card?card.querySelector(".hdt-complementary-atc-btn"):null,spinner=btn?btn.querySelector(".hdt-loading__spinner"):null,icon=btn?btn.querySelector(".hdt-complementary-atc-icon"):null,iconSuccess=btn?btn.querySelector(".hdt-complementary-atc-icon--success"):null;btn&&(btn.disabled=!0,btn.setAttribute("data-loading","true")),spinner&&spinner.removeAttribute("hidden"),icon&&icon.setAttribute("hidden","");var routesRoot=window.Shopify&&window.Shopify.routes&&window.Shopify.routes.root||"/";fetch(routesRoot+"cart/add.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({id:variantId,quantity:1})}).then(function(r){return r.json().then(function(d){return{ok:r.ok,data:d}})}).then(function(result){delete _compInFlight[variantId],spinner&&spinner.setAttribute("hidden",""),result.ok?(iconSuccess&&iconSuccess.removeAttribute("hidden"),refreshCart(),setTimeout(function(){var slide=card?card.closest(".hdt-slider__slide")||card:null;slide&&slide.remove()},800)):(btn&&(btn.disabled=!1,btn.removeAttribute("data-loading")),icon&&icon.removeAttribute("hidden"),iconSuccess&&iconSuccess.setAttribute("hidden",""),console.warn("[Complementary ATC] Failed:",result.data.description||result.data.message))}).catch(function(err){delete _compInFlight[variantId],spinner&&spinner.setAttribute("hidden",""),btn&&(btn.disabled=!1,btn.removeAttribute("data-loading")),icon&&icon.removeAttribute("hidden"),iconSuccess&&iconSuccess.setAttribute("hidden",""),console.error("[Complementary ATC] Network error:",err)})}}document.addEventListener("click",function(e){var el=e.target.closest("[data-complementary-atc]");if(el){e.preventDefault(),e.stopPropagation();var variantId=el.getAttribute("data-variant-id"),isAvailable=el.getAttribute("data-available");if(!(!variantId||isAvailable==="false")){var card=el.closest(".hdt-minicart-recommendations__item");if(card){var btn=card.querySelector(".hdt-complementary-atc-btn");btn&&btn.getAttribute("data-loading")||doCompATC(variantId,card)}}}},!0);function initUrgencyTimers(){document.querySelectorAll(".tb-offer-timer").forEach(function(wrap){if(wrap._tbTimerInit)return;wrap._tbTimerInit=!0;var duration=parseInt(wrap.dataset.duration)||0,remaining=duration;function updateTimer(){remaining<=0&&(remaining=duration);var days=Math.floor(remaining/86400),hours=Math.floor(remaining%86400/3600),minutes=Math.floor(remaining%3600/60),seconds=remaining%60,dEl=wrap.querySelector("[data-days]"),hEl=wrap.querySelector("[data-hours]"),mEl=wrap.querySelector("[data-minutes]"),sEl=wrap.querySelector("[data-seconds]");dEl&&(dEl.innerHTML=String(days).padStart(2,"0")),hEl&&(hEl.innerHTML=String(hours).padStart(2,"0")),mEl&&(mEl.innerHTML=String(minutes).padStart(2,"0")),sEl&&(sEl.innerHTML=String(seconds).padStart(2,"0")),remaining--}updateTimer(),setInterval(updateTimer,1e3)})}document.addEventListener("click",function(e){var offer=e.target.closest(".tb-
1offer");if(offer){var code=offer.dataset.code;code&&navigator.clipboard&&(navigator.clipboard.writeText(code),offer.classList.add("copied"),setTimeout(function(){offer.classList.remove("copied")},1200))}}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initUrgencyTimers):initUrgencyTimers();var _gbaInFlight={};document.addEventListener("click",function(e){var btn=e.target.closest(".gba-atc");if(!(!btn||btn.getAttribute("data-loading")==="true")){var vid=btn.dataset.vid;if(vid&&(e.preventDefault(),e.stopPropagation(),!_gbaInFlight[vid])){_gbaInFlight[vid]=!0,btn.setAttribute("data-loading","true"),btn.classList.add("loading");var txtEl=btn.querySelector(".gba-atc-txt")||btn.querySelector(".hdt-truncate"),origTxt=btn.getAttribute("data-orig-txt")||(txtEl?txtEl.textContent:"");txtEl&&(btn.getAttribute("data-orig-txt")||btn.setAttribute("data-orig-txt",origTxt),txtEl.textContent="Adding\u2026");var routesRoot=window.Shopify&&window.Shopify.routes&&window.Shopify.routes.root||"/";fetch(routesRoot+"cart/add.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({id:parseInt(vid),quantity:1})}).then(function(r){return r.ok?r.json():r.json().then(function(d){throw new Error(d.description||"Error")})}).then(function(){delete _gbaInFlight[vid],btn.classList.remove("loading"),btn.classList.add("ok"),txtEl&&(txtEl.textContent="\u2713 Added!"),refreshCart(),setTimeout(function(){btn.removeAttribute("data-loading"),btn.classList.remove("ok"),txtEl&&(txtEl.textContent=btn.getAttribute("data-orig-txt")||"Add to Cart")},2e3)}).catch(function(err){delete _gbaInFlight[vid],btn.removeAttribute("data-loading"),btn.classList.remove("loading"),txtEl&&(txtEl.textContent=btn.getAttribute("data-orig-txt")||"Add to Cart"),alert(err.message||"Could not add item.")})}}},!0)})(); 2//# sourceMappingURL=/cdn/shop/t/379/assets/tb-custom.js.map?v=43304001325691132051787565593
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.