import{FD as A,HD as c,MD as O,ND as u,OD as _,PD as S,St as m,Wt as g,bm as f,cm as v}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 K,KW as Z,lX as C,nX as R,pV as D}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 G,OY as Y,PY as M}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{qfa as b,tfa as B,vfa as T}from"./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 P}from"./cli-0.5.3-0df3r78b.mjs";R();u();g();S();T();c();v();M();var h=P(D(),1);function p(J){let q=h.c(19),{filePath:L,errorDescription:Q,onExit:z,onReset:w}=J,k;if(q[0]!==z||q[1]!==w)k=(y)=>{if(y==="exit")z();else w()},q[0]=z,q[1]=w,q[2]=k;else k=q[2];let F=k,U;if(q[3]!==L)U=Y(Z,{children:["The configuration file at ",G(Z,{bold:!0,children:L})," contains invalid JSON."]}),q[3]=L,q[4]=U;else U=q[4];let V;if(q[5]!==Q)V=G(Z,{children:Q}),q[5]=Q,q[6]=V;else V=q[6];let W;if(q[7]!==U||q[8]!==V)W=Y(K,{flexDirection:"column",gap:1,children:[U,V]}),q[7]=U,q[8]=V,q[9]=W;else W=q[9];let H;if(q[10]===Symbol.for("react.memo_cache_sentinel"))H=G(Z,{bold:!0,children:"Choose an option:"}),q[10]=H;else H=q[10];let I;if(q[11]===Symbol.for("react.memo_cache_sentinel"))I=[{label:"Exit and fix manually",value:"exit"},{label:"Reset with default configuration",value:"reset"}],q[11]=I;else I=q[11];let X;if(q[12]!==F||q[13]!==z)X=Y(K,{flexDirection:"column",children:[H,G(A,{options:I,onChange:F,onCancel:z})]}),q[12]=F,q[13]=z,q[14]=X;else X=q[14];let N;if(q[15]!==z||q[16]!==W||q[17]!==X)N=Y(f,{title:"Configuration Error",color:"error",onCancel:z,children:[W,X]}),q[15]=z,q[16]=W,q[17]=X,q[18]=N;else N=q[18];return N}var d="dark";async function n({error:J}){let q={..._(!1),theme:d};await new Promise(async(L)=>{let{unmount:Q}=await C(G(m,{children:G(O,{children:G(p,{filePath:J.filePath,errorDescription:J.message,onExit:()=>{Q(),L(),process.exit(1)},onReset:()=>{B(J.filePath,b(J.defaultConfig,null,2),{flush:!1,encoding:"utf8"}),Q(),L(),process.exit(0)}})})}),q)})}export{n as showInvalidConfigDialog};
