var $=Object.defineProperty;var y=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var m=(t,a,e)=>a in t?$(t,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[a]=e,p=(t,a)=>{for(var e in a||(a={}))w.call(a,e)&&m(t,e,a[e]);if(y)for(var e of y(a))E.call(a,e)&&m(t,e,a[e]);return t};import{a as T,r as g,cJ as x,f as B,k as C,E as F,a1 as k,H as P,cK as z,cw as D,aP as H,o as I,h as J,t as K,bc as M,cx as j}from"./index.0d073eaa.js";const q={startVal:{type:Number,default:0},endVal:{type:Number,default:2021},duration:{type:Number,default:1500},autoplay:{type:Boolean,default:!0},decimals:{type:Number,default:0,validator(t){return t>=0}},prefix:{type:String,default:""},suffix:{type:String,default:""},separator:{type:String,default:","},decimal:{type:String,default:"."},color:{type:String},useEasing:{type:Boolean,default:!0},transition:{type:String,default:"linear"}},A=T({name:"CountTo",props:q,emits:["onStarted","onFinished"],setup(t,{emit:a}){const e=g(t.startVal),u=g(!1);let o=x(e);const c=B(()=>h(C(o)));F(()=>{e.value=t.startVal}),k([()=>t.startVal,()=>t.endVal],()=>{t.autoplay&&s()}),P(()=>{t.autoplay&&s()});function s(){d(),e.value=t.endVal}function S(){e.value=t.startVal,d()}function d(){o=x(e,p({disabled:u,duration:t.duration,onFinished:()=>a("onFinished"),onStarted:()=>a("onStarted")},t.useEasing?{transition:z[t.transition]}:{}))}function h(n){if(!n&&n!==0)return"";const{decimals:b,decimal:V,separator:i,suffix:v,prefix:N}=t;n=Number(n).toFixed(b),n+="";const l=n.split(".");let r=l[0];const _=l.length>1?V+l[1]:"",f=/(\d+)(\d{3})/;if(i&&!D(i))for(;f.test(r);)r=r.replace(f,"$1"+i+"$2");return N+r+_+v}return{value:c,start:s,reset:S}}});function G(t,a,e,u,o,c){return I(),J("span",{style:M({color:t.color})},K(t.value),5)}var L=H(A,[["render",G]]);const R=j(L);export{R as C};
