import{FF as d,St as T,Wt as c,wF as P,xF as g,zF as m}from"./cli-0.5.3-jbzr8k4s.mjs";import"./cli-0.5.3-me9jkw92.mjs";import"./cli-0.5.3-bqmztzjc.mjs";import"./cli-0.5.3-ytqxzjff.mjs";import"./cli-0.5.3-h6n812td.mjs";import"./cli-0.5.3-hg8c6qbh.mjs";import"./cli-0.5.3-39jr2yrx.mjs";import"./cli-0.5.3-42e2paz8.mjs";import"./cli-0.5.3-mn45xfck.mjs";import"./cli-0.5.3-m884a3pk.mjs";import"./cli-0.5.3-4f9xxrem.mjs";import"./cli-0.5.3-gr8nsa2k.mjs";import"./cli-0.5.3-yj9nbd9d.mjs";import"./cli-0.5.3-55kd38ff.mjs";import"./cli-0.5.3-e6bjcfwg.mjs";import"./cli-0.5.3-4dbxtwh3.mjs";import"./cli-0.5.3-m0kfmb79.mjs";import"./cli-0.5.3-8zq9vdtg.mjs";import"./cli-0.5.3-vmx7agj7.mjs";import"./cli-0.5.3-h8xs2818.mjs";import"./cli-0.5.3-wcx7cnw5.mjs";import"./cli-0.5.3-9zbakvbf.mjs";import"./cli-0.5.3-hx550gz2.mjs";import{IW as D,KW as X,YW as h,nX as u,pV as S}from"./cli-0.5.3-842pf3t4.mjs";import"./cli-0.5.3-wxead1ct.mjs";import"./cli-0.5.3-s1hz35ye.mjs";import"./cli-0.5.3-g0svn6bx.mjs";import"./cli-0.5.3-sfdh3pkx.mjs";import"./cli-0.5.3-d8tjnxcj.mjs";import"./cli-0.5.3-6zfw1732.mjs";import"./cli-0.5.3-ptjdgcsy.mjs";import"./cli-0.5.3-tp3jye12.mjs";import{NY as w,OY as A,PY as _}from"./cli-0.5.3-vqmxwet2.mjs";import{QY as I}from"./cli-0.5.3-rch86nhn.mjs";import"./cli-0.5.3-zg2apr51.mjs";import"./cli-0.5.3-ngnshpb7.mjs";import"./cli-0.5.3-e58xste9.mjs";import"./cli-0.5.3-6163zevg.mjs";import"./cli-0.5.3-jmkkd5ph.mjs";import"./cli-0.5.3-1vt6twff.mjs";import"./cli-0.5.3-7017ez65.mjs";import"./cli-0.5.3-ea94acj4.mjs";import"./cli-0.5.3-3k22nqvy.mjs";import"./cli-0.5.3-63q4g3zt.mjs";import"./cli-0.5.3-dyhbm5kp.mjs";import"./cli-0.5.3-vpcrbd8n.mjs";import"./cli-0.5.3-jdw3ajfv.mjs";import"./cli-0.5.3-qg4a557t.mjs";import{I6 as O,J6 as j}from"./cli-0.5.3-t65dek0m.mjs";import"./cli-0.5.3-kavpx97n.mjs";import"./cli-0.5.3-9bdwhdys.mjs";import"./cli-0.5.3-ttc72eq3.mjs";import"./cli-0.5.3-g75gdzrp.mjs";import"./cli-0.5.3-1rg2r7n7.mjs";import"./cli-0.5.3-6j2jk6dt.mjs";import"./cli-0.5.3-66650sba.mjs";import"./cli-0.5.3-9vh3vpap.mjs";import"./cli-0.5.3-n3cxyxpg.mjs";import"./cli-0.5.3-kbvzmaax.mjs";import"./cli-0.5.3-7wdgps7z.mjs";import"./cli-0.5.3-c8bcrqa4.mjs";import"./cli-0.5.3-qrvd6cmy.mjs";import"./cli-0.5.3-2dk1sk8w.mjs";import{Tma as C}from"./cli-0.5.3-0df3r78b.mjs";j();u();c();d();_();var f=C(S(),1),l=C(I(),1),N=["◐","◓","◑","◒"],b=[{key:"validating",label:"Validating session"},{key:"fetching_logs",label:"Fetching session logs"},{key:"fetching_branch",label:"Getting branch info"},{key:"checking_out",label:"Checking out branch"}];function x(B){let q=f.c(16),{currentStep:y,sessionId:G}=B,[H,E]=h(100),J=Math.floor(E/100)%N.length,K;if(q[0]!==y)K=(Z)=>Z.key===y,q[0]=y,q[1]=K;else K=q[1];let z=b.findIndex(K),F=N[J],L;if(q[2]!==F)L=w(D,{marginBottom:1,children:A(X,{bold:!0,color:"claude",children:[F," Teleporting session…"]})}),q[2]=F,q[3]=L;else L=q[3];let Q;if(q[4]!==G)Q=G&&w(D,{marginBottom:1,children:w(X,{dimColor:!0,children:G})}),q[4]=G,q[5]=Q;else Q=q[5];let U;if(q[6]!==z||q[7]!==J)U=b.map((Z,M)=>{let a=M<z,R=M===z,W=M>z,k,v;if(a)k=O.tick,v="green";else if(R)k=N[J],v="claude";else k=O.circle,v=void 0;return A(D,{flexDirection:"row",children:[w(D,{width:2,children:w(X,{color:v,dimColor:W,children:k})}),w(X,{dimColor:W,bold:R,children:Z.label})]},Z.key)}),q[6]=z,q[7]=J,q[8]=U;else U=q[8];let V;if(q[9]!==U)V=w(D,{flexDirection:"column",marginLeft:2,children:U}),q[9]=U,q[10]=V;else V=q[10];let Y;if(q[11]!==H||q[12]!==L||q[13]!==Q||q[14]!==V)Y=A(D,{ref:H,flexDirection:"column",paddingX:1,paddingY:1,children:[L,Q,V]}),q[11]=H,q[12]=L,q[13]=Q,q[14]=V,q[15]=Y;else Y=q[15];return Y}async function n(B,q){let y=()=>{};function G(){let[K,z]=l.useState("validating");return y=z,w(x,{currentStep:K,sessionId:q})}B.render(w(T,{children:w(G,{})}));let H=await m(q,y);y("checking_out");let{branchName:E,branchError:J}=await g(H.branch);return{messages:P(H.log,J),branchName:E}}export{n as teleportWithProgress,x as TeleportProgress};
