import{t as O}from"./debounce-Xd493GvO.js";import{r as q}from"./request-CEvu378m.js";import{r as c,ax as $,c as g,w,j as I,n as z,X as K,B as p,z as m,D as d,M as j,a7 as B,H as F,W as h,L as V}from"./vue-BJk78QHK.js";import{_ as J}from"./index-M_JNBppB.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const W={class:"total-count"},E={style:{color:"rgb(100 229 254)","font-size":"40px","font-weight":"900"}},M=Object.assign({name:"NumberFlop2"},{__name:"NumberFlop2",props:{element:{type:Object,default:()=>({})},propValue:{type:Object,default:()=>({})},request:{type:Object,default:()=>({})}},setup(N){const e=N,o=c(null),f=c(0),s=c(null),v=c([]),y=c(["0","1","2","3","4","5","6","7","8","9",0,1,2,3,4,5,6,7,8,9]),u=$(),t=g(()=>e.propValue.config),b=g(()=>e.propValue.config.number[0].toString().split("")),S=g(()=>{const a=e.element.style.width,l=e.element.style.height;return{width:a,height:l}});w(S,O(a=>{f.value++},1e3),{deep:!0}),w(t,()=>{clearInterval(s.value),s.value=null,x()},{deep:!0}),I(()=>{var a,l;e.request&&(o.value=q(e.request,e.propValue.config,"number")),((l=(a=e.request)==null?void 0:a.global)==null?void 0:l.length)>0&&u.watch(()=>u.state.globalKey,()=>{e.request.global.forEach(n=>{const r=u.state.globalKey.findIndex(i=>i.globalKey===n);if(r>-1){const i=[u.state.globalKey[r].globalKey,u.state.globalKey[r].globalValue],_=e.request.data.findIndex(k=>k[0]===i[0]);_>-1?e.request.data[_][1]=i[1]:e.request.data.push(i)}}),o.value(),o.value=q(e.request,e.propValue.config,"number")},{deep:!0}),z(()=>{v.value=JSON.parse(JSON.stringify(b.value)),x()})}),K(()=>{e.request&&o.value&&o.value()});function x(){const a=b.value;let l=JSON.parse(JSON.stringify(a));s.value=setInterval(()=>{l.forEach((n,r)=>{y.value.includes(n)&&(v.value[r]=Number.parseInt(Math.random()*10))}),f.value++},50),setTimeout(()=>{clearInterval(s.value),s.value=null,v.value=l},e.propValue.config.animationFrame)}return(a,l)=>(m(),p("div",{key:f.value},[d("div",W,[(m(!0),p(j,null,B(v.value,(n,r)=>(m(),p("div",{key:r},[y.value.includes(n)?(m(),p("div",{key:0,style:h({width:`${t.value.width}px`,height:`${t.value.height}px`,margin:`${t.value.margin}px`}),class:F(`num${n}`)},null,6)):(m(),p("div",{key:1,style:h({display:"flex","flex-direction":"column-reverse",width:"10px",height:`${t.value.height}px`,margin:`${t.value.margin}px`})},[d("p",E,V(n),1)],4))]))),128)),d("p",{style:h({"font-size":`${t.value.fontSize}px`,"font-weight":t.value.fontWeight,margin:`${t.value.margin}px`,color:t.value.color})},V(t.value.content),5)])]))}}),A=J(M,[["__scopeId","data-v-af1c2b4f"]]);export{A as default};
