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