PageSourceSearch

https://coldest.com/cdn/shop/t/237/assets/coldest-phase2-fixes.js?v=90857281882137308831790640341

js coldest.com collected 2026-10-01 12:27:30 UTC 40,862 bytes, 2 lines download raw bytes

1(function(){"use strict";function e(e2,n2,o){fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e2,quantity:n2})}).then(function(e3){return e3.json()}).then(function(e3){if(document.querySelectorAll(".cart-count, .header-cart-count, [data-cart-count], .cart-link__count").forEach(function(t2){t2.textContent=e3.item_count}),n2!==0&&e3.item_count!==0){var o2=document.querySelector("[data-ajax-update]");o2?fetch("/cart?view=ajax",{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(function(e4){return e4.text()}).then(function(e4){var n3=new DOMParser().parseFromString(e4,"text/html").querySelector("[data-ajax-update]");n3&&o2&&(o2.innerHTML=n3.innerHTML,setTimeout(t,100))}).catch(function(){location.reload()}):location.reload()}else location.reload()}).catch(function(){location.reload()})}function t(){document.querySelectorAll('input[aria-label="Quantity"], input[name="updates[]"], input.cart-item__quantity-input').forEach(function(t2){if(!t2.dataset.stepperEnhanced){t2.dataset.stepperEnhanced="true";var n2=t2.closest("tr")||t2.closest(".cart-item")||t2.closest("[data-line]");if(n2){var o=(function(e2){for(var t3=e2.querySelectorAll('a[href*="cart/change"]'),n3=0;n3<t3.length;n3++){var o2=t3[n3].href.match(/id=([^&]+)/);if(o2)return o2[1]}var r2=e2.querySelector("[data-key]");if(r2)return r2.getAttribute("data-key");var a2=e2.querySelector('a.remove, a[href*="cart/change"][href*="quantity=0"]');if(a2){var i2=a2.href.match(/id=([^&]+)/);if(i2)return i2[1]}return null})(n2);if(o){var r=n2.querySelector(".quantity-down, .p2-qty-down"),a=n2.querySelector(".quantity-up, .p2-qty-up");if(!r){var i=document.createElement("button");i.type="button",i.className="p2-qty-down",i.setAttribute("aria-label","Decrease quantity"),i.textContent="\u2212",i.style.cssText="width:36px;height:36px;border:1px solid #ddd;background:#f7f7f7;font-size:18px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:4px 0 0 4px;line-height:1;color:#333;",i.addEventListener("click",function(n3){n3.preventDefault();var r2=parseInt(t2.value)||1,a2=Math.max(0,r2-1);t2.value=a2,e(o,a2)}),t2.parentNode.insertBefore(i,t2)}if(!a){var c=document.createElement("button");c.type="button",c.className="p2-qty-up",c.setAttribute("aria-label","Increase quantity"),c.textContent="+",c.style.cssText="width:36px;height:36px;border:1px solid #ddd;background:#f7f7f7;font-size:18px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:0 4px 4px 0;line-height:1;color:#333;",c.addEventListener("click",function(n3){n3.preventDefault();var r2=(parseInt(t2.value)||1)+1;t2.value=r2,e(o,r2)}),t2.nextSibling?t2.parentNode.insertBefore(c,t2.nextSibling):t2.parentNode.appendChild(c)}t2.style.cssText+="width:44px;height:36px;text-align:center;border:1px solid #ddd;border-left:none;border-right:none;font-size:15px;font-weight:600;-moz-appearance:textfield;border-radius:0;",n2.querySelectorAll('a[href*="cart/change"]').forEach(function(e2){e2.href.indexOf("quantity=0")!==-1||e2.textContent.toLowerCase().includes("remove")||e2.classList.contains("quantity-up")||e2.classList.contains("quantity-down")||(e2.style.display="none")}),t2.addEventListener("change",function(){var n3=parseInt(t2.value)||1;n3=Math.max(0,n3),t2.value=n3,e(o,n3)})}}}})}function n(){if(window.location.pathname==="/cart"){t(),setTimeout(t,500),setTimeout(t,1500),setTimeout(t,3e3);var e2=new MutationObserver(function(){t()}),n2=document.querySelector('[data-section-type="cart-template"], .cart
1-form, main, #main-content');n2&&e2.observe(n2,{childList:!0,subtree:!0})}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n):n()})(),(function(){"use strict";function e(){try{for(var e2=document.querySelectorAll('script[type="application/json"]'),t2=0;t2<e2.length;t2++)try{var n2=JSON.parse(e2[t2].textContent);if(n2&&n2.variants&&n2.variants.length>10){var o2={};n2.variants.forEach(function(e3){e3.available&&e3.option1&&(o2[e3.option1]=!0)});var r=Object.keys(o2).length;if(r>0)return r}}catch{}}catch{}return 0}function t(e2,t2,n2,o2){var r=document.createElement("button");return r.type="button",r.className="p3-swatch-toggle",r.textContent="SHOW ALL "+t2+" COLORS \u25BE",r.addEventListener("click",function(){e2.classList.contains(o2)?(e2.classList.remove(o2),e2.classList.add(n2),r.textContent="SHOW ALL "+t2+" COLORS \u25BE"):(e2.classList.remove(n2),e2.classList.add(o2),r.textContent="SHOW LESS \u25B4")}),r}function n(){window.innerWidth>767||document.querySelector(".p3-swatch-toggle")||(function(){var n2=document.querySelectorAll("ul.swatch-view");if(!n2.length)return!1;var o2=!1;return n2.forEach(function(n3){if(n3.offsetHeight!==0){var r=n3.querySelectorAll("li.swatch-view-item");if(!(r.length<10)&&n3.querySelector('img, .swatch-image, .swatch-image-wrapper, [class*="star-set-image"]')){var a=n3.parentElement;if(!a||!a.querySelector(".p3-swatch-toggle")){var i=0;r.forEach(function(e2){e2.offsetWidth>0&&e2.offsetHeight>0&&i++});var c=e()||i;if(!(c<=10)){n3.classList.add("p3-vsk-collapsed");var s=t(n3,c,"p3-vsk-collapsed","p3-vsk-expanded");n3.nextSibling?n3.parentNode.insertBefore(s,n3.nextSibling):n3.parentNode.appendChild(s),o2=!0}}}}}),o2})()||(function(){var n2=document.querySelectorAll('.option-selector[data-option-index="0"]');if(!n2.length)return!1;var o2=!1;return n2.forEach(function(n3){var r=n3.querySelector(".option-selector__btns");if(r){var a=r.closest(".option-selectors");if(a){var i=window.getComputedStyle(a);if(i.opacity==="0"||i.maxHeight==="0px"||i.display==="none")return}if(!n3.querySelector(".p3-swatch-toggle")){var c=e();if(c||(c=r.querySelectorAll(".opt-label").length),c||(c=r.querySelectorAll('input[type="radio"]').length),!(c<=10)){r.classList.add("p3-swatch-collapsed");var s=t(r,c,"p3-swatch-collapsed","p3-swatch-expanded");r.parentNode.insertBefore(s,r.nextSibling),a&&(a.style.maxHeight="none",a.style.overflow="visible"),o2=!0}}}}),o2})()||(function(){if(window.location.pathname.indexOf("/products/")===-1)return!1;var n2=document.querySelector('form[action*="/cart/add"], .product-form, .product-detail, [data-section-type*="product"], .shopify-section--product, .product-info, .product__info-container, #product-info');if(!n2){var o2=document.querySelector('button[name="add"], [data-add-to-cart], .add-to-cart, button[type="submit"][class*="add"]');o2&&(n2=o2.closest("form")||o2.closest("section")||o2.parentElement)}if(!n2)return!1;var r=null,a=0;if(n2.querySelectorAll("div, ul, fieldset").forEach(function(e2){if(!(e2.offsetHeight<60||e2.offsetWidth<150)){var t2=e2.querySelectorAll('li, label, [role="radio"], .swatch-view-item'),n3=0;t2.forEach(function(e3){if(e3.offsetHeight!==0&&e3.offsetWidth!==0){var t3=e3.querySelector("img");t3&&t3.offsetWidth>15&&t3.offsetWidth<150&&t3.offsetHeight>15&&t3.offsetHeight<150&&n3++}}),n3<15||(!r||e2.offsetHeight<r.offsetHeight)&&(r=e2,a=n3)}}),!r||r.querySelector(".p3-swatch-toggle"))return!1;var i=r.parentElement;if(i&&i.querySelector(".p3-swatch-toggle"))return!1;var c=e()||a;if(c<=10)return!1;r.classList.add("p3-vsk-collapsed");var s=t(r,c,"p3-vsk-collapsed","p3-vsk-expanded");r.nextSibling?r.parentNode.insertBefore(s,r.nextSibling):r.parentNode.appendChild(s)})()}function o(){document.addEventListener("keydown",function(e2){if(e2.key==="Escape"||e2.keyCode===27){if(document.body.classList.contains("reveal-mobile-nav")){var t2=document.querySelector('.mobile-nav-toggle, button[aria-label="Toggle menu"]');t2&&t2.click()}document.querySelectorAll(".drawer--open .drawer__close, .modal--open .modal__close").forEach(function(e3){e3.click()})}}),(function(){document.querySelectorAll(".navigation .has-dropdown > a, .navigation .has-submenu > a, .link-dropdown__button").forEach(function(e3){e3.getAttribute("aria-expanded")===null&&e3.setAttribute("aria-expanded","fal
1se"),e3.addEventListener("click",function(){var t2=e3.getAttribute("aria-expanded")==="true";e3.setAttribute("aria-expanded",String(!t2))})});var e2=document.querySelector(".navigation");e2&&new MutationObserver(function(e3){e3.forEach(function(e4){e4.addedNodes.forEach(function(e5){e5.nodeType===1&&(e5.querySelectorAll?e5.querySelectorAll(".has-dropdown > a, .has-submenu > a"):[]).forEach(function(e6){e6.getAttribute("aria-expanded")||e6.setAttribute("aria-expanded","false")})})})}).observe(e2,{childList:!0,subtree:!0})})(),(function(){var e2=document.createElement("button");e2.id="p3-back-to-top",e2.setAttribute("aria-label","Back to top"),e2.innerHTML="&#9650;",document.body.appendChild(e2);var t2=!1;function n2(){window.pageYOffset>600?e2.classList.add("visible"):e2.classList.remove("visible"),t2=!1}window.addEventListener("scroll",function(){t2||(requestAnimationFrame(n2),t2=!0)},{passive:!0}),e2.addEventListener("click",function(){window.scrollTo({top:0,behavior:"smooth"})})})(),setTimeout(n,1e3),setTimeout(n,3e3),setTimeout(n,5e3),setTimeout(n,8e3),new MutationObserver(function(e2){if(!document.querySelector(".p3-swatch-toggle"))for(var t2=0;t2<e2.length;t2++)for(var o2=e2[t2].addedNodes,r=0;r<o2.length;r++){var a=o2[r];if(a.nodeType===1){var i=(a.tagName||"").toUpperCase(),c=(a.className||"").toString();if(i==="VARIANT-SWATCH-KING"||c.indexOf("swatch-view")!==-1||c.indexOf("sa-variant-picker")!==-1||c.indexOf("swatch-preset")!==-1||a.querySelector&&(a.querySelector("ul.swatch-view")||a.querySelector(".swatch-view-item")||a.querySelector(".sa-variant-picker")))return setTimeout(n,300),setTimeout(n,1500),void setTimeout(n,3e3)}}}).observe(document.body,{childList:!0,subtree:!0})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",o):o()})(),(function(){"use strict";function e(){(function(){if(!(window.innerWidth>768)){var e2=document.querySelector(".announcement-bar__announcements");if(e2){var t=e2.querySelectorAll(".announcement");if(!(t.length<2)){var n=document.querySelector(".announcement-button--previous"),o=document.querySelector(".announcement-button--next"),r=document.querySelector(".announcement-bar__announcement-controller"),a=document.createElement("div");a.className="p4-announcement-dots";for(var i=0;i<t.length;i++){var c=document.createElement("button");c.className="p4-dot"+(i===0?" active":""),c.setAttribute("aria-label","Slide "+(i+1)),c.dataset.index=i,a.appendChild(c)}r&&r.parentNode&&r.parentNode.insertBefore(a,r.nextSibling),a.addEventListener("click",function(e3){var t2=e3.target.closest(".p4-dot");if(t2){var r2=parseInt(t2.dataset.index,10)-f();if(r2>0)for(var a2=0;a2<r2;a2++)o&&o.click();else if(r2<0)for(a2=0;a2<Math.abs(r2);a2++)n&&n.click();setTimeout(m,100)}});var s=0,u=0,d=!1,l=document.querySelector(".announcement-bar");if(l){l.addEventListener("touchstart",function(e3){s=e3.touches[0].clientX,u=e3.touches[0].clientY,d=!0},{passive:!0}),l.addEventListener("touchend",function(e3){if(d){d=!1;var t2=e3.changedTouches[0].clientX,r2=e3.changedTouches[0].clientY,a2=t2-s,i2=r2-u;Math.abs(a2)>40&&Math.abs(a2)>Math.abs(i2)&&(a2<0&&o?o.click():a2>0&&n&&n.click(),setTimeout(m,100))}},{passive:!0});var p=new MutationObserver(function(){m()});t.forEach(function(e3){p.observe(e3,{attributes:!0,attributeFilter:["class"]})}),m()}}}}function f(){for(var e3=0;e3<t.length;e3++)if(!t[e3].classList.contains("announcement--inactive"))return e3;return 0}function m(){var e3=f();a.querySelectorAll(".p4-dot").forEach(function(t2,n2){t2.classList.toggle("active",n2===e3)})}})(),(function(){function e2(e3){if(!e3.querySelector(".p4-privacy-disclaimer")){var t=e3.querySelector('button[type="submit"], [data-testid="form-component"] button'),n=e3.querySelector('input[type="email"], input[name="email"]'),o=t||n;if(o){var r=document.createElement("div");r.className="p4-privacy-disclaimer",r.innerHTML='By submitting, you agree to our <a href="/pages/private-policy" target="_blank">Privacy Policy</a> and <a href="/policies/terms-of-service" target="_blank">Terms of Service</a>.';var a=o.closest("[data-testid]")||o.parentElement||o;a.parentNode&&a.parentNode.insertBefore(r,a.nextSibling)}}}new MutationObserver(function(t){t.forEach(function(t2){t2.addedNodes.forEac
1h(function(t3){if(t3.nodeType===1){var n=[];t3.matches&&(t3.matches(".klaviyo-form")||t3.matches('[data-testid="klaviyo-form-component"]'))&&n.push(t3),t3.querySelectorAll&&t3.querySelectorAll('.klaviyo-form, [data-testid="klaviyo-form-component"]').forEach(function(e3){n.push(e3)}),n.forEach(function(t4){setTimeout(function(){e2(t4)},500),setTimeout(function(){e2(t4)},1500)})}})})}).observe(document.body,{childList:!0,subtree:!0}),setTimeout(function(){document.querySelectorAll('.klaviyo-form, [data-testid="klaviyo-form-component"]').forEach(e2)},2e3)})(),new MutationObserver(function(e2){e2.forEach(function(e3){e3.addedNodes.forEach(function(e4){if(e4.nodeType===1){var t=[];e4.querySelectorAll&&(t=e4.querySelectorAll('.klaviyo-form button[type="submit"], [data-testid="klaviyo-form-component"] button')),t.forEach(function(e5){e5.textContent.trim().toLowerCase()==="continue"&&(e5.textContent="CLAIM OFFER")})}})})}).observe(document.body,{childList:!0,subtree:!0}),setTimeout(function(){document.querySelectorAll('.klaviyo-form button[type="submit"], [data-testid="klaviyo-form-component"] button').forEach(function(e2){e2.textContent.trim().toLowerCase()==="continue"&&(e2.textContent="CLAIM OFFER")})},3e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()})(),(function(){"use strict";var e=window.location.pathname.indexOf("/products/")!==-1,t=!0;function n(){var e2=document.querySelector('.prices .money, .product-block__price .money, [class*="price--sale"] .money, .price__current .money, .product-price .money, .sale-price .money');if(!e2)return null;var t2=e2.textContent.replace(/[^0-9.]/g,""),n2=parseFloat(t2);return isNaN(n2)?null:Math.round(100*n2)}function o(){var e2=document.querySelector('.detail.product-column-right h1, .product-title h1, h1.product-title, [itemprop="name"], h1');return e2?e2.textContent.trim():document.title||""}function r(){if(e&&t){var r2=document.querySelector('.quantity-submit-row, form.product-purchase-form .tfc-custom-section, form.product-purchase-form [type="submit"]');if(r2&&!document.getElementById("cro-sticky-atc")){var a2=document.createElement("div");a2.id="cro-sticky-atc",a2.setAttribute("aria-label","Quick add to cart"),a2.setAttribute("role","complementary");var i2=document.createElement("div");i2.className="cro-sticky-info";var c2=document.createElement("div");c2.className="cro-sticky-name";var s2=document.createElement("div");s2.className="cro-sticky-detail",i2.appendChild(c2),i2.appendChild(s2);var u2=document.createElement("button");u2.type="button",u2.className="cro-sticky-btn",u2.textContent="ADD TO CART",u2.setAttribute("aria-label","Add to cart"),a2.appendChild(i2),a2.appendChild(u2),document.body.appendChild(a2),setTimeout(d2,500),setTimeout(d2,2e3),setTimeout(d2,4e3),document.addEventListener("change",function(e2){var t2=e2.target;t2.closest&&(t2.closest(".option-selector")||t2.closest("variant-swatch-king"))&&setTimeout(d2,200)}),document.addEventListener("click",function(e2){var t2=e2.target;t2.closest&&(t2.closest(".swatch-view-item")||t2.closest(".opt-label")||t2.closest(".cro-size-pill"))&&setTimeout(d2,200)}),"IntersectionObserver"in window&&new IntersectionObserver(function(e2){e2.forEach(function(e3){e3.isIntersecting?(a2.classList.remove("cro-sticky-visible"),document.body.classList.remove("cro-sticky-atc-open")):(a2.classList.add("cro-sticky-visible"),document.body.classList.add("cro-sticky-atc-open"))})},{rootMargin:"0px 0px 0px 0px",threshold:0}).observe(r2),u2.addEventListener("click",function(){if(!u2.disabled&&!u2.classList.contains("cro-loading")){var e2=document.querySelector("form.product-purchase-form"),t2=e2?e2.querySelector('button[name="add"], [type="submit"].add-to-cart, button.add-to-cart'):null;if(t2)u2.classList.add("cro-loading"),u2.textContent="ADDING\u2026",t2.click(),setTimeout(function(){u2.classList.remove("cro-loading"),u2.textContent="ADD TO CART"},2e3);else if(e2){u2.classList.add("cro-loading"),u2.textContent="ADDING\u2026";var n2=new FormData(e2);fetch("/cart/add.js",{method:"POST",body:n2}).then(function(e3){if(!e3.ok)throw new Error("cart/add failed");return e3.json()}).then(function(){u2.textContent="ADDED \u2713",typeof window.coldestOpenCartDrawer=="function"&&window.coldestOpenCartDrawer(),setTimeout(function(){u2.classList.remove("cro-loading"),u2.textContent="ADD TO CART"},2e3)}
1).catch(function(){u2.classList.remove("cro-loading"),u2.textContent="ADD TO CART"})}}})}}function d2(){c2.textContent=o();var e2=(function(){var e3="",t3="",n2=document.querySelector('.option-selector[data-option-index="1"] input[type="radio"]:checked');if(n2&&(t3=n2.value||""),!t3){var o2=document.querySelector('.cro-size-pill.active, .cro-size-pill[aria-pressed="true"]');o2&&(t3=o2.textContent.trim())}var r4=document.querySelector('.option-selector[data-option-index="0"] input[type="radio"]:checked');if(r4&&(e3=r4.value||""),!e3){var a3=document.querySelector('.swatch-view-item.selected img, .swatch-view-item.active img, .swatch-view-item[aria-checked="true"] img');a3&&(e3=(a3.getAttribute("alt")||a3.getAttribute("title")||"").replace(/^color:\s*/i,"").trim())}return{color:e3,size:t3}})(),t2=[];e2.color&&t2.push(e2.color),e2.size&&t2.push(e2.size);var pa=document.querySelector(".product-detail .price-container .price-area .current-price"),pt=pa?pa.textContent.replace(/\s+/g," ").trim():"";if(pt)t2.push(pt);else{var r3=n();r3&&t2.push("$"+(r3/100).toFixed(2))}s2.textContent=t2.length>0?t2.join(" \xB7 "):"";var q=document.querySelector("form.product-purchase-form"),w=q&&q.closest(".product-detail"),x=!!(w&&w.classList.contains("variant-status--unavailable"));u2.disabled=x,u2.style.opacity=x?".55":"",u2.style.cursor=x?"not-allowed":"",u2.classList.contains("cro-loading")||(u2.textContent=x?"SOLD OUT":"ADD TO CART");var xb=document.querySelector(".cro-express-btn");xb&&!xb.classList.contains("cro-loading")&&(xb.disabled=x,xb.style.opacity=x?".55":"",xb.style.cursor=x?"not-allowed":"")}}function a(){if(e&&t&&!document.querySelector(".cro-express-btn-wrap")){var n2=document.querySelector(".quantity-submit-row");if(n2){var o2=document.querySelector("form.product-purchase-form");if(o2){var r2=document.createElement("div");r2.className="cro-express-btn-wrap";var a2=document.createElement("button");a2.type="button",a2.className="cro-express-btn",a2.textContent="BUY IT NOW",a2.setAttribute("aria-label","Buy it now \u2014 proceed to checkout"),r2.appendChild(a2),n2.nextSibling?n2.parentNode.insertBefore(r2,n2.nextSibling):n2.parentNode.appendChild(r2),a2.addEventListener("click",function(){var z=o2.closest(".product-detail");if(!(z&&z.classList.contains("variant-status--unavailable"))&&!a2.classList.contains("cro-loading")){a2.classList.add("cro-loading"),a2.textContent="LOADING\u2026";var e2=new FormData(o2);fetch("/cart/add.js",{method:"POST",body:e2}).then(function(e3){return e3.ok?e3.json():e3.json().catch(function(){return{}}).then(function(d2){var r3=new Error(d2&&(d2.description||d2.message)||"cart/add failed");throw r3.cartAdd=!0,r3})}).then(function(){window.location.href="/checkout"}).catch(function(r3){if(a2.classList.remove("cro-loading"),a2.textContent="BUY IT NOW",!r3||r3.message!=="Engraving text required")try{var t2=document.createElement("div");t2.setAttribute("role","alert"),t2.textContent=r3&&r3.cartAdd&&r3.message!=="cart/add failed"?r3.message:"Could not add to cart. Please try again.",t2.style.cssText="position:fixed;top:20px;left:50%;transform:translateX(-50%);background:#111;color:#fff;padding:12px 20px;border-radius:6px;z-index:2147483647;font:500 14px/1.3 sans-serif;max-width:90vw",document.body.appendChild(t2),setTimeout(function(){t2.remove()},4e3)}catch{}})}})}}}}function i(){function t2(){if(!document.querySelector(".cro-savings-badge")&&!document.querySelector(".badge--sale")){var e2=n(),t3=(function(){var e3=document.querySelector('.prices .was-price .money, .prices s .money, .price--compare .money, .compare-at-price .money, [class*="compare"] .money, .original-price .money');if(!e3)return null;var t4=e3.textContent.replace(/[^0-9.]/g,""),n2=parseFloat(t4);return isNaN(n2)?null:Math.round(100*n2)})();if(e2&&t3&&!(t3<=e2)){var o2=Math.round((t3-e2)/t3*100);if(!(o2<5)){var r2=5*Math.round(o2/5);if(!(r2<5)){var a2=document.createElement("span");a2.className="cro-savings-badge",a2.textContent="SAVE "+r2+"%";var i2=document.querySelector(".prices .money, .product-block__price .money, .price__current .money, .sale-price .money");if(i2){var c2=i2.closest('.prices, .product-block__price, [class*="price"]')||i2;c2.nextSibling?c2.parentNode.insertBefore(a2,c2.nextSibling):c2.parentNode.appendChild(a2)}}}}}}!e||document.querySelector(".cro-savings-badge")||document.querySelector(".badge--sale")||(setTimeout(t2,600),setTimeout(t2,2e3))}function c(){if(e&&!document.querySelector(".cro-accordion-wrap")){var t2=document.querySelectorAll('.product-description, .product-single__description, .tab-content .rte, [data-section-type="product-template"] .rte, .product-description-container');Array.prototype.filter.call(t2,function(e2){return!e2.closest(".product-info-block")}
1).forEach(function(e2){setTimeout(function(){(function(e3){if(e3&&!e3.dataset.croAccordionDone){e3.dataset.croAccordionDone="1";var t3=Array.prototype.slice.call(e3.children);if(!(t3.length<2)){var n2=[],o2=null;if(t3.forEach(function(e4){var t4=e4.tagName.toLowerCase(),r3=t4==="h2"||t4==="h3"||t4==="h4";if(!r3&&t4==="p"){var a2=e4.querySelector("strong");a2&&e4.textContent.trim().length<80&&a2.textContent.trim()===e4.textContent.trim()&&(r3=!0)}r3?(o2={heading:e4,body:[]},n2.push(o2)):o2&&o2.body.push(e4)}),!(n2.length<2)){var r2=document.createElement("div");r2.className="cro-accordion-wrap",n2.forEach(function(e4,t4){var n3=document.createElement("div");n3.className="cro-accordion-item";var o3=document.createElement("button");o3.type="button",o3.className="cro-accordion-trigger",o3.setAttribute("aria-expanded",t4===0?"true":"false");var a2=document.createElement("span");a2.textContent=e4.heading.textContent.trim();var i2=document.createElement("span");i2.className="cro-accordion-icon",i2.setAttribute("aria-hidden","true"),i2.textContent="+",o3.appendChild(a2),o3.appendChild(i2);var c2=document.createElement("div");c2.className="cro-accordion-body"+(t4===0?" cro-open":""),e4.body.forEach(function(e5){c2.appendChild(e5.cloneNode(!0))}),o3.addEventListener("click",function(){var e5=o3.getAttribute("aria-expanded")==="true";o3.setAttribute("aria-expanded",String(!e5)),c2.classList.toggle("cro-open",!e5)}),n3.appendChild(o3),n3.appendChild(c2),r2.appendChild(n3)}),e3.innerHTML="",e3.appendChild(r2)}}}})(e2)},800)})}}function s(){(function(){function t2(){var e2=document.querySelector('.option-selector[data-option-index="1"]');if(e2&&!e2.querySelector('input[type="radio"]:checked')){var t3=o().toLowerCase().match(/(\d+)\s*oz/),n2=t3?t3[1]+"oz":null,r2=e2.querySelectorAll('input[type="radio"]');if(r2.length){var a2=null;if(n2&&r2.forEach(function(t4){var o2=e2.querySelector('label[for="'+t4.id+'"]');(o2?o2.textContent:t4.value||"").toLowerCase().trim().indexOf(n2.toLowerCase())!==-1&&(a2=t4)}),!a2){var i2=null,c2=0;r2.forEach(function(t4){var n3=e2.querySelector('label[for="'+t4.id+'"]'),o2=(n3?n3.textContent:t4.value||"").toLowerCase().trim().match(/(\d+)\s*oz/);if(o2){var r3=parseInt(o2[1]);r3>c2&&(c2=r3,i2=t4)}}),i2&&(a2=i2)}if(a2||(a2=r2[0]),a2&&!a2.checked){a2.click();var s2=new Event("change",{bubbles:!0});a2.dispatchEvent(s2)}}}}e&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){setTimeout(t2,300),setTimeout(t2,1e3)}):(setTimeout(t2,300),setTimeout(t2,1e3)))})(),setTimeout(r,500),setTimeout(a,600),setTimeout(i,700),setTimeout(d,800),setTimeout(c,1e3)}var u={"cro-best-seller":{label:"Best Seller",cls:"cro-badge--bestseller"},"cro-new-drop":{label:"New Drop",cls:"cro-badge--new"},"cro-limited-edition":{label:"Limited Edition",cls:"cro-badge--limited"},"cro-shark-tank":{label:"Shark Tank",cls:"cro-badge--shark-tank"}};function d(){if(!document.querySelector(".cro-pdp-badge")){var e2=document.querySelector(".product-form[data-product-id]");if(e2){var t2=e2.getAttribute("data-product-id"),n2=document.getElementById("ProductJson-"+t2);if(n2){var o2;try{o2=JSON.parse(n2.textContent)}catch{return}var r2=o2.tags||[];if(r2.indexOf("cro-badge")!==-1){for(var a2=null,i2=Object.keys(u),c2=0;c2<i2.length;c2++)if(r2.indexOf(i2[c2])>-1){a2=u[i2[c2]];break}if(a2){var s2=document.createElement("span");s2.className="cro-pdp-badge cro-badge "+a2.cls,s2.textContent=a2.label;var d2=document.getElementById("cstm-prdct-glry-imgs"),l=(d2?d2.querySelector(".pmslider-root, .pmslider-mount"):null)||d2;l&&(l.style.position="relative",l.appendChild(s2))}}}}}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",s):s()})(),(function(){"use strict";if(window.location.pathname.indexOf("/products/")!==-1){var e=window.fetch;window.fetch=function(t2,n2){if(t2&&typeof t2=="string"&&(t2.indexOf("/cart/add.js")!==-1||t2==="/cart/add")&&n2&&n2.method&&n2.method.toUpperCase()==="POST"){var o2=r();if(Object.keys(o2).filter(function(e2){return e2.charAt(0)!=="_"}).length===0)return e.apply(this,arguments);var c2="";if(n2.headers&&(n2.headers instanceof Headers?c2=n2.headers.get("Content-Type")||"":typeof n2.headers=="object"&&(c2=n2.headers["Content-Type"]||n2.headers["content-type"]||"")),c2.indexOf("application/json")!==-1&&n2.body)try{var s2=JSON.parse(n2.body);if(s2.items&&Array.isArray(s2.items)){if(!s2.items.some(function(e2){return i(e2.properties)}
1)){s2.items.forEach(function(e2){e2.properties||(e2.properties={}),i(e2.properties)||Object.keys(o2).forEach(function(t3){e2.properties[t3]||(e2.properties[t3]=o2[t3])})});var u=a();if(u.length){var d=Date.now();s2.items.forEach(function(e2){e2.properties&&!e2.properties._gpo_product_group&&(e2.properties._gpo_product_group=d)}),u.forEach(function(e2){s2.items.some(function(t3){return t3.id===e2})||s2.items.push({id:e2,quantity:1,properties:{_gpo_parent_product_group:d}})})}n2.body=JSON.stringify(s2)}}else if(s2.id&&!i(s2.properties)){s2.properties||(s2.properties={}),Object.keys(o2).forEach(function(e2){s2.properties[e2]||(s2.properties[e2]=o2[e2])});var l=a();if(l.length){var p=Date.now();s2.properties._gpo_product_group=p;var f={items:[s2]};l.forEach(function(e2){f.items.push({id:e2,quantity:1,properties:{_gpo_parent_product_group:p}})}),n2.body=JSON.stringify(f)}else n2.body=JSON.stringify(s2)}}catch{}else if(n2.body instanceof FormData){var m=n2.body;try{if(m.has("properties[_has_gpo]"))return e.apply(this,arguments)}catch{}Object.keys(o2).forEach(function(e2){var t3="properties["+e2+"]";try{m.has(t3)||m.append(t3,o2[e2])}catch{m.append(t3,o2[e2])}})}}return e.apply(this,arguments)};var t=XMLHttpRequest.prototype.open,n=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(e2,n2){return this._gpoUrl=n2,this._gpoMethod=e2,t.apply(this,arguments)},XMLHttpRequest.prototype.send=function(e2){if(this._gpoUrl&&typeof this._gpoUrl=="string"&&(this._gpoUrl.indexOf("/cart/add.js")!==-1||this._gpoUrl==="/cart/add")&&this._gpoMethod&&this._gpoMethod.toUpperCase()==="POST"&&e2){var t2=r();if(Object.keys(t2).filter(function(e3){return e3.charAt(0)!=="_"}).length>0)try{var o2=JSON.parse(e2);o2.items&&Array.isArray(o2.items)?o2.items.some(function(e3){return i(e3.properties)})||(o2.items.forEach(function(e3){e3.properties||(e3.properties={}),i(e3.properties)||Object.keys(t2).forEach(function(n2){e3.properties[n2]||(e3.properties[n2]=t2[n2])})}),e2=JSON.stringify(o2)):o2.id&&!i(o2.properties)&&(o2.properties||(o2.properties={}),Object.keys(t2).forEach(function(e3){o2.properties[e3]||(o2.properties[e3]=t2[e3])}),e2=JSON.stringify(o2))}catch{}}return n.call(this,e2)},document.addEventListener("gpoRenderCompleted",function(){setTimeout(c,200),setTimeout(c,1e3)}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",s):s(),new MutationObserver(function(e2){for(var t2=0;t2<e2.length;t2++)for(var n2=0;n2<e2[t2].addedNodes.length;n2++){var o2=e2[t2].addedNodes[n2];if(o2.nodeType===1&&((o2.className||"").toString().indexOf("gpo-clone")!==-1||o2.querySelector&&o2.querySelector('[class*="gpo-clone"]')))return void setTimeout(c,100)}}).observe(document.body||document.documentElement,{childList:!0,subtree:!0})}function o(){var e2=document.querySelector(".gpo-clone-atc-button");return e2?e2.querySelector("button")||e2:null}function r(){var e2={};document.querySelectorAll('.gpo-hidden-inputs input[name^="properties["]').forEach(function(t3){if(t3.value){var n3=t3.name.replace("properties[","").replace("]","");e2[n3]=t3.value}});var t2=document.querySelector(".gpo-app");if(!t2)return e2;t2.querySelectorAll("input[data-field-name], textarea[data-field-name]").forEach(function(t3){var n3=t3.getAttribute("data-field-name");n3&&t3.type!=="radio"&&t3.type!=="checkbox"&&t3.value&&(e2[n3]=t3.value)}),t2.querySelectorAll("select[data-field-name]").forEach(function(t3){var n3=t3.getAttribute("data-field-name");n3&&t3.value&&(e2[n3]=t3.value)}),t2.querySelectorAll('input[type="radio"][data-field-name]:checked').forEach(function(t3){var n3=t3.getAttribute("data-field-name");n3&&t3.value&&(e2[n3]=t3.value)});var n2={};t2.querySelectorAll('input[type="checkbox"][data-field-name]:checked').forEach(function(e3){var t3=e3.getAttribute("data-field-name");t3&&e3.value&&(n2[t3]||(n2[t3]=[]),n2[t3].push(e3.value))}),Object.keys(n2).forEach(function(t3){e2[t3]=n2[t3].join(", ")}),t2.querySelectorAll('input[type="hidden"][data-field-name]').forEach(function(t3){var n3=t3.getAttribute("data-field-name");n3&&t3.value&&!e2[n3]&&(e2[n3]=t3.value)});var o2=document.querySelector(".gpo-container");return o2&&o2.querySelectorAll('[name^="properties["]').forEach(function(t3){if((t3.type!=="radio"||t3.checked)&&(t3.type!=="checkbox"||t3.checked)){var n3=t3.name.replace("properties[","").replace(/\](\[\])?$/,"");t3.value&&!e2[n3]&&(e2[n3]=t3.value)}}),e2}function a(){var e2=[];return document.querySelectorAll(".gpo-hidden-inputs input[gpo-data-variant-id]").forEach(function(t2){var n2=t2.getAttribute("data-field-name");if(n2){var o2=document.querySelector(".gpo-app");if(o2&&!o2.querySelector('input[type="checkbox"][data-field-name="'+n2+'"]:checked'))return}var r2=t2.getAttribute("gpo-data-variant-id");r2&&r2.split(",").forEach(function(t3){(t3=t3.trim())&&e2.push(parseInt(t3))})}),e2}function i(e2){return e2&&e2._has_gpo}function c(){(function(){if(o()){var e2=document.querySelector("#cro-sticky-atc .cro-sticky-btn");e2&&!e2._gpoPatch&&(e2._gpoPatch=!0,e2.addEventListener("click",function(e3){var t3=o();t3&&(e3.stopImmediatePropagation(),e3.preventDefault(),t3.click())},!0));var t2=document.querySelector(".cro-express-btn");t2&&!t2._gpoPatch&&(t2._gpoPatch=!0,t2.addEventListener("click",function(e3){var t3=o();if(t3){e3.stopImmediatePropagation(),e3.preventDefault();var n2=function(){document.removeEventListener("gpoAddedToCart",n2),window.location.href="/checkout"};document.addEventListener("gpoAddedToCart",n2),t3.click(),setTimeout(function(){document.removeEventListener("gpoAddedToCart",n2),fetch("/cart.js").then(function(e4){return e4.json()}).then(function(e4){e4.item_count>0&&(window.location.href="/checkout")}).catch(function(){})},4e3)}},!0))}})(),(function(){if(typeof window.sticky_custom_add_to_cart=="function"&&!window.sticky_custom_add_to_cart._gpoPatch){var e2=window.sticky_custom_add_to_cart,t2=async function(t3,n2,r2){var a2=o();return a2?(a2.click(),!0):e2.apply(this,arguments)};t2._gpoPatch=!0,window.sticky_custom_add_to_cart=t2}})()}function s(){setTimeout(c,1500),setTimeout(c,3e3),setTimeout(c,5e3)}})(),(function(){var DROP_NAMES=["280CTS Arrival - ETA ONLY, Link in descript","5CTNS Arrival - ETA ONLY, Link in description","Garden at Arles","The Hamilton","Shark Tankathon"];
1function getBadge(){var now=new Date(new Date().toLocaleString("en-US",{timeZone:"America/New_York"})),day=now.getDay(),hour=now.getHours();return day===2?{text:"Just Dropped",cls:"nav-badge-dropped"}:day===3&&hour<22?{text:"Sneak Peek",cls:"nav-badge-sneak"}:day===3&&hour>=22?{text:"New Drop",cls:"nav-badge-dropped"}:day>=4||day<=1?{text:"New Drop",cls:"nav-badge-dropped"}:null}function addBadges(){if(!(!DROP_NAMES||!DROP_NAMES.length)){var tier2=document.querySelectorAll(".navigation__item--with-small-menu .navigation__tier-2 > .navigation__item");if(tier2.length){var badge=getBadge();badge&&tier2.forEach(function(item){var link=item.querySelector(".navigation__link");if(!(!link||link.querySelector(".nav-badge-new"))){var linkText=(link.textContent||"").toLowerCase().replace(/[^a-z0-9 ]/g,"").trim(),isDropItem=DROP_NAMES.some(function(name){return linkText.indexOf(name.toLowerCase().replace(/[^a-z0-9 ]/g,"").trim())!==-1});if(isDropItem){var el=document.createElement("span");el.className="nav-badge-new "+badge.cls,el.textContent=badge.text,link.appendChild(el)}}})}}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){setTimeout(addBadges,500)}):setTimeout(addBadges,500);var _cbq=!1;new MutationObserver(function(){_cbq||(_cbq=!0,requestAnimationFrame(function(){_cbq=!1,addBadges()}))}).observe(document.body,{childList:!0,subtree:!0})})(),(function(){"use strict";var PERSONALIZE_VARIANT=44118964338920,css=document.createElement("style");css.textContent="@keyframes gpo-shake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}} .gpo-engrave-error{border:2px solid #e74c3c!important;animation:gpo-shake 0.4s ease}",document.head.appendChild(css);function getEngravingTextField(){var gpo=document.querySelector(".gpo-app");return gpo?gpo.querySelector('input[data-field-name="Engraving"], textarea[data-field-name="Engraving"]')||gpo.querySelector('input[placeholder*="Name or Phrase"], textarea[placeholder*="Name or Phrase"]'):null}function showTextError(){var tf=getEngravingTextField();tf&&(tf.classList.remove("gpo-engrave-error"),tf.offsetHeight,tf.classList.add("gpo-engrave-error"),tf.setAttribute("placeholder","Please enter engraving text"),tf.focus(),tf.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){tf.classList.remove("gpo-engrave-error")},2e3))}function hasProp(p){return p&&p.engrave==="Personalize"}function hasText(p){return p&&p.Engraving&&p.Engraving.trim().length>0}function hasAddon(items){return items&&items.some(function(i){return parseInt(i.id||i.variant_id)===PERSONALIZE_VARIANT})}function getFormEngravingText(){var tf=getEngravingTextField();return tf?tf.value.trim():""}function engraveFromFormData(fd){if(fd.get("properties[engrave]")!=="Personalize"||!fd.get("id"))return null;var engText=fd.get("properties[Engraving]")||"",formText=getFormEngravingText();if(!engText.trim()&&!formText)return showTextError(),{blocked:!0};var vid=fd.get("id"),qty=fd.get("quantity")||1,props={};for(var pair of fd.entries())pair[0].startsWith("properties[")&&(props[pair[0].replace("properties[","").replace("]","")]=pair[1]);!props.Engraving&&formText&&(props.Engraving=formText);var g=Date.now();return props._gpo_product_group=g,{json:JSON.stringify({items:[{id:parseInt(vid),quantity:parseInt(qty),properties:props},{id:PERSONALIZE_VARIANT,quantity:1,properties:{_gpo_parent_product_group:g}}]})}}function failXhr(x){setTimeout(function(){try{x.dispatchEvent(new ProgressEvent("error")),x.dispatchEvent(new ProgressEvent("loadend"))}catch{}},0)}function processPayload(payload){var items=null,isSingle=!1;if(payload.items&&Array.isArray(payload.items)?items=payload.items:payload.id&&(items=[payload],isSingle=!0),!items)return{blocked:!1,payload};var needsPersonalize=items.some(function(i){return hasProp(i.properties)});if(!needsPersonalize)return{blocked:!1,payload};var textInPayload=items.some(function(i){return hasProp(i.properties)&&hasText(i.properties)}),textInForm=getFormEngravingText();if(!textInPayload&&!textInForm)return showTextError(),{blocked:!0,payload};
1if(!textInPayload&&textInForm&&items.forEach(function(i){hasProp(i.properties)&&!hasText(i.properties)&&(i.properties.Engraving=textInForm)}),!hasAddon(isSingle?null:items)){var g=Date.now();items.forEach(function(i){hasProp(i.properties)&&(i.properties=i.properties||{},i.properties._gpo_product_group=i.properties._gpo_product_group||g)}),isSingle?payload={items:[items[0],{id:PERSONALIZE_VARIANT,quantity:1,properties:{_gpo_parent_product_group:g}}]}:payload.items.push({id:PERSONALIZE_VARIANT,quantity:1,properties:{_gpo_parent_product_group:g}})}return{blocked:!1,payload}}var _fetch=window.fetch;window.fetch=function(url,opts){if(url&&typeof url=="string"&&(url.indexOf("/cart/add.js")!==-1||url==="/cart/add")&&opts&&opts.method&&opts.method.toUpperCase()==="POST"&&opts.body){var ct="";if(opts.headers&&(opts.headers instanceof Headers?ct=opts.headers.get("Content-Type")||"":typeof opts.headers=="object"&&(ct=opts.headers["Content-Type"]||opts.headers["content-type"]||"")),ct.indexOf("application/json")!==-1)try{var p=JSON.parse(opts.body),result=processPayload(p);if(result.blocked)return Promise.reject(new Error("Engraving text required"));opts.body=JSON.stringify(result.payload)}catch{}else if(opts.body instanceof FormData)try{var ef=engraveFromFormData(opts.body);if(ef&&ef.blocked)return Promise.reject(new Error("Engraving text required"));ef&&(opts.body=ef.json,opts.headers=opts.headers||{},opts.headers instanceof Headers?opts.headers.set("Content-Type","application/json"):opts.headers["Content-Type"]="application/json")}catch{}}return _fetch.apply(this,arguments)};var _xOpen=XMLHttpRequest.prototype.open,_xSend=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(m,u){return this._eUrl=u,this._eMethod=m,_xOpen.apply(this,arguments)},XMLHttpRequest.prototype.send=function(body){if(this._eUrl&&typeof this._eUrl=="string"&&(this._eUrl.indexOf("/cart/add.js")!==-1||this._eUrl==="/cart/add")&&this._eMethod&&this._eMethod.toUpperCase()==="POST"){if(typeof body=="string")try{var p=JSON.parse(body),result=processPayload(p);if(result.blocked){failXhr(this),showTextError();return}body=JSON.stringify(result.payload)}catch{}else if(typeof FormData<"u"&&body instanceof FormData)try{var ef=engraveFromFormData(body);if(ef&&ef.blocked){failXhr(this);return}if(ef){try{this.setRequestHeader("Content-Type","application/json")}catch{}body=ef.json}}catch{}}return _xSend.call(this,body)};var ENGRAVE_BTN_SEL=[".gpo-clone-atc-button button",".gpo-clone-atc-button",'button[type="submit"][name="add"]',".product-form__cart-submit",".shopify-payment-button button","#cro-sticky-atc button",".sticky-atc button",".cro-sticky-btn",".cro-express-btn",'[data-action="add-to-cart"]'].join(",");document.addEventListener("click",function(e){var btn=e.target&&e.target.closest&&e.target.closest(ENGRAVE_BTN_SEL);if(btn){var gpo=document.querySelector(".gpo-app");if(gpo){var checked=!1;gpo.querySelectorAll('input[type="checkbox"]').forEach(function(cb){var lbl=cb.closest("label")||cb.parentElement;lbl&&lbl.textContent.indexOf("Personalize")!==-1&&cb.checked&&(checked=!0)}),checked&&(getFormEngravingText()||(e.preventDefault(),e.stopImmediatePropagation(),showTextError()))}}},!0)})(),(function(){if(window.location.pathname.indexOf("/products/coldest-1-gallon-limitless-ultra")===-1)return;function moveFBT(){var fbt=document.querySelector(".boost-sd__recommendation-bundle");if(!fbt)return!1;var buyNow=document.querySelector('[data-shopify="payment-button"]');if(buyNow||(buyNow=document.querySelector(".shopify-payment-button")),!buyNow){var trustRow=document.querySelector(".cro-express-btn-wrap")||document.querySelector(".product-purchase-form .quantity-submit-row");trustRow&&(buyNow=trustRow)}if(!buyNow)return!1;var insertAfter=buyNow.closest(".product-form")||buyNow.closest(".product-purchase-form")||buyNow.parentElement;return insertAfter&&fbt.parentElement!==insertAfter.parentElement?(insertAfter.parentElement.insertBefore(fbt,insertAfter.nextSibling),fbt.style.marginTop="24px",!0):!1}var attempts=0,iv=setInterval(function(){attempts++,(moveFBT()||attempts>40)&&clearInterval(iv)},300);new MutationObserver(function(mutations){for(var i=0;i<mutations.length;i++)for(var j=0;j<mutations[i].addedNodes.length;j++){var node=mutations[i].addedNodes[j];if(node.nodeType===1&&((node.className||"").indexOf("recommendation-bundle")!==-1||node.querySelector&&node.querySelector(".boost-sd__recommendation-bundle"))){setTimeout(moveFBT,100);return}}}).observe(document.body,{childList:!0,subtree:!0})})();
2//# sourceMappingURL=/cdn/shop/t/237/assets/coldest-phase2-fixes.js.map?v=90857281882137308831790640341

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.