1if(!customElements.get("stat-counter")){class StatCounter extends HTMLElement{connectedCallback(){if(this.items=Array.from(this.querySelectorAll(".stack-stats__item")),this.valueEls=Array.from(this.querySelectorAll(".stack-stats__value")),this.valueEls.length===0)return;if(this.statDuration=parseInt(this.dataset.duration,10)||1600,this.holdDuration=parseInt(this.dataset.holdDuration,10)||900,this.loopPause=parseInt(this.dataset.loopPause,10)||1200,this._stopped=!1,this.valueEls.forEach(el=>{const parsed=StatCounter.parseValue(el.dataset.value);parsed!==null&&(el.statTarget=parsed.value,el.statDecimals=parsed.decimals)}),this.setAllToFinal(),window.matchMedia("(prefers-reduced-motion: reduce)").matches||!("IntersectionObserver"in window)){this.items.forEach(item=>item.classList.add("is-active")),this.setAttribute("loaded","");return}this.observer=new IntersectionObserver(entries=>{entries.some(entry=>entry.isIntersecting)&&(this.observer.disconnect(),this.runLoop())},{threshold:.35}),this.observer.observe(this)}disconnectedCallback(){this._stopped=!0,this.observer&&this.observer.disconnect()}showAllFinal(){this.items.forEach(item=>item.classList.add("is-active")),this.setAllToFinal()}setAllToFinal(){this.valueEls.forEach(el=>{el.statTarget!==void 0&&(el.textContent=StatCounter.format(el.statTarget,el.statDecimals))})}setActiveIndex(index){this.items.forEach((item,i)=>{item.classList.toggle("is-active",i===index),i!==index&&item.classList.remove("is-animating")})}wait(ms){return new Promise(resolve=>{window.setTimeout(resolve,ms)})}animateStat(index){const el=this.valueEls[index];if(!el||el.statTarget===void 0)return Promise.resolve();const item=this.items[index];return this.setAllToFinal(),this.setActiveIndex(index),item.classList.add("is-animating"),el.textContent=StatCounter.format(0,el.statDecimals),new Promise(resolve=>{const start=performance.now(),tick=now=>{if(this._stopped){item.classList.remove("is-animating"),resolve();return}const progress=Math.min((now-start)/this.statDuration,1),eased=1-(1-progress)**3;el.textContent=StatCounter.format(el.statTarget*eased,el.statDecimals),progress<1?requestAnimationFrame(tick):(item.classList.remove("is-animating"),resolve())};requestAnimationFrame(tick)})}async runLoop(){for(;!this._stopped;){for(let i=0;i<this.valueEls.length;i+=1){if(this._stopped||(await this.animateStat(i),this._stopped))return;await this.wait(this.holdDuration)}if(this._stopped)return;await this.wait(this.loopPause),this.setAllToFinal(),this.items.forEach(item=>item.classList.remove("is-active"))}}static parseValue(raw){if(!raw)return null;const cleaned=raw.replace(/,/g,"").trim(),value=parseFloat(cleaned);if(Number.isNaN(value))return null;const decimalPart=cleaned.split(".")[1];return{value,decimals:decimalPart?decimalPart.length:0}}static format(value,decimals){return value.toLocaleString(void 0,{minimumFractionDigits:decimals,maximumFractionDigits:decimals})}}customElements.define("stat-counter",StatCounter)} 2//# sourceMappingURL=/cdn/shop/t/60/assets/stack-stats-counter.js.map?v=149225066709659345791783375118
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.