(()=>{"use strict";function t(t,...e){return e.some((e=>t instanceof e))}class e extends Error{constructor(t){super(t),this.name="AssertionError"}}function n(t){return t.join(", ").replace(/,(?!.*,)/," or")}function i(i,...r){if(function(e,...n){return!t(e,...n)}(i,...r))throw new e(`Value should be ${n(r.map((({name:t})=>t)))}`)}function r(t){return null===t}function o(t){if(r(t))throw new e("Value should not be null")}function s(t){return new Promise((e=>{let n;const{to:i,from:r,callback:o,duration:s,delay:a,timing:c}=Object.assign({duration:1e3,timing:t=>t},t),u=t=>{null!=n||(n=t);const a=t-n,l=c(function(t,e,n){return Math.min(Math.max(t,e),n)}(a,0,s)/s);o(function(t,e,n){return e+(n-e)*t}(l,r,i)),a<s?requestAnimationFrame(u):e()};(t=>{a?globalThis.setTimeout(t,a):t()})((()=>requestAnimationFrame(u)))}))}class a{static map=new WeakMap;static observer=new IntersectionObserver(((t,e)=>{t.forEach((t=>{let{isIntersecting:n,target:r}=t;i(r,HTMLElement),n&&(e.unobserve(r),a.map.get(r)?.(e))}))}),{rootMargin:"-50px 0px"});constructor(t){let{element:e,callback:n}=t;a.map.set(e,n),a.observer.observe(e)}}class c{duration=3e3;timing=u;constructor(t){let{element:e,delay:n,callback:i}=t;const r=e.querySelector("svg"),s=e.querySelector(".js-output");o(r),o(s),this.svgElement=r,this.output=s,this.from=Number(this.output.dataset.from),this.to=Number(this.output.dataset.to),this.delay=n,this.callback=i,i(this.output,this.from),new a({element:e,callback:()=>this.animate()})}animate(){s({from:this.from,to:this.to,duration:this.duration,delay:this.delay,timing:this.timing,callback:t=>this.callback(this.output,t)}),s({from:300,to:0,duration:this.duration,delay:this.delay,timing:this.timing,callback:t=>{this.svgElement.style.setProperty("--dashoffset",t.toString())}})}}function u(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}!function(){const t=new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP",minimumIntegerDigits:9,maximumFractionDigits:0}),e=document.querySelector(".js-statistic-1"),n=document.querySelector(".js-statistic-2"),i=document.querySelector(".js-statistic-3");o(e),o(n),o(i),new c({element:e,callback:(e,n)=>e.innerHTML=t.format(Math.round(n))}),new c({element:n,callback:(t,e)=>t.innerHTML=e.toFixed(1)}),new c({element:i,callback:(t,e)=>t.innerHTML=`${Math.round(e).toString()}%`})}()})();
