import{k as F,r as g,c as v,o as C,b as D,$ as a,Z as k,_ as l,S as r,a8 as u,a0 as i,a9 as p,F as j,P as z,aa as M,l as N,v as O}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{g as P}from"./index-oaByoBTF.js?v=1773287522785";import{i as T,m as V,c as $}from"./index-BTglIPU2.js?v=1773287522785";import{ad as E,ae as L,k as U,a9 as Z,af as q}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const A={class:"p-16px"},G={class:"mb-16px"},H={class:"propress-box p-10px rounded-8px"},J=F({__name:"progress",props:{params:{},callback:{type:Function}},setup(x){const n=x,c=g(!1),o=g([]),_=v(()=>o.value.findIndex(s=>s.status===0)+1),y=v(()=>{var s;return(s=o.value[_.value])==null?void 0:s.status}),h={0:"process",1:"finish","-1":"error",2:"wait"},m=s=>h[s];let e=null;const d=async()=>{const{message:s}=await P({progress_type:n.params});T(s)&&(s.status===1?(e&&clearInterval(e),V.success("Task completed!"),c.value=!0):c.value=!1,delete s.status,o.value=Object.values(s))};return C(()=>{d(),e=window.setInterval(()=>{d()},2e3)}),D(()=>{var s;(s=n.callback)==null||s.call(n),e&&clearInterval(e)}),(s,K)=>{const f=E,w=Z,b=U,I=L,B=q;return a(),k("div",A,[l("div",G,[r(c)?(a(),u(f,{key:0,type:"success",title:"Task completed!"})):(a(),u(f,{key:1,type:"default",title:"In progress..."}))]),l("div",H,[i(B,{vertical:"",current:r(_),status:m(r(y)),size:"small"},{default:p(()=>[(a(!0),k(j,null,z(r(o),(t,S)=>(a(),u(I,{key:S,status:m(t.status),description:t.error||t.ps},{title:p(()=>[i(b,{class:"flex-nowrap! items-center!"},{default:p(()=>[l("span",null,M(t.title),1),N(i(w,{size:"small"},null,512),[[O,t.status===0]])]),_:2},1024)]),_:2},1032,["status","description"]))),128))]),_:1},8,["current","status"])])])}}}),ss=$(J,[["__scopeId","data-v-939603d7"]]);export{ss as default};
