import{r as t,h as n,d as a}from"./p-b3a13b6a.js";import{v as e}from"./p-4ed69de7.js";const i=(t,n=0,a=100,e=1e3,i="Sv-SE",s)=>{const o=new Intl.NumberFormat(i,s);if(e<=0){t.textContent=o.format(a);return}let d=null;const c=i=>{if(!d)d=i;const s=Math.min((i-d)/e,1);if(s<1){const e=Math.round((s*(a-n)+n)*10)/10;t.textContent=o.format(e);window.requestAnimationFrame(c)}else{t.textContent=o.format(a)}};window.requestAnimationFrame(c)};const s={Sv:{lang:"Sv",code:"Sv-SE"},En:{lang:"En",code:"En-GB"}};const o={Decimal:{style:"decimal"},Currency:{style:"currency",currency:"SEK"},Percent:{style:"percent"},None:{style:"decimal",useGrouping:false}};const d=(t,n,a)=>{t.forEach((t=>{t.target.classList.toggle(n,t.isIntersecting);a(t)}))};const c="pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-stats-info-data{width:50%}pn-stats-info-data .pn-stats-info-data__container{width:100%;background-color:transparent;color:#f06365;display:flex;flex-direction:column;align-items:center;padding:2rem}@media screen and (min-width: 768px){pn-stats-info-data .pn-stats-info-data__container{justify-content:center;min-height:102px;padding:0 2rem}}@media screen and (min-width: 1200px){pn-stats-info-data .pn-stats-info-data__container{min-height:125px}}pn-stats-info-data .pn-stats-info-data__container__content{display:flex;flex-direction:row;justify-content:center}pn-stats-info-data .pn-stats-info-data__container__content__data{font-weight:700;font-size:3rem;line-height:110%}@media screen and (min-width: 1200px){pn-stats-info-data .pn-stats-info-data__container__content__data{font-size:5.6rem}}pn-stats-info-data .pn-stats-info-data__container__content__unit{font-weight:700;font-size:3rem;line-height:110%;margin-left:0.8rem}@media screen and (min-width: 1200px){pn-stats-info-data .pn-stats-info-data__container__content__unit{font-size:5.6rem}}pn-stats-info-data .pn-stats-info-data__container__content__preamble{text-align:center;font-weight:400;font-size:1.4rem;line-height:110%;color:#ffffff}";const r=c;const p=class{constructor(n){t(this,n);this.format="En";this.formatStyle="Decimal";this.startValue=0;this.data=0;this.unit=null;this.preamble=null;this.duration=1e3;this.index=null;this.hasBeenShown=false;this.compId=null}inViewPortCallback=t=>{if(t.isIntersecting){this.hasBeenShown=true}};generateUniqueId(){return e()}componentWillLoad(){this.compId=this.generateUniqueId()}watchStateHandlder(t,n){const a=document.getElementById(`pn-stats-info-data-${this.compId}-${this.index}`);if(a.classList.contains("is-inViewport")&&t!==n){i(a,this.startValue,this.data,this.duration,s[this.format].code,o[this.formatStyle])}}render(){return n(a,{key:"a1341a3318a51adb8a170b773f9109110bca65c6"},n("div",{key:"e7c94b94b3cf2b1c7fd4c05f953ca537ec17153c",class:"pn-stats-info-data__container"},n("div",{key:"391ad615fa5930728fb3a7baece08d3636c90820",class:"pn-stats-info-data__container__content"},n("div",{key:"a54130470a7c195f2789c440167022d9eafbee42",class:"pn-stats-info-data__container__content__data",id:`pn-stats-info-data-${this.compId}-${this.index}`}),this.unit&&n("div",{key:"0aa67825205280a82b65f8f650203bcbe9318ded",class:"pn-stats-info-data__container__content__unit"},this.unit)),n("div",{key:"14bd4ef96a6d6be6591dbcb314c395a016e9ad9c",class:"pn-stats-info-data__container__content__preamble"},this.preamble)))}componentDidRender(){const t=new IntersectionObserver((t=>d(t,"is-inViewport",this.inViewPortCallback)));const n=document.getElementById(`pn-stats-info-data-${this.compId}-${this.index}`);t.observe(n)}static get watchers(){return{hasBeenShown:["watchStateHandlder"]}}};p.style=r;export{p as pn_stats_info_data};
//# sourceMappingURL=p-6f1e27ec.entry.js.map