(()=>{"use strict";function t(t){const e=parseInt(t.getAttribute("data-duration")||"2000",10)||2e3;t.querySelectorAll(".flexa-counter__value[data-target]").forEach(t=>function(t,e){const n=t.getAttribute("data-target")||"",o=parseFloat(n);if(Number.isNaN(o))return;const r=function(t){const e=t.indexOf(".");return-1===e?0:t.length-e-1}(n);if(window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||e<=0)return void(t.textContent=o.toFixed(r));const a=performance.now(),i=n=>{const c=Math.min(1,(n-a)/e),d=1-Math.pow(1-c,3);t.textContent=(o*d).toFixed(r),c<1?window.requestAnimationFrame(i):t.textContent=o.toFixed(r)};t.textContent=(0).toFixed(r),window.requestAnimationFrame(i)}(t,e))}function e(t){t.classList.add("flexa-bg-loaded"),t.removeAttribute("data-flexa-lazy-bg")}function n(){const n=document.querySelectorAll("[data-flexa-counter]"),o=document.querySelectorAll("[data-flexa-lazy-bg]");if(void 0===window.IntersectionObserver)return n.forEach(t),void o.forEach(e);if(n.length){const e=new window.IntersectionObserver((e,n)=>{e.forEach(e=>{e.isIntersecting&&(t(e.target),n.unobserve(e.target))})},{rootMargin:"0px 0px -10% 0px"});n.forEach(t=>e.observe(t))}if(o.length){const t=new window.IntersectionObserver((t,n)=>{t.forEach(t=>{t.isIntersecting&&(e(t.target),n.unobserve(t.target))})},{rootMargin:"200px 0px"});o.forEach(e=>t.observe(e))}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",n):n()})();