import{C as e,I as t,K as n,M as r,O as i,Q as a,S as o,St as s,T as c,U as l,X as u,Y as d,cn as f,ct as p,dt as m,in as h,j as g,k as _,kt as v,nn as y,tt as b,w as x,x as S}from"./vue.runtime.esm-bundler-DpGzKKN4.js";import{Q as C,Zt as w,y as T}from"./style-DGCNsUJ6.js";import{H as E,Ht as D,Mt as O,Ot as k,Vt as A,Z as j,kt as M,rt as N}from"./vnode-DU8g6Rf7.js";import{v as P}from"./css--CcZutYI.js";var F=T({space:{type:[Number,String],default:``},active:{type:Number,default:0},direction:{type:String,default:`horizontal`,values:[`horizontal`,`vertical`]},alignCenter:{type:Boolean},simple:{type:Boolean},finishStatus:{type:String,values:[`wait`,`process`,`finish`,`error`,`success`],default:`finish`},processStatus:{type:String,values:[`wait`,`process`,`finish`,`error`,`success`],default:`process`}}),I={[D]:(e,t)=>[e,t].every(C)},L=`ElSteps`,R=A(g({...g({name:`ElSteps`}),props:F,emits:I,setup(e,{emit:t}){let n=e,i=w(`steps`),{children:o,addChild:s,removeChild:l,ChildrenSorter:f}=P(r(),`ElStep`);return p(o,()=>{o.value.forEach((e,t)=>{e.setIndex(t)})}),u(L,{props:n,steps:o,addStep:s,removeStep:l}),p(()=>n.active,(e,n)=>{t(D,e,n)}),(e,t)=>(d(),c(`div`,{class:y([v(i).b(),v(i).m(e.simple?`simple`:e.direction)])},[a(e.$slots,`default`),_(v(f))],2))}}),[[`__file`,`steps.vue`]]),z=T({title:{type:String,default:``},icon:{type:E},description:{type:String,default:``},status:{type:String,values:[``,`wait`,`process`,`finish`,`error`,`success`],default:``}}),B=A(g({...g({name:`ElStep`}),props:z,setup(u){let g=u,T=w(`step`),E=s(-1),D=s({}),O=s(``),A=t(L),M=r(),P=0,F=0;n(()=>{p([()=>A.props.active,()=>A.props.processStatus,()=>A.props.finishStatus],([e],[t])=>{F=t||0,P=e-F,Y(e)},{immediate:!0})});let I=S(()=>g.status||O.value),R=S(()=>{let e=A.steps.value[E.value-1];return e?e.internalStatus.value:`wait`}),z=S(()=>A.props.alignCenter),B=S(()=>A.props.direction===`vertical`),V=S(()=>A.props.simple),H=S(()=>A.steps.value.length),U=S(()=>A.steps.value[H.value-1]?.uid===M.uid),W=S(()=>V.value?``:A.props.space),G=S(()=>[T.b(),T.is(V.value?`simple`:A.props.direction),T.is(`flex`,U.value&&!W.value&&!z.value),T.is(`center`,z.value&&!B.value&&!V.value)]),K=S(()=>{let e={flexBasis:C(W.value)?`${W.value}px`:W.value?W.value:`${100/(H.value-+!z.value)}%`};return B.value||U.value&&(e.maxWidth=`${100/H.value}%`),e}),q=e=>{E.value=e},J=e=>{let t=e===`wait`,n={transitionDelay:`${Math.abs(P)===1?0:P>0?(E.value+1-F)*150:-(E.value+1-A.props.active)*150}ms`},r=e===A.props.processStatus||t?0:100;n.borderWidth=r&&!V.value?`1px`:0,n[A.props.direction===`vertical`?`height`:`width`]=`${r}%`,D.value=n},Y=e=>{e>E.value?O.value=A.props.finishStatus:e===E.value&&R.value!==`error`?O.value=A.props.processStatus:O.value=`wait`;let t=A.steps.value[E.value-1];t&&t.calcProgress(O.value)},X={uid:M.uid,getVnode:()=>M.vnode,currentStatus:I,internalStatus:O,setIndex:q,calcProgress:J};return A.addStep(X),l(()=>{A.removeStep(X)}),(t,n)=>(d(),c(`div`,{style:h(v(K)),class:y(v(G))},[x(` icon & line `),o(`div`,{class:y([v(T).e(`head`),v(T).is(v(I))])},[v(V)?x(`v-if`,!0):(d(),c(`div`,{key:0,class:y(v(T).e(`line`))},[o(`i`,{class:y(v(T).e(`line-inner`)),style:h(D.value)},null,6)],2)),o(`div`,{class:y([v(T).e(`icon`),v(T).is(t.icon||t.$slots.icon?`icon`:`text`)])},[a(t.$slots,`icon`,{},()=>[t.icon?(d(),e(v(k),{key:0,class:y(v(T).e(`icon-inner`))},{default:m(()=>[(d(),e(b(t.icon)))]),_:1},8,[`class`])):v(I)===`success`?(d(),e(v(k),{key:1,class:y([v(T).e(`icon-inner`),v(T).is(`status`)])},{default:m(()=>[_(v(j))]),_:1},8,[`class`])):v(I)===`error`?(d(),e(v(k),{key:2,class:y([v(T).e(`icon-inner`),v(T).is(`status`)])},{default:m(()=>[_(v(N))]),_:1},8,[`class`])):v(V)?x(`v-if`,!0):(d(),c(`div`,{key:3,class:y(v(T).e(`icon-inner`))},f(E.value+1),3))])],2)],2),x(` title & description `),o(`div`,{class:y(v(T).e(`main`))},[o(`div`,{class:y([v(T).e(`title`),v(T).is(v(I))])},[a(t.$slots,`title`,{},()=>[i(f(t.title),1)])],2),v(V)?(d(),c(`div`,{key:0,class:y(v(T).e(`arrow`))},null,2)):(d(),c(`div`,{key:1,class:y([v(T).e(`description`),v(T).is(v(I))])},[a(t.$slots,`description`,{},()=>[i(f(t.description),1)])],2))],2)],6))}}),[[`__file`,`item.vue`]]),V=M(R,{Step:B}),H=O(B);export{V as n,H as t};