import{Yc as v,Zc as d}from"./cli-0.5.3-7skbwthe.mjs";import{Cf as B,Df as j,Ef as F,Gf as D}from"./cli-0.5.3-w5pe37b4.mjs";import{Nj as U,Oj as _,Rj as g,cH as y,dk as A,eH as P,ik as m,tm as I,xm as u}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 V,KW as G,nX as c,pV as T}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 W,PY as Z}from"./cli-0.5.3-vqmxwet2.mjs";import"./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"./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{gma as h,hla as R}from"./cli-0.5.3-qrvd6cmy.mjs";import"./cli-0.5.3-2dk1sk8w.mjs";import{Tma as C,Xma as N}from"./cli-0.5.3-0df3r78b.mjs";function $(z){let b=M.c(11),{planContent:H,planPath:K,editorName:J}=z,L;if(b[0]===Symbol.for("react.memo_cache_sentinel"))L=w(G,{bold:!0,children:"Current Plan"}),b[0]=L;else L=b[0];let k;if(b[1]!==K)k=w(G,{dimColor:!0,children:K}),b[1]=K,b[2]=k;else k=b[2];let q;if(b[3]!==H)q=w(V,{marginTop:1,children:w(G,{children:H})}),b[3]=H,b[4]=q;else q=b[4];let f;if(b[5]!==J)f=J&&W(V,{marginTop:1,children:[w(G,{dimColor:!0,children:'"/plan open"'}),w(G,{dimColor:!0,children:" to edit this plan in "}),w(G,{bold:!0,dimColor:!0,children:J})]}),b[5]=J,b[6]=f;else f=b[6];let O;if(b[7]!==k||b[8]!==q||b[9]!==f)O=W(V,{flexDirection:"column",children:[L,k,q,f]}),b[7]=k,b[8]=q,b[9]=f,b[10]=O;else O=b[10];return O}async function bb(z,b,H){let{getAppState:K,setAppState:J}=b,k=K().toolPermissionContext.mode;if(k!=="plan"){R(k,"plan"),J((Y)=>({...Y,toolPermissionContext:A(y(Y.toolPermissionContext),{type:"setMode",mode:"plan",destination:"session"})}));let Q=H.trim();if(Q&&Q!=="open")z("Enabled plan mode",{shouldQuery:!0});else z("Enabled plan mode");return null}let q=_(),f=U();if(!q)return z("Already in plan mode. No plan written yet."),null;if(H.trim().split(/\s+/)[0]==="open"){let Q=await F(f);if(Q.error)z(`Failed to open plan in editor: ${Q.error}`);else z(`Opened plan in editor: ${f}`);return null}let X=B(),S=X?I(X):void 0,E=await v(w($,{planContent:q,planPath:f,editorName:S}));return z(E),null}var M;var x=N(()=>{h();c();j();u();m();P();g();D();d();Z();M=C(T(),1)});x();export{bb as call};
