PageSourceSearch

https://myfahlo.com/cdn/shop/t/219/assets/build-promotional-countdown-Bu1eeW-G.js

js myfahlo.com collected 2026-10-01 11:32:33 UTC 2,446 bytes, 2 lines download raw bytes

1const b=["days","hours","minutes"];const T="The countdown has ended.",K=window.matchMedia("(prefers-reduced-motion: reduce)");function N(t){const s=t.closest(".promotional-module"),o=s&&s.querySelector("[data-promotional-cta]"),c=t.querySelector("[data-countdown-status]"),_=t.querySelector("[data-countdown-announcer]"),m=Number(t.dataset.countdownEnd)*1e3;if(!Number.isFinite(m)||m<=0)return null;const S=Number(t.dataset.countdownNow)*1e3,y=Number.isFinite(S)&&S>0?S-Date.now():0,O=Math.abs(y)>3e5?y:0,D=()=>Date.now()+O,g=new Map;b.forEach(e=>{const n=t.querySelector(`[data-countdown-unit="${e}"]`);n&&g.set(e,Array.from(n.querySelectorAll("[data-countdown-digit]")))});const w=[];let u=null,M=!1,v="";function E(){u&&(clearInterval(u),u=null)}function d(e,n){const i=g.get(e);if(!i)return;const f=String(n).padStart(i.length,"0").slice(-i.length);i.forEach((r,a)=>{const x=r.firstElementChild||r,C=f.charAt(a);x.textContent!==C&&(x.textContent=C)})}function R(){if(!M){if(M=!0,E(),b.forEach(e=>d(e,0)),o){const e=o.dataset.ctaPostLabel,n=o.dataset.ctaPostUrl;e&&(o.textContent=e),n&&o.setAttribute("href",n),o.removeAttribute("hidden")}c&&(c.textContent=T),_&&(_.textContent=T),w.push(setTimeout(()=>{t.classList.add("is-expired")},1500)),w.push(setTimeout(()=>{t.remove()},K.matches?1500:2200))}}function p(){const e=m-D();if(e<=0){R();return}const n=Math.floor(e/1e3),i=Math.floor(n/86400),f=Math.floor(n%86400/3600),r=Math.max(1,Math.floor(n%3600/60));d("days",i),d("hours",f),d("minutes",r);const a=`${i} days, ${f} hours, ${r} minutes remaining`;c&&a!==v&&(v=a,c.textContent=a)}function L(){E(),!M&&(u=setInterval(p,1e3))}function l(){document.hidden||(p(),L())}return document.addEventListener("visibilitychange",l),window.addEventListener("pageshow",l),p(),L(),{teardown(){E(),w.forEach(clearTimeout),document.removeEventListener("visibilitychange",l),window.removeEventListener("pageshow",l)}}}const h=new Map;function q(t){if(h.has(t))return;const s=N(t);s&&h.set(t,s)}function I(t){(t||document).querySelectorAll("[data-promotional-countdown]").forEach(q)}let A=!1;function F(){A||(A=!0,document.addEventListener("shopify:section:load",t=>I(t.target)),document.addEventListener("shopify:section:unload",t=>{h.forEach((s,o)=>{t.target.contains(o)&&(s.teardown(),h.delete(o))})}))}function H(){I(),window.Shopify&&window.Shopify.designMode&&F()}export{H as default};
2//# sourceMappingURL=build-promotional-countdown-Bu1eeW-G.js.map

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.