const e=require("../_util/classNames.js");let t=require("vue");function n({prefixCls:n,value:r,current:i,offset:a=0}){let o;return a&&(o={position:`absolute`,top:`${a}00%`,left:0}),(0,t.createVNode)(`p`,{style:o,class:e.default(`${n}-only-unit`,{current:i})},[r])}function r(e,t,n){let r=e,i=0;for(;(r+10)%10!==t;)r+=n,i+=n;return i}var i=(0,t.defineComponent)({compatConfig:{MODE:3},name:`SingleNumber`,props:{prefixCls:String,value:String,count:Number},setup(e){let i=(0,t.computed)(()=>Number(e.value)),a=(0,t.computed)(()=>Math.abs(e.count)),o=(0,t.reactive)({prevValue:i.value,prevCount:a.value}),s=()=>{o.prevValue=i.value,o.prevCount=a.value},c=(0,t.ref)();return(0,t.watch)(i,()=>{clearTimeout(c.value),c.value=setTimeout(()=>{s()},1e3)},{flush:`post`}),(0,t.onUnmounted)(()=>{clearTimeout(c.value)}),()=>{let c,l={},u=i.value;if(o.prevValue===u||Number.isNaN(u)||Number.isNaN(o.prevValue))c=[n({...e,current:!0})],l={transition:`none`};else{c=[];let t=u+10,i=[];for(let e=u;e<=t;e+=1)i.push(e);let s=i.findIndex(e=>e%10===o.prevValue);c=i.map((t,r)=>{let i=t%10;return n({...e,value:i,offset:r-s,current:r===s})});let d=o.prevCount<a.value?1:-1;l={transform:`translateY(${-r(o.prevValue,u,d)}00%)`}}return(0,t.createVNode)(`span`,{class:`${e.prefixCls}-only`,style:l,onTransitionend:()=>s()},[c])}}});exports.default=i;