import{r as e,h as a,H as t}from"./p-76ab1744.js";const r=class{constructor(a){e(this,a),this.value=0,this.allyLabel=null,this.dataTrackingId="telia-counter-badge"}sanitizeValue(e){const a=Number.parseInt(e);if(a>0)return a;throw Error("Value needs to be a number (1-9)")}formatValue(e){return e>999?"999+":e.toString()}render(){return a(t,{class:{"telia-counter-badge":!!this.value,"telia-counter-badge--long":this.value>9},"data-testid":this.dataTestid},a("span",{class:"telia-counter-badge--placeholder",role:"status","aria-label":this.allyLabel},this.formatValue(this.sanitizeValue(this.value))),a("telia-vst",{dataTrackingId:this.dataTrackingId}))}};r.style='.telia-counter-badge{background-color:#5e0092;border-radius:calc(99.9rem * var(--voca-rem-multiplier));font-family:"TeliaSans", Helvetica, Arial, "Lucida Grande", sans-serif;font-weight:500;font-size:calc(1.2rem * var(--voca-rem-multiplier));color:#ffffff;display:inline-block;line-height:1;width:calc(1.4rem * var(--voca-rem-multiplier));max-height:calc(1.4rem * var(--voca-rem-multiplier));padding:calc(0.1rem * var(--voca-rem-multiplier)) calc(0.4rem * var(--voca-rem-multiplier));text-align:center}.telia-counter-badge--long{width:auto}.telia-counter-badge--placeholder{display:flex;justify-content:center;align-items:center}';export{r as telia_counter_badge}