ts-pantry 0.9.27 → 0.9.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/bin/cli.js +23 -21
  2. package/dist/{chunk-xkm30wah.js → chunk-0kzq4gm1.js} +1 -1
  3. package/dist/chunk-2x2qwr6b.js +282 -0
  4. package/dist/{chunk-hkhtfzwy.js → chunk-3a72qsn8.js} +1 -1
  5. package/dist/{chunk-t8296krc.js → chunk-4njvss8n.js} +1 -1
  6. package/dist/{chunk-jym7xrra.js → chunk-75fe09w8.js} +1 -1
  7. package/dist/{chunk-p7w7tqad.js → chunk-a80z089c.js} +2 -2
  8. package/dist/{chunk-9f0255fc.js → chunk-dd37211m.js} +1 -1
  9. package/dist/chunk-g3x5taq8.js +2 -0
  10. package/dist/{chunk-k4yefwkp.js → chunk-gyn0s28q.js} +1 -1
  11. package/dist/chunk-hr4kt0yv.js +1 -0
  12. package/dist/{chunk-p9e5z92g.js → chunk-m07cv1kh.js} +1 -1
  13. package/dist/{chunk-y5rfbg9v.js → chunk-mfks4nam.js} +2 -2
  14. package/dist/chunk-pyj7ehbb.js +1 -0
  15. package/dist/{chunk-yjz3e391.js → chunk-rjpqpn2z.js} +1 -1
  16. package/dist/{chunk-q7s2k65w.js → chunk-s0s1vx8j.js} +2 -2
  17. package/dist/{chunk-cdzdw53j.js → chunk-tvga6vs0.js} +4 -4
  18. package/dist/chunk-xkqrwk69.js +1 -0
  19. package/dist/index.d.ts +15 -0
  20. package/dist/installer.d.ts +10 -0
  21. package/dist/packages/casdoororg.d.ts +1 -1
  22. package/dist/packages/chompbuildcom.d.ts +1 -1
  23. package/dist/packages/circlecicom.d.ts +1 -1
  24. package/dist/packages/daytonaio.d.ts +1 -1
  25. package/dist/packages/dozzledev.d.ts +1 -1
  26. package/dist/packages/flyio.d.ts +1 -1
  27. package/dist/packages/jujuis.d.ts +1 -1
  28. package/dist/packages/misejdxdev.d.ts +1 -1
  29. package/dist/packages/odigosio.d.ts +1 -1
  30. package/dist/packages/opencodeai.d.ts +1 -1
  31. package/dist/packages/packerio.d.ts +1 -1
  32. package/dist/packages/pipenvpypaio.d.ts +1 -1
  33. package/dist/packages/pocketbaseio.d.ts +1 -1
  34. package/dist/packages/railwayapp.d.ts +1 -1
  35. package/dist/packages/rebar3org.d.ts +1 -1
  36. package/dist/packages/redisio.d.ts +1 -1
  37. package/dist/packages/seaweedfscom.d.ts +1 -1
  38. package/dist/packages/squawkhqcom.d.ts +1 -1
  39. package/dist/packages/talosdev.d.ts +1 -1
  40. package/dist/packages/terragruntgruntworkio.d.ts +1 -1
  41. package/dist/packages/uriparsergithubio.d.ts +1 -1
  42. package/dist/packages/vclustercom.d.ts +1 -1
  43. package/dist/shell-init.d.ts +36 -0
  44. package/dist/src/index.js +1 -1
  45. package/package.json +1 -1
  46. package/dist/chunk-2nfjspwd.js +0 -1
  47. package/dist/chunk-69bvg2k8.js +0 -275
  48. package/dist/chunk-h8phykmh.js +0 -1
  49. package/dist/chunk-qaawtmzb.js +0 -1
  50. package/dist/chunk-wwf5bgbg.js +0 -2
package/dist/bin/cli.js CHANGED
@@ -1,25 +1,25 @@
1
- import{M as f6,N as g6,R as K6,S as u6,T as m6}from"../chunk-69bvg2k8.js";import"../chunk-xkm30wah.js";import{La as i,Ma as _6,Oa as G6,Pa as p,Ua as d6,Ya as U6}from"../chunk-cdzdw53j.js";import"../chunk-y5rfbg9v.js";import{lb as a,mb as J6,nb as q6}from"../chunk-jym7xrra.js";import"../chunk-p7w7tqad.js";import"../chunk-wwf5bgbg.js";import{Hb as h6,Ib as iz}from"../chunk-q7s2k65w.js";import"../chunk-p9e5z92g.js";import{Pb as f}from"../chunk-yjz3e391.js";import W from"node:fs";import R from"node:path";import L from"node:process";import{EventEmitter as t6}from"node:events";import F6 from"node:process";import o from"node:process";import m from"node:process";import Uz,{stdin as J0,stdout as q0}from"node:process";import w6,{stdin as Hz,stdout as Vz}from"node:process";import Fz from"node:readline";var{create:n6,getPrototypeOf:c6,defineProperty:V6,getOwnPropertyNames:a6}=Object,i6=Object.prototype.hasOwnProperty,I=(z,$,Q)=>{Q=z!=null?n6(c6(z)):{};let Z=$||!z||!z.__esModule?V6(Q,"default",{value:z,enumerable:!0}):Q;for(let Y of a6(z))if(!i6.call(Z,Y))V6(Z,Y,{get:()=>z[Y],enumerable:!0});return Z},z6=(z,$)=>()=>($||z(($={exports:{}}).exports,$),$.exports),p6=z6((z,$)=>{function Q(Y){return Y==null?[]:Array.isArray(Y)?Y:[Y]}function Z(Y,X,J,q){var j,G=Y[X],K=~q.string.indexOf(X)?J==null||J===!0?"":String(J):typeof J==="boolean"?J:~q.boolean.indexOf(X)?J==="false"?!1:J==="true"||(Y._.push((j=+J,j*0===0)?j:J),!!J):(j=+J,j*0===0)?j:J;Y[X]=G==null?K:Array.isArray(G)?G.concat(K):[G,K]}$.exports=function(Y,X){Y=Y||[],X=X||{};var J,q,j,G,K,V={_:[]},U=0,F=0,H=0,O=Y.length;let b=X.alias!==void 0,M=X.unknown!==void 0,D=X.default!==void 0;if(X.alias=X.alias||{},X.string=Q(X.string),X.boolean=Q(X.boolean),b)for(J in X.alias){q=X.alias[J]=Q(X.alias[J]);for(U=0;U<q.length;U++)(X.alias[q[U]]=q.concat(J)).splice(U,1)}for(U=X.boolean.length;U-- >0;){q=X.alias[X.boolean[U]]||[];for(F=q.length;F-- >0;)X.boolean.push(q[F])}for(U=X.string.length;U-- >0;){q=X.alias[X.string[U]]||[];for(F=q.length;F-- >0;)X.string.push(q[F])}if(D){for(J in X.default)if(G=typeof X.default[J],q=X.alias[J]=X.alias[J]||[],X[G]!==void 0){X[G].push(J);for(U=0;U<q.length;U++)X[G].push(q[U])}}let w=M?Object.keys(X.alias):[];for(U=0;U<O;U++){if(j=Y[U],j==="--"){V._=V._.concat(Y.slice(++U));break}for(F=0;F<j.length;F++)if(j.charCodeAt(F)!==45)break;if(F===0)V._.push(j);else if(j.substring(F,F+3)==="no-"){if(G=j.substring(F+3),M&&!~w.indexOf(G))return X.unknown(j);V[G]=!1}else{for(H=F+1;H<j.length;H++)if(j.charCodeAt(H)===61)break;G=j.substring(F,H),K=j.substring(++H)||(U+1===O||(""+Y[U+1]).charCodeAt(0)===45||Y[++U]),q=F===2?[G]:G;for(H=0;H<q.length;H++){if(G=q[H],M&&!~w.indexOf(G))return X.unknown("-".repeat(F)+G);Z(V,G,H+1<q.length||K,X)}}}if(D){for(J in X.default)if(V[J]===void 0)V[J]=X.default[J]}if(b)for(J in V){q=X.alias[J]||[];while(q.length>0)V[q.shift()]=V[J]}return V}}),C=z6((z,$)=>{var Q=process||{},Z=Q.argv||[],Y=Q.env||{},X=!(!!Y.NO_COLOR||Z.includes("--no-color"))&&(!!Y.FORCE_COLOR||Z.includes("--color")||Q.platform==="win32"||(Q.stdout||{}).isTTY&&Y.TERM!=="dumb"||!!Y.CI),J=(G,K,V=G)=>(U)=>{let F=""+U,H=F.indexOf(K,G.length);return~H?G+q(F,K,V,H)+K:G+F+K},q=(G,K,V,U)=>{let F="",H=0;do F+=G.substring(H,U)+V,H=U+K.length,U=G.indexOf(K,H);while(~U);return F+G.substring(H)},j=(G=X)=>{let K=G?J:()=>String;return{isColorSupported:G,reset:K("\x1B[0m","\x1B[0m"),bold:K("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:K("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:K("\x1B[3m","\x1B[23m"),underline:K("\x1B[4m","\x1B[24m"),inverse:K("\x1B[7m","\x1B[27m"),hidden:K("\x1B[8m","\x1B[28m"),strikethrough:K("\x1B[9m","\x1B[29m"),black:K("\x1B[30m","\x1B[39m"),red:K("\x1B[31m","\x1B[39m"),green:K("\x1B[32m","\x1B[39m"),yellow:K("\x1B[33m","\x1B[39m"),blue:K("\x1B[34m","\x1B[39m"),magenta:K("\x1B[35m","\x1B[39m"),cyan:K("\x1B[36m","\x1B[39m"),white:K("\x1B[37m","\x1B[39m"),gray:K("\x1B[90m","\x1B[39m"),bgBlack:K("\x1B[40m","\x1B[49m"),bgRed:K("\x1B[41m","\x1B[49m"),bgGreen:K("\x1B[42m","\x1B[49m"),bgYellow:K("\x1B[43m","\x1B[49m"),bgBlue:K("\x1B[44m","\x1B[49m"),bgMagenta:K("\x1B[45m","\x1B[49m"),bgCyan:K("\x1B[46m","\x1B[49m"),bgWhite:K("\x1B[47m","\x1B[49m"),blackBright:K("\x1B[90m","\x1B[39m"),redBright:K("\x1B[91m","\x1B[39m"),greenBright:K("\x1B[92m","\x1B[39m"),yellowBright:K("\x1B[93m","\x1B[39m"),blueBright:K("\x1B[94m","\x1B[39m"),magentaBright:K("\x1B[95m","\x1B[39m"),cyanBright:K("\x1B[96m","\x1B[39m"),whiteBright:K("\x1B[97m","\x1B[39m"),bgBlackBright:K("\x1B[100m","\x1B[49m"),bgRedBright:K("\x1B[101m","\x1B[49m"),bgGreenBright:K("\x1B[102m","\x1B[49m"),bgYellowBright:K("\x1B[103m","\x1B[49m"),bgBlueBright:K("\x1B[104m","\x1B[49m"),bgMagentaBright:K("\x1B[105m","\x1B[49m"),bgCyanBright:K("\x1B[106m","\x1B[49m"),bgWhiteBright:K("\x1B[107m","\x1B[49m")}};$.exports=j(),$.exports.createColors=j}),r6=z6((z,$)=>{$.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}}),s6=I(p6(),1);function I6(z){return z.replace(/[<[].+/,"").trim()}function e6(z){let $=/<([^>]+)>/g,Q=/\[([^\]]+)\]/g,Z=[],Y=(q)=>{let j=!1,G=q[1];if(G.startsWith("..."))G=G.slice(3),j=!0;return{required:q[0].startsWith("<"),value:G,variadic:j}},X;while(X=$.exec(z))Z.push(Y(X));let J;while(J=Q.exec(z))Z.push(Y(J));return Z}function o6(z){let $={alias:{},boolean:[]};for(let[Q,Z]of z.entries()){if(Z.names.length>1)$.alias[Z.names[0]]=Z.names.slice(1);if(Z.isBoolean)if(Z.negated){if(!z.some((X,J)=>{return J!==Q&&X.names.some((q)=>Z.names.includes(q))&&typeof X.required==="boolean"}))$.boolean.push(Z.names[0])}else $.boolean.push(Z.names[0])}return $}function W6(z){return z.sort(($,Q)=>{return $.length>Q.length?-1:1})[0]}function L6(z,$){return z.length>=$?z:`${z}${" ".repeat($-z.length)}`}function zz(z){return z.replace(/([a-z])-([a-z])/g,($,Q,Z)=>{return Q+Z.toUpperCase()})}function $z(z,$,Q){let Z=0,Y=$.length,X=z,J;for(;Z<Y;++Z)J=X[$[Z]],X=X[$[Z]]=Z===Y-1?Q:J!=null?J:!!~$[Z+1].indexOf(".")||!(+$[Z+1]>-1)?{}:[]}function Qz(z,$){for(let Q of Object.keys($)){let Z=$[Q];if(Z.shouldTransform){if(z[Q]=Array.prototype.concat.call([],z[Q]),typeof Z.transformFunction==="function")z[Q]=z[Q].map(Z.transformFunction)}}}function Zz(z){let $=/([^\\/]+)$/.exec(z);return $?$[1]:""}function R6(z){return z.split(".").map(($,Q)=>{return Q===0?zz($):$}).join(".")}class u extends Error{constructor(z){super(z);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(z).stack}}function Yz(){let{env:z}=F6,{TERM:$,TERM_PROGRAM:Q}=z;if(F6.platform!=="win32")return $!=="linux";return Boolean(z.WT_SESSION)||Boolean(z.TERMINUS_SUBLIME)||z.ConEmuTask==="{cmd::Cmder}"||Q==="Terminus-Sublime"||Q==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var l="\x1B",E=`${l}[`;var S={to(z,$){if(!$)return`${E}${z+1}G`;return`${E}${$+1};${z+1}H`},move(z,$){let Q="";if(z<0)Q+=`${E}${-z}D`;else if(z>0)Q+=`${E}${z}C`;if($<0)Q+=`${E}${-$}A`;else if($>0)Q+=`${E}${$}B`;return Q},up:(z=1)=>`${E}${z}A`,down:(z=1)=>`${E}${z}B`,forward:(z=1)=>`${E}${z}C`,backward:(z=1)=>`${E}${z}D`,nextLine:(z=1)=>`${E}E`.repeat(z),prevLine:(z=1)=>`${E}F`.repeat(z),left:`${E}G`,hide:`${E}?25l`,show:`${E}?25h`,save:`${l}7`,restore:`${l}8`};var r={screen:`${E}2J`,up:(z=1)=>`${E}1J`.repeat(z),down:(z=1)=>`${E}J`.repeat(z),line:`${E}2K`,lineEnd:`${E}K`,lineStart:`${E}1K`,lines(z){let $="";for(let Q=0;Q<z;Q++)$+=this.line+(Q<z-1?S.up():"");if(z)$+=S.left;return $}},z0={screen:`${l}c`};class E6{rawName;description;name;names;isBoolean;required;config;negated;constructor(z,$,Q){if(this.rawName=z,this.description=$,this.config=Object.assign({},Q),z=z.replace(/\.\*/g,""),this.negated=!1,this.names=I6(z).split(",").map((Z)=>{let Y=Z.trim().replace(/^-{1,2}/,"");if(Y.startsWith("no-"))this.negated=!0,Y=Y.replace(/^no-/,"");return R6(Y)}).sort((Z,Y)=>Z.length>Y.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(z.includes("<"))this.required=!0;else if(z.includes("["))this.required=!1;else this.isBoolean=!0}}var Q0=o.argv,Xz=`${o.platform}-${o.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,Jz=m.argv,qz=`${m.platform}-${m.arch} node-${m.version}`;class $6{rawName;description;config;cli;options;aliasNames;name;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;constructor(z,$,Q,Z){if(this.rawName=z,this.description=$,this.config=Q,this.cli=Z,this.options=[],this.aliasNames=[],this.name=I6(z),this.args=e6(z),this.examples=[],!Q)this.config={}}usage(z){return this.usageText=z,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(z,$="-v, --version"){return this.versionNumber=z,this.option($,"Display version number"),this}example(z){return this.examples.push(z),this}option(z,$,Q){let Z=new E6(z,$,Q);return this.options.push(Z),this}alias(z){return this.aliasNames.push(z),this}action(z){return this.commandAction=z,this}isMatched(z){return this.name===z||this.aliasNames.includes(z)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof Q6}hasOption(z){return z=z.split(".")[0],!!this.options.find(($)=>{return $.names.includes(z)})}outputHelp(){let{name:z,commands:$}=this.cli,{versionNumber:Q,options:Z,helpCallback:Y}=this.cli.globalCommand,X=[{body:`${z}${Q?`/${Q}`:""}`}];if(X.push({title:"Usage",body:` $ ${z} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&$.length>0){let j=W6($.map((G)=>G.rawName));X.push({title:"Commands",body:$.map((G)=>{return` ${L6(G.rawName,j.length)} ${G.description}`}).join(`
1
+ import{L as f6,M as g6,N as _6,P as d6,V as u6,W as m6,X as x6,Y as l6,Z as n6,ba as K6,ca as i6,da as p6}from"../chunk-2x2qwr6b.js";import"../chunk-0kzq4gm1.js";import{Ra as i,Sa as c6,Ua as G6,Va as p,_a as a6,cb as U6}from"../chunk-tvga6vs0.js";import"../chunk-mfks4nam.js";import{rb as a,sb as J6,tb as q6}from"../chunk-75fe09w8.js";import"../chunk-a80z089c.js";import"../chunk-g3x5taq8.js";import{Nb as h6,Ob as z0}from"../chunk-s0s1vx8j.js";import"../chunk-m07cv1kh.js";import{Vb as f}from"../chunk-rjpqpn2z.js";import L from"node:fs";import b from"node:path";import F from"node:process";import{EventEmitter as Yz}from"node:events";import W6 from"node:process";import o from"node:process";import m from"node:process";import Lz,{stdin as V0,stdout as W0}from"node:process";import w6,{stdin as Oz,stdout as Bz}from"node:process";import Dz from"node:readline";var{create:t6,getPrototypeOf:e6,defineProperty:V6,getOwnPropertyNames:o6}=Object,zz=Object.prototype.hasOwnProperty,R=(z,$,Q)=>{Q=z!=null?t6(e6(z)):{};let Z=$||!z||!z.__esModule?V6(Q,"default",{value:z,enumerable:!0}):Q;for(let Y of o6(z))if(!zz.call(Z,Y))V6(Z,Y,{get:()=>z[Y],enumerable:!0});return Z},z6=(z,$)=>()=>($||z(($={exports:{}}).exports,$),$.exports),$z=z6((z,$)=>{function Q(Y){return Y==null?[]:Array.isArray(Y)?Y:[Y]}function Z(Y,X,J,q){var j,G=Y[X],K=~q.string.indexOf(X)?J==null||J===!0?"":String(J):typeof J==="boolean"?J:~q.boolean.indexOf(X)?J==="false"?!1:J==="true"||(Y._.push((j=+J,j*0===0)?j:J),!!J):(j=+J,j*0===0)?j:J;Y[X]=G==null?K:Array.isArray(G)?G.concat(K):[G,K]}$.exports=function(Y,X){Y=Y||[],X=X||{};var J,q,j,G,K,V={_:[]},U=0,W=0,H=0,O=Y.length;let N=X.alias!==void 0,M=X.unknown!==void 0,D=X.default!==void 0;if(X.alias=X.alias||{},X.string=Q(X.string),X.boolean=Q(X.boolean),N)for(J in X.alias){q=X.alias[J]=Q(X.alias[J]);for(U=0;U<q.length;U++)(X.alias[q[U]]=q.concat(J)).splice(U,1)}for(U=X.boolean.length;U-- >0;){q=X.alias[X.boolean[U]]||[];for(W=q.length;W-- >0;)X.boolean.push(q[W])}for(U=X.string.length;U-- >0;){q=X.alias[X.string[U]]||[];for(W=q.length;W-- >0;)X.string.push(q[W])}if(D){for(J in X.default)if(G=typeof X.default[J],q=X.alias[J]=X.alias[J]||[],X[G]!==void 0){X[G].push(J);for(U=0;U<q.length;U++)X[G].push(q[U])}}let w=M?Object.keys(X.alias):[];for(U=0;U<O;U++){if(j=Y[U],j==="--"){V._=V._.concat(Y.slice(++U));break}for(W=0;W<j.length;W++)if(j.charCodeAt(W)!==45)break;if(W===0)V._.push(j);else if(j.substring(W,W+3)==="no-"){if(G=j.substring(W+3),M&&!~w.indexOf(G))return X.unknown(j);V[G]=!1}else{for(H=W+1;H<j.length;H++)if(j.charCodeAt(H)===61)break;G=j.substring(W,H),K=j.substring(++H)||(U+1===O||(""+Y[U+1]).charCodeAt(0)===45||Y[++U]),q=W===2?[G]:G;for(H=0;H<q.length;H++){if(G=q[H],M&&!~w.indexOf(G))return X.unknown("-".repeat(W)+G);Z(V,G,H+1<q.length||K,X)}}}if(D){for(J in X.default)if(V[J]===void 0)V[J]=X.default[J]}if(N)for(J in V){q=X.alias[J]||[];while(q.length>0)V[q.shift()]=V[J]}return V}}),C=z6((z,$)=>{var Q=process||{},Z=Q.argv||[],Y=Q.env||{},X=!(!!Y.NO_COLOR||Z.includes("--no-color"))&&(!!Y.FORCE_COLOR||Z.includes("--color")||Q.platform==="win32"||(Q.stdout||{}).isTTY&&Y.TERM!=="dumb"||!!Y.CI),J=(G,K,V=G)=>(U)=>{let W=""+U,H=W.indexOf(K,G.length);return~H?G+q(W,K,V,H)+K:G+W+K},q=(G,K,V,U)=>{let W="",H=0;do W+=G.substring(H,U)+V,H=U+K.length,U=G.indexOf(K,H);while(~U);return W+G.substring(H)},j=(G=X)=>{let K=G?J:()=>String;return{isColorSupported:G,reset:K("\x1B[0m","\x1B[0m"),bold:K("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:K("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:K("\x1B[3m","\x1B[23m"),underline:K("\x1B[4m","\x1B[24m"),inverse:K("\x1B[7m","\x1B[27m"),hidden:K("\x1B[8m","\x1B[28m"),strikethrough:K("\x1B[9m","\x1B[29m"),black:K("\x1B[30m","\x1B[39m"),red:K("\x1B[31m","\x1B[39m"),green:K("\x1B[32m","\x1B[39m"),yellow:K("\x1B[33m","\x1B[39m"),blue:K("\x1B[34m","\x1B[39m"),magenta:K("\x1B[35m","\x1B[39m"),cyan:K("\x1B[36m","\x1B[39m"),white:K("\x1B[37m","\x1B[39m"),gray:K("\x1B[90m","\x1B[39m"),bgBlack:K("\x1B[40m","\x1B[49m"),bgRed:K("\x1B[41m","\x1B[49m"),bgGreen:K("\x1B[42m","\x1B[49m"),bgYellow:K("\x1B[43m","\x1B[49m"),bgBlue:K("\x1B[44m","\x1B[49m"),bgMagenta:K("\x1B[45m","\x1B[49m"),bgCyan:K("\x1B[46m","\x1B[49m"),bgWhite:K("\x1B[47m","\x1B[49m"),blackBright:K("\x1B[90m","\x1B[39m"),redBright:K("\x1B[91m","\x1B[39m"),greenBright:K("\x1B[92m","\x1B[39m"),yellowBright:K("\x1B[93m","\x1B[39m"),blueBright:K("\x1B[94m","\x1B[39m"),magentaBright:K("\x1B[95m","\x1B[39m"),cyanBright:K("\x1B[96m","\x1B[39m"),whiteBright:K("\x1B[97m","\x1B[39m"),bgBlackBright:K("\x1B[100m","\x1B[49m"),bgRedBright:K("\x1B[101m","\x1B[49m"),bgGreenBright:K("\x1B[102m","\x1B[49m"),bgYellowBright:K("\x1B[103m","\x1B[49m"),bgBlueBright:K("\x1B[104m","\x1B[49m"),bgMagentaBright:K("\x1B[105m","\x1B[49m"),bgCyanBright:K("\x1B[106m","\x1B[49m"),bgWhiteBright:K("\x1B[107m","\x1B[49m")}};$.exports=j(),$.exports.createColors=j}),Qz=z6((z,$)=>{$.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}}),Zz=R($z(),1);function I6(z){return z.replace(/[<[].+/,"").trim()}function Xz(z){let $=/<([^>]+)>/g,Q=/\[([^\]]+)\]/g,Z=[],Y=(q)=>{let j=!1,G=q[1];if(G.startsWith("..."))G=G.slice(3),j=!0;return{required:q[0].startsWith("<"),value:G,variadic:j}},X;while(X=$.exec(z))Z.push(Y(X));let J;while(J=Q.exec(z))Z.push(Y(J));return Z}function Jz(z){let $={alias:{},boolean:[]};for(let[Q,Z]of z.entries()){if(Z.names.length>1)$.alias[Z.names[0]]=Z.names.slice(1);if(Z.isBoolean)if(Z.negated){if(!z.some((X,J)=>{return J!==Q&&X.names.some((q)=>Z.names.includes(q))&&typeof X.required==="boolean"}))$.boolean.push(Z.names[0])}else $.boolean.push(Z.names[0])}return $}function F6(z){return z.sort(($,Q)=>{return $.length>Q.length?-1:1})[0]}function L6(z,$){return z.length>=$?z:`${z}${" ".repeat($-z.length)}`}function qz(z){return z.replace(/([a-z])-([a-z])/g,($,Q,Z)=>{return Q+Z.toUpperCase()})}function Gz(z,$,Q){let Z=0,Y=$.length,X=z,J;for(;Z<Y;++Z)J=X[$[Z]],X=X[$[Z]]=Z===Y-1?Q:J!=null?J:!!~$[Z+1].indexOf(".")||!(+$[Z+1]>-1)?{}:[]}function Uz(z,$){for(let Q of Object.keys($)){let Z=$[Q];if(Z.shouldTransform){if(z[Q]=Array.prototype.concat.call([],z[Q]),typeof Z.transformFunction==="function")z[Q]=z[Q].map(Z.transformFunction)}}}function Kz(z){let $=/([^\\/]+)$/.exec(z);return $?$[1]:""}function R6(z){return z.split(".").map(($,Q)=>{return Q===0?qz($):$}).join(".")}class u extends Error{constructor(z){super(z);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(z).stack}}function jz(){let{env:z}=W6,{TERM:$,TERM_PROGRAM:Q}=z;if(W6.platform!=="win32")return $!=="linux";return Boolean(z.WT_SESSION)||Boolean(z.TERMINUS_SUBLIME)||z.ConEmuTask==="{cmd::Cmder}"||Q==="Terminus-Sublime"||Q==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var l="\x1B",E=`${l}[`;var S={to(z,$){if(!$)return`${E}${z+1}G`;return`${E}${$+1};${z+1}H`},move(z,$){let Q="";if(z<0)Q+=`${E}${-z}D`;else if(z>0)Q+=`${E}${z}C`;if($<0)Q+=`${E}${-$}A`;else if($>0)Q+=`${E}${$}B`;return Q},up:(z=1)=>`${E}${z}A`,down:(z=1)=>`${E}${z}B`,forward:(z=1)=>`${E}${z}C`,backward:(z=1)=>`${E}${z}D`,nextLine:(z=1)=>`${E}E`.repeat(z),prevLine:(z=1)=>`${E}F`.repeat(z),left:`${E}G`,hide:`${E}?25l`,show:`${E}?25h`,save:`${l}7`,restore:`${l}8`};var r={screen:`${E}2J`,up:(z=1)=>`${E}1J`.repeat(z),down:(z=1)=>`${E}J`.repeat(z),line:`${E}2K`,lineEnd:`${E}K`,lineStart:`${E}1K`,lines(z){let $="";for(let Q=0;Q<z;Q++)$+=this.line+(Q<z-1?S.up():"");if(z)$+=S.left;return $}},q0={screen:`${l}c`};class E6{rawName;description;name;names;isBoolean;required;config;negated;constructor(z,$,Q){if(this.rawName=z,this.description=$,this.config=Object.assign({},Q),z=z.replace(/\.\*/g,""),this.negated=!1,this.names=I6(z).split(",").map((Z)=>{let Y=Z.trim().replace(/^-{1,2}/,"");if(Y.startsWith("no-"))this.negated=!0,Y=Y.replace(/^no-/,"");return R6(Y)}).sort((Z,Y)=>Z.length>Y.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(z.includes("<"))this.required=!0;else if(z.includes("["))this.required=!1;else this.isBoolean=!0}}var U0=o.argv,Hz=`${o.platform}-${o.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,Vz=m.argv,Wz=`${m.platform}-${m.arch} node-${m.version}`;class $6{rawName;description;config;cli;options;aliasNames;name;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;constructor(z,$,Q,Z){if(this.rawName=z,this.description=$,this.config=Q,this.cli=Z,this.options=[],this.aliasNames=[],this.name=I6(z),this.args=Xz(z),this.examples=[],!Q)this.config={}}usage(z){return this.usageText=z,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(z,$="-v, --version"){return this.versionNumber=z,this.option($,"Display version number"),this}example(z){return this.examples.push(z),this}option(z,$,Q){let Z=new E6(z,$,Q);return this.options.push(Z),this}alias(z){return this.aliasNames.push(z),this}action(z){return this.commandAction=z,this}isMatched(z){return this.name===z||this.aliasNames.includes(z)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof Q6}hasOption(z){return z=z.split(".")[0],!!this.options.find(($)=>{return $.names.includes(z)})}outputHelp(){let{name:z,commands:$}=this.cli,{versionNumber:Q,options:Z,helpCallback:Y}=this.cli.globalCommand,X=[{body:`${z}${Q?`/${Q}`:""}`}];if(X.push({title:"Usage",body:` $ ${z} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&$.length>0){let j=F6($.map((G)=>G.rawName));X.push({title:"Commands",body:$.map((G)=>{return` ${L6(G.rawName,j.length)} ${G.description}`}).join(`
2
2
  `)}),X.push({title:"For more info, run any command with the `--help` flag",body:$.map((G)=>` $ ${z}${G.name===""?"":` ${G.name}`} --help`).join(`
3
- `)})}let q=this.isGlobalCommand?Z:[...this.options,...Z||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)q=q.filter((j)=>j.name!=="version");if(q.length>0){let j=W6(q.map((G)=>G.rawName));X.push({title:"Options",body:q.map((G)=>{return` ${L6(G.rawName,j.length)} ${G.description} ${G.config.default===void 0?"":`(default: ${G.config.default})`}`}).join(`
3
+ `)})}let q=this.isGlobalCommand?Z:[...this.options,...Z||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)q=q.filter((j)=>j.name!=="version");if(q.length>0){let j=F6(q.map((G)=>G.rawName));X.push({title:"Options",body:q.map((G)=>{return` ${L6(G.rawName,j.length)} ${G.description} ${G.config.default===void 0?"":`(default: ${G.config.default})`}`}).join(`
4
4
  `)})}if(this.examples.length>0)X.push({title:"Examples",body:this.examples.map((j)=>{if(typeof j==="function")return j(z);return j}).join(`
5
5
  `)});if(Y)X=Y(X)||X;console.log(X.map((j)=>{return j.title?`${j.title}:
6
6
  ${j.body}`:j.body}).join(`
7
7
 
8
- `))}outputVersion(){let{name:z}=this.cli,{versionNumber:$}=this.cli.globalCommand;if($){let Q;if(Bun)Q=Xz;else Q=qz;console.log(`${z}/${$} ${Q}`)}}checkRequiredArgs(){let z=this.args.filter(($)=>$.required).length;if(this.cli.args.length<z)throw new u(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:z,globalCommand:$}=this.cli;if(!this.config.allowUnknownOptions){for(let Q of Object.keys(z))if(Q!=="--"&&!this.hasOption(Q)&&!$.hasOption(Q))throw new u(`Unknown option \`${Q.length>1?`--${Q}`:`-${Q}`}\``)}}checkOptionValue(){let{options:z,globalCommand:$}=this.cli,Q=[...$.options,...this.options];for(let Z of Q){let Y=z[Z.name.split(".")[0]];if(Z.required){let X=Q.some((J)=>J.negated&&J.names.includes(Z.name));if(Y===!0||Y===!1&&!X)throw new u(`option \`${Z.rawName}\` value is missing`)}}}}class Q6 extends $6{constructor(z){super("@@global@@","",{},z)}}var Gz=$6;class Z6 extends t6{name;commands;globalCommand;matchedCommand;matchedCommandName;rawArgs;args;options;showHelpOnExit;showVersionOnExit;constructor(z=""){super();this.name=z,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new Q6(this),this.globalCommand.usage("<command> [options]")}usage(z){return this.globalCommand.usage(z),this}command(z,$,Q){if(!Q)Q={};let Z=new Gz(z,$||"",Q,this);return Z.globalCommand=this.globalCommand,this.commands.push(Z),Z}option(z,$,Q){return this.globalCommand.option(z,$,Q),this}help(z){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=z,this.showHelpOnExit=!0,this}version(z,$="-v, --version"){return this.globalCommand.version(z,$),this.showVersionOnExit=!0,this}example(z){return this.globalCommand.example(z),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:z,options:$},Q,Z){if(this.args=z,this.options=$,Q)this.matchedCommand=Q;if(Z)this.matchedCommandName=Z;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(z=Jz,{run:$=!0}={}){if(this.rawArgs=z,!this.name)this.name=z[1]?Zz(z[1]):"cli";let Q=!0;for(let Y of this.commands){let X=this.mri(z.slice(2),Y),J=X.args[0];if(Y.isMatched(J)){Q=!1;let q={...X,args:X.args.slice(1)};this.setParsedInfo(q,Y,J),this.emit(`command:${J}`,Y)}}if(Q){for(let Y of this.commands)if(Y.name===""){Q=!1;let X=this.mri(z.slice(2),Y);this.setParsedInfo(X,Y),this.emit("command:!",Y)}}if(Q){let Y=this.mri(z.slice(2));this.setParsedInfo(Y)}if(this.options.help&&this.showHelpOnExit)this.outputHelp(),$=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),$=!1,this.unsetMatchedCommand();let Z={args:this.args,options:this.options};if($)this.runMatchedCommand();if(!this.matchedCommand&&this.args[0])this.emit("command:*");return Z}mri(z,$){let Q=[...this.globalCommand.options,...$?$.options:[]],Z=o6(Q),Y=[],X=z.indexOf("--");if(X>-1)Y=z.slice(X+1),z=z.slice(0,X);let J=s6.default(z,Z);J=Object.keys(J).reduce((V,U)=>{return{...V,[R6(U)]:J[U]}},{_:[]});let q=J._,j={"--":Y},G=$&&$.config.ignoreOptionDefaultValue?$.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,K=Object.create(null);for(let V of Q){if(!G&&V.config.default!==void 0)for(let U of V.names)j[U]=V.config.default;if(Array.isArray(V.config.type)){if(K[V.name]===void 0)K[V.name]=Object.create(null),K[V.name].shouldTransform=!0,K[V.name].transformFunction=V.config.type[0]}}for(let V of Object.keys(J))if(V!=="_"){let U=V.split(".");$z(j,U,J[V]),Qz(j,K)}return{args:q,options:j}}runMatchedCommand(){let{args:z,options:$,matchedCommand:Q}=this;if(!Q||!Q.commandAction)return;Q.checkUnknownOptions(),Q.checkOptionValue(),Q.checkRequiredArgs();let Z=[];return Q.args.forEach((Y,X)=>{if(Y.variadic)Z.push(z.slice(X));else Z.push(z[X])}),Z.push($),Q.commandAction.apply(this,Z)}}var Y0=I(C(),1),Kz=["up","down","left","right","space","enter","cancel"],x={actions:new Set(Kz),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};function C6(z,$){if(typeof z==="string")return x.aliases.get(z)===$;for(let Q of z){if(Q===void 0)continue;if(C6(Q,$))return!0}return!1}function jz(z,$){if(z===$)return[];let Q=z.split(`
8
+ `))}outputVersion(){let{name:z}=this.cli,{versionNumber:$}=this.cli.globalCommand;if($){let Q;if(Bun)Q=Hz;else Q=Wz;console.log(`${z}/${$} ${Q}`)}}checkRequiredArgs(){let z=this.args.filter(($)=>$.required).length;if(this.cli.args.length<z)throw new u(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:z,globalCommand:$}=this.cli;if(!this.config.allowUnknownOptions){for(let Q of Object.keys(z))if(Q!=="--"&&!this.hasOption(Q)&&!$.hasOption(Q))throw new u(`Unknown option \`${Q.length>1?`--${Q}`:`-${Q}`}\``)}}checkOptionValue(){let{options:z,globalCommand:$}=this.cli,Q=[...$.options,...this.options];for(let Z of Q){let Y=z[Z.name.split(".")[0]];if(Z.required){let X=Q.some((J)=>J.negated&&J.names.includes(Z.name));if(Y===!0||Y===!1&&!X)throw new u(`option \`${Z.rawName}\` value is missing`)}}}}class Q6 extends $6{constructor(z){super("@@global@@","",{},z)}}var Fz=$6;class Z6 extends Yz{name;commands;globalCommand;matchedCommand;matchedCommandName;rawArgs;args;options;showHelpOnExit;showVersionOnExit;constructor(z=""){super();this.name=z,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new Q6(this),this.globalCommand.usage("<command> [options]")}usage(z){return this.globalCommand.usage(z),this}command(z,$,Q){if(!Q)Q={};let Z=new Fz(z,$||"",Q,this);return Z.globalCommand=this.globalCommand,this.commands.push(Z),Z}option(z,$,Q){return this.globalCommand.option(z,$,Q),this}help(z){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=z,this.showHelpOnExit=!0,this}version(z,$="-v, --version"){return this.globalCommand.version(z,$),this.showVersionOnExit=!0,this}example(z){return this.globalCommand.example(z),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:z,options:$},Q,Z){if(this.args=z,this.options=$,Q)this.matchedCommand=Q;if(Z)this.matchedCommandName=Z;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(z=Vz,{run:$=!0}={}){if(this.rawArgs=z,!this.name)this.name=z[1]?Kz(z[1]):"cli";let Q=!0;for(let Y of this.commands){let X=this.mri(z.slice(2),Y),J=X.args[0];if(Y.isMatched(J)){Q=!1;let q={...X,args:X.args.slice(1)};this.setParsedInfo(q,Y,J),this.emit(`command:${J}`,Y)}}if(Q){for(let Y of this.commands)if(Y.name===""){Q=!1;let X=this.mri(z.slice(2),Y);this.setParsedInfo(X,Y),this.emit("command:!",Y)}}if(Q){let Y=this.mri(z.slice(2));this.setParsedInfo(Y)}if(this.options.help&&this.showHelpOnExit)this.outputHelp(),$=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),$=!1,this.unsetMatchedCommand();let Z={args:this.args,options:this.options};if($)this.runMatchedCommand();if(!this.matchedCommand&&this.args[0])this.emit("command:*");return Z}mri(z,$){let Q=[...this.globalCommand.options,...$?$.options:[]],Z=Jz(Q),Y=[],X=z.indexOf("--");if(X>-1)Y=z.slice(X+1),z=z.slice(0,X);let J=Zz.default(z,Z);J=Object.keys(J).reduce((V,U)=>{return{...V,[R6(U)]:J[U]}},{_:[]});let q=J._,j={"--":Y},G=$&&$.config.ignoreOptionDefaultValue?$.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,K=Object.create(null);for(let V of Q){if(!G&&V.config.default!==void 0)for(let U of V.names)j[U]=V.config.default;if(Array.isArray(V.config.type)){if(K[V.name]===void 0)K[V.name]=Object.create(null),K[V.name].shouldTransform=!0,K[V.name].transformFunction=V.config.type[0]}}for(let V of Object.keys(J))if(V!=="_"){let U=V.split(".");Gz(j,U,J[V]),Uz(j,K)}return{args:q,options:j}}runMatchedCommand(){let{args:z,options:$,matchedCommand:Q}=this;if(!Q||!Q.commandAction)return;Q.checkUnknownOptions(),Q.checkOptionValue(),Q.checkRequiredArgs();let Z=[];return Q.args.forEach((Y,X)=>{if(Y.variadic)Z.push(z.slice(X));else Z.push(z[X])}),Z.push($),Q.commandAction.apply(this,Z)}}var j0=R(C(),1),Mz=["up","down","left","right","space","enter","cancel"],x={actions:new Set(Mz),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};function C6(z,$){if(typeof z==="string")return x.aliases.get(z)===$;for(let Q of z){if(Q===void 0)continue;if(C6(Q,$))return!0}return!1}function wz(z,$){if(z===$)return[];let Q=z.split(`
9
9
  `),Z=$.split(`
10
- `),Y=[];for(let X=0;X<Math.max(Q.length,Z.length);X++)if(Q[X]!==Z[X])Y.push(X);return Y}var G0=Uz.platform.startsWith("win"),M6=Symbol("clapp:cancel");function d(z,$){let Q=z;if(Q.isTTY)Q.setRawMode($)}var s=I(C(),1);function Wz({onlyFirst:z=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",z?void 0:"g")}var Lz=Wz();function A6(z){if(typeof z!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof z}\``);return z.replace(Lz,"")}function Mz(z){return z===161||z===164||z===167||z===168||z===170||z===173||z===174||z>=176&&z<=180||z>=182&&z<=186||z>=188&&z<=191||z===198||z===208||z===215||z===216||z>=222&&z<=225||z===230||z>=232&&z<=234||z===236||z===237||z===240||z===242||z===243||z>=247&&z<=250||z===252||z===254||z===257||z===273||z===275||z===283||z===294||z===295||z===299||z>=305&&z<=307||z===312||z>=319&&z<=322||z===324||z>=328&&z<=331||z===333||z===338||z===339||z===358||z===359||z===363||z===462||z===464||z===466||z===468||z===470||z===472||z===474||z===476||z===593||z===609||z===708||z===711||z>=713&&z<=715||z===717||z===720||z>=728&&z<=731||z===733||z===735||z>=768&&z<=879||z>=913&&z<=929||z>=931&&z<=937||z>=945&&z<=961||z>=963&&z<=969||z===1025||z>=1040&&z<=1103||z===1105||z===8208||z>=8211&&z<=8214||z===8216||z===8217||z===8220||z===8221||z>=8224&&z<=8226||z>=8228&&z<=8231||z===8240||z===8242||z===8243||z===8245||z===8251||z===8254||z===8308||z===8319||z>=8321&&z<=8324||z===8364||z===8451||z===8453||z===8457||z===8467||z===8470||z===8481||z===8482||z===8486||z===8491||z===8531||z===8532||z>=8539&&z<=8542||z>=8544&&z<=8555||z>=8560&&z<=8569||z===8585||z>=8592&&z<=8601||z===8632||z===8633||z===8658||z===8660||z===8679||z===8704||z===8706||z===8707||z===8711||z===8712||z===8715||z===8719||z===8721||z===8725||z===8730||z>=8733&&z<=8736||z===8739||z===8741||z>=8743&&z<=8748||z===8750||z>=8756&&z<=8759||z===8764||z===8765||z===8776||z===8780||z===8786||z===8800||z===8801||z>=8804&&z<=8807||z===8810||z===8811||z===8814||z===8815||z===8834||z===8835||z===8838||z===8839||z===8853||z===8857||z===8869||z===8895||z===8978||z>=9312&&z<=9449||z>=9451&&z<=9547||z>=9552&&z<=9587||z>=9600&&z<=9615||z>=9618&&z<=9621||z===9632||z===9633||z>=9635&&z<=9641||z===9650||z===9651||z===9654||z===9655||z===9660||z===9661||z===9664||z===9665||z>=9670&&z<=9672||z===9675||z>=9678&&z<=9681||z>=9698&&z<=9701||z===9711||z===9733||z===9734||z===9737||z===9742||z===9743||z===9756||z===9758||z===9792||z===9794||z===9824||z===9825||z>=9827&&z<=9829||z>=9831&&z<=9834||z===9836||z===9837||z===9839||z===9886||z===9887||z===9919||z>=9926&&z<=9933||z>=9935&&z<=9939||z>=9941&&z<=9953||z===9955||z===9960||z===9961||z>=9963&&z<=9969||z===9972||z>=9974&&z<=9977||z===9979||z===9980||z===9982||z===9983||z===10045||z>=10102&&z<=10111||z>=11094&&z<=11097||z>=12872&&z<=12879||z>=57344&&z<=63743||z>=65024&&z<=65039||z===65533||z>=127232&&z<=127242||z>=127248&&z<=127277||z>=127280&&z<=127337||z>=127344&&z<=127373||z===127375||z===127376||z>=127387&&z<=127404||z>=917760&&z<=917999||z>=983040&&z<=1048573||z>=1048576&&z<=1114109}function wz(z){return z===12288||z>=65281&&z<=65376||z>=65504&&z<=65510}function Oz(z){return z>=4352&&z<=4447||z===8986||z===8987||z===9001||z===9002||z>=9193&&z<=9196||z===9200||z===9203||z===9725||z===9726||z===9748||z===9749||z>=9776&&z<=9783||z>=9800&&z<=9811||z===9855||z>=9866&&z<=9871||z===9875||z===9889||z===9898||z===9899||z===9917||z===9918||z===9924||z===9925||z===9934||z===9940||z===9962||z===9970||z===9971||z===9973||z===9978||z===9981||z===9989||z===9994||z===9995||z===10024||z===10060||z===10062||z>=10067&&z<=10069||z===10071||z>=10133&&z<=10135||z===10160||z===10175||z===11035||z===11036||z===11088||z===11093||z>=11904&&z<=11929||z>=11931&&z<=12019||z>=12032&&z<=12245||z>=12272&&z<=12287||z>=12289&&z<=12350||z>=12353&&z<=12438||z>=12441&&z<=12543||z>=12549&&z<=12591||z>=12593&&z<=12686||z>=12688&&z<=12773||z>=12783&&z<=12830||z>=12832&&z<=12871||z>=12880&&z<=42124||z>=42128&&z<=42182||z>=43360&&z<=43388||z>=44032&&z<=55203||z>=63744&&z<=64255||z>=65040&&z<=65049||z>=65072&&z<=65106||z>=65108&&z<=65126||z>=65128&&z<=65131||z>=94176&&z<=94180||z===94192||z===94193||z>=94208&&z<=100343||z>=100352&&z<=101589||z>=101631&&z<=101640||z>=110576&&z<=110579||z>=110581&&z<=110587||z===110589||z===110590||z>=110592&&z<=110882||z===110898||z>=110928&&z<=110930||z===110933||z>=110948&&z<=110951||z>=110960&&z<=111355||z>=119552&&z<=119638||z>=119648&&z<=119670||z===126980||z===127183||z===127374||z>=127377&&z<=127386||z>=127488&&z<=127490||z>=127504&&z<=127547||z>=127552&&z<=127560||z===127568||z===127569||z>=127584&&z<=127589||z>=127744&&z<=127776||z>=127789&&z<=127797||z>=127799&&z<=127868||z>=127870&&z<=127891||z>=127904&&z<=127946||z>=127951&&z<=127955||z>=127968&&z<=127984||z===127988||z>=127992&&z<=128062||z===128064||z>=128066&&z<=128252||z>=128255&&z<=128317||z>=128331&&z<=128334||z>=128336&&z<=128359||z===128378||z===128405||z===128406||z===128420||z>=128507&&z<=128591||z>=128640&&z<=128709||z===128716||z>=128720&&z<=128722||z>=128725&&z<=128727||z>=128732&&z<=128735||z===128747||z===128748||z>=128756&&z<=128764||z>=128992&&z<=129003||z===129008||z>=129292&&z<=129338||z>=129340&&z<=129349||z>=129351&&z<=129535||z>=129648&&z<=129660||z>=129664&&z<=129673||z>=129679&&z<=129734||z>=129742&&z<=129756||z>=129759&&z<=129769||z>=129776&&z<=129784||z>=131072&&z<=196605||z>=196608&&z<=262141}function Bz(z){if(!Number.isSafeInteger(z))throw TypeError(`Expected a code point, got \`${typeof z}\`.`)}function Dz(z,{ambiguousAsWide:$=!1}={}){if(Bz(z),wz(z)||Oz(z)||$&&Mz(z))return 2;return 1}var bz=I(r6(),1),Nz=new Intl.Segmenter,Tz=/^\p{Default_Ignorable_Code_Point}$/u;function _(z,$={}){if(typeof z!=="string"||z.length===0)return 0;let{ambiguousIsNarrow:Q=!0,countAnsiEscapeCodes:Z=!1}=$;if(!Z)z=A6(z);if(z.length===0)return 0;let Y=0,X={ambiguousAsWide:!Q};for(let{segment:J}of Nz.segment(z)){let q=J.codePointAt(0);if(q<=31||q>=127&&q<=159)continue;if(q>=8203&&q<=8207||q===65279)continue;if(q>=768&&q<=879||q>=6832&&q<=6911||q>=7616&&q<=7679||q>=8400&&q<=8447||q>=65056&&q<=65071)continue;if(q>=55296&&q<=57343)continue;if(q>=65024&&q<=65039)continue;if(Tz.test(J))continue;if(bz.default().test(J)){Y+=2;continue}Y+=Dz(q,X)}return Y}var t=10,O6=(z=0)=>($)=>`\x1B[${$+z}m`,B6=(z=0)=>($)=>`\x1B[${38+z};5;${$}m`,D6=(z=0)=>($,Q,Z)=>`\x1B[${38+z};2;${$};${Q};${Z}m`,N={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},j0=Object.keys(N.modifier),Iz=Object.keys(N.color),Rz=Object.keys(N.bgColor),H0=[...Iz,...Rz];function Ez(){let z=new Map;for(let[$,Q]of Object.entries(N)){for(let[Z,Y]of Object.entries(Q))N[Z]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},Q[Z]=N[Z],z.set(Y[0],Y[1]);Object.defineProperty(N,$,{value:Q,enumerable:!1})}return Object.defineProperty(N,"codes",{value:z,enumerable:!1}),N.color.close="\x1B[39m",N.bgColor.close="\x1B[49m",N.color.ansi=O6(),N.color.ansi256=B6(),N.color.ansi16m=D6(),N.bgColor.ansi=O6(t),N.bgColor.ansi256=B6(t),N.bgColor.ansi16m=D6(t),Object.defineProperties(N,{rgbToAnsi256:{value:($,Q,Z)=>{if($===Q&&Q===Z){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(Q/255*5)+Math.round(Z/255*5)},enumerable:!1},hexToRgb:{value:($)=>{let Q=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!Q)return[0,0,0];let[Z]=Q;if(Z.length===3)Z=[...Z].map((X)=>X+X).join("");let Y=Number.parseInt(Z,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:($)=>N.rgbToAnsi256(...N.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value:($)=>{if($<8)return 30+$;if($<16)return 90+($-8);let Q,Z,Y;if($>=232)Q=(($-232)*10+8)/255,Z=Q,Y=Q;else{$-=16;let q=$%36;Q=Math.floor($/36)/5,Z=Math.floor(q/6)/5,Y=q%6/5}let X=Math.max(Q,Z,Y)*2;if(X===0)return 30;let J=30+(Math.round(Y)<<2|Math.round(Z)<<1|Math.round(Q));if(X===2)J+=60;return J},enumerable:!1},rgbToAnsi:{value:($,Q,Z)=>N.ansi256ToAnsi(N.rgbToAnsi256($,Q,Z)),enumerable:!1},hexToAnsi:{value:($)=>N.ansi256ToAnsi(N.hexToAnsi256($)),enumerable:!1}}),N}var Cz=Ez(),Az=Cz,c=new Set(["\x1B","›"]),Pz=39,Y6="\x07",P6="[",yz="]",y6="m",n=`${yz}8;;`,b6=(z)=>`${c.values().next().value}${P6}${z}${y6}`,N6=(z)=>`${c.values().next().value}${n}${z}${Y6}`,vz=(z)=>z.split(" ").map(($)=>_($)),e=(z,$,Q)=>{let Z=[...$],Y=!1,X=!1,J=_(A6(z.at(-1)));for(let[q,j]of Z.entries()){let G=_(j);if(J+G<=Q)z[z.length-1]+=j;else z.push(j),J=0;if(c.has(j))Y=!0,X=Z.slice(q+1,q+1+n.length).join("")===n;if(Y){if(X){if(j===Y6)Y=!1,X=!1}else if(j===y6)Y=!1;continue}if(J+=G,J===Q&&q<Z.length-1)z.push(""),J=0}if(!J&&z.at(-1).length>0&&z.length>1)z[z.length-2]+=z.pop()},kz=(z)=>{let $=z.split(" "),Q=$.length;while(Q>0){if(_($[Q-1])>0)break;Q--}if(Q===$.length)return z;return $.slice(0,Q).join(" ")+$.slice(Q).join("")},Sz=(z,$,Q={})=>{if(Q.trim!==!1&&z.trim()==="")return"";let Z="",Y,X,J=vz(z),q=[""];for(let[V,U]of z.split(" ").entries()){if(Q.trim!==!1)q[q.length-1]=q.at(-1).trimStart();let F=_(q.at(-1));if(V!==0){if(F>=$&&(Q.wordWrap===!1||Q.trim===!1))q.push(""),F=0;if(F>0||Q.trim===!1)q[q.length-1]+=" ",F++}if(Q.hard&&J[V]>$){let H=$-F,O=1+Math.floor((J[V]-H-1)/$);if(Math.floor((J[V]-1)/$)<O)q.push("");e(q,U,$);continue}if(F+J[V]>$&&F>0&&J[V]>0){if(Q.wordWrap===!1&&F<$){e(q,U,$);continue}q.push("")}if(F+J[V]>$&&Q.wordWrap===!1){e(q,U,$);continue}q[q.length-1]+=U}if(Q.trim!==!1)q=q.map((V)=>kz(V));let j=q.join(`
11
- `),G=[...j],K=0;for(let[V,U]of G.entries()){if(Z+=U,c.has(U)){let{groups:H}=new RegExp(`(?:\\${P6}(?<code>\\d+)m|\\${n}(?<uri>.*)${Y6})`).exec(j.slice(K))||{groups:{}};if(H.code!==void 0){let O=Number.parseFloat(H.code);Y=O===Pz?void 0:O}else if(H.uri!==void 0)X=H.uri.length===0?void 0:H.uri}let F=Az.codes.get(Number(Y));if(G[V+1]===`
12
- `){if(X)Z+=N6("");if(Y&&F)Z+=b6(F)}else if(U===`
13
- `){if(Y&&F)Z+=b6(Y);if(X)Z+=N6(X)}K+=U.length}return Z};function T6(z,$,Q){return String(z).normalize().replaceAll(`\r
10
+ `),Y=[];for(let X=0;X<Math.max(Q.length,Z.length);X++)if(Q[X]!==Z[X])Y.push(X);return Y}var F0=Lz.platform.startsWith("win"),M6=Symbol("clapp:cancel");function d(z,$){let Q=z;if(Q.isTTY)Q.setRawMode($)}var s=R(C(),1);function bz({onlyFirst:z=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",z?void 0:"g")}var Nz=bz();function A6(z){if(typeof z!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof z}\``);return z.replace(Nz,"")}function Tz(z){return z===161||z===164||z===167||z===168||z===170||z===173||z===174||z>=176&&z<=180||z>=182&&z<=186||z>=188&&z<=191||z===198||z===208||z===215||z===216||z>=222&&z<=225||z===230||z>=232&&z<=234||z===236||z===237||z===240||z===242||z===243||z>=247&&z<=250||z===252||z===254||z===257||z===273||z===275||z===283||z===294||z===295||z===299||z>=305&&z<=307||z===312||z>=319&&z<=322||z===324||z>=328&&z<=331||z===333||z===338||z===339||z===358||z===359||z===363||z===462||z===464||z===466||z===468||z===470||z===472||z===474||z===476||z===593||z===609||z===708||z===711||z>=713&&z<=715||z===717||z===720||z>=728&&z<=731||z===733||z===735||z>=768&&z<=879||z>=913&&z<=929||z>=931&&z<=937||z>=945&&z<=961||z>=963&&z<=969||z===1025||z>=1040&&z<=1103||z===1105||z===8208||z>=8211&&z<=8214||z===8216||z===8217||z===8220||z===8221||z>=8224&&z<=8226||z>=8228&&z<=8231||z===8240||z===8242||z===8243||z===8245||z===8251||z===8254||z===8308||z===8319||z>=8321&&z<=8324||z===8364||z===8451||z===8453||z===8457||z===8467||z===8470||z===8481||z===8482||z===8486||z===8491||z===8531||z===8532||z>=8539&&z<=8542||z>=8544&&z<=8555||z>=8560&&z<=8569||z===8585||z>=8592&&z<=8601||z===8632||z===8633||z===8658||z===8660||z===8679||z===8704||z===8706||z===8707||z===8711||z===8712||z===8715||z===8719||z===8721||z===8725||z===8730||z>=8733&&z<=8736||z===8739||z===8741||z>=8743&&z<=8748||z===8750||z>=8756&&z<=8759||z===8764||z===8765||z===8776||z===8780||z===8786||z===8800||z===8801||z>=8804&&z<=8807||z===8810||z===8811||z===8814||z===8815||z===8834||z===8835||z===8838||z===8839||z===8853||z===8857||z===8869||z===8895||z===8978||z>=9312&&z<=9449||z>=9451&&z<=9547||z>=9552&&z<=9587||z>=9600&&z<=9615||z>=9618&&z<=9621||z===9632||z===9633||z>=9635&&z<=9641||z===9650||z===9651||z===9654||z===9655||z===9660||z===9661||z===9664||z===9665||z>=9670&&z<=9672||z===9675||z>=9678&&z<=9681||z>=9698&&z<=9701||z===9711||z===9733||z===9734||z===9737||z===9742||z===9743||z===9756||z===9758||z===9792||z===9794||z===9824||z===9825||z>=9827&&z<=9829||z>=9831&&z<=9834||z===9836||z===9837||z===9839||z===9886||z===9887||z===9919||z>=9926&&z<=9933||z>=9935&&z<=9939||z>=9941&&z<=9953||z===9955||z===9960||z===9961||z>=9963&&z<=9969||z===9972||z>=9974&&z<=9977||z===9979||z===9980||z===9982||z===9983||z===10045||z>=10102&&z<=10111||z>=11094&&z<=11097||z>=12872&&z<=12879||z>=57344&&z<=63743||z>=65024&&z<=65039||z===65533||z>=127232&&z<=127242||z>=127248&&z<=127277||z>=127280&&z<=127337||z>=127344&&z<=127373||z===127375||z===127376||z>=127387&&z<=127404||z>=917760&&z<=917999||z>=983040&&z<=1048573||z>=1048576&&z<=1114109}function Iz(z){return z===12288||z>=65281&&z<=65376||z>=65504&&z<=65510}function Rz(z){return z>=4352&&z<=4447||z===8986||z===8987||z===9001||z===9002||z>=9193&&z<=9196||z===9200||z===9203||z===9725||z===9726||z===9748||z===9749||z>=9776&&z<=9783||z>=9800&&z<=9811||z===9855||z>=9866&&z<=9871||z===9875||z===9889||z===9898||z===9899||z===9917||z===9918||z===9924||z===9925||z===9934||z===9940||z===9962||z===9970||z===9971||z===9973||z===9978||z===9981||z===9989||z===9994||z===9995||z===10024||z===10060||z===10062||z>=10067&&z<=10069||z===10071||z>=10133&&z<=10135||z===10160||z===10175||z===11035||z===11036||z===11088||z===11093||z>=11904&&z<=11929||z>=11931&&z<=12019||z>=12032&&z<=12245||z>=12272&&z<=12287||z>=12289&&z<=12350||z>=12353&&z<=12438||z>=12441&&z<=12543||z>=12549&&z<=12591||z>=12593&&z<=12686||z>=12688&&z<=12773||z>=12783&&z<=12830||z>=12832&&z<=12871||z>=12880&&z<=42124||z>=42128&&z<=42182||z>=43360&&z<=43388||z>=44032&&z<=55203||z>=63744&&z<=64255||z>=65040&&z<=65049||z>=65072&&z<=65106||z>=65108&&z<=65126||z>=65128&&z<=65131||z>=94176&&z<=94180||z===94192||z===94193||z>=94208&&z<=100343||z>=100352&&z<=101589||z>=101631&&z<=101640||z>=110576&&z<=110579||z>=110581&&z<=110587||z===110589||z===110590||z>=110592&&z<=110882||z===110898||z>=110928&&z<=110930||z===110933||z>=110948&&z<=110951||z>=110960&&z<=111355||z>=119552&&z<=119638||z>=119648&&z<=119670||z===126980||z===127183||z===127374||z>=127377&&z<=127386||z>=127488&&z<=127490||z>=127504&&z<=127547||z>=127552&&z<=127560||z===127568||z===127569||z>=127584&&z<=127589||z>=127744&&z<=127776||z>=127789&&z<=127797||z>=127799&&z<=127868||z>=127870&&z<=127891||z>=127904&&z<=127946||z>=127951&&z<=127955||z>=127968&&z<=127984||z===127988||z>=127992&&z<=128062||z===128064||z>=128066&&z<=128252||z>=128255&&z<=128317||z>=128331&&z<=128334||z>=128336&&z<=128359||z===128378||z===128405||z===128406||z===128420||z>=128507&&z<=128591||z>=128640&&z<=128709||z===128716||z>=128720&&z<=128722||z>=128725&&z<=128727||z>=128732&&z<=128735||z===128747||z===128748||z>=128756&&z<=128764||z>=128992&&z<=129003||z===129008||z>=129292&&z<=129338||z>=129340&&z<=129349||z>=129351&&z<=129535||z>=129648&&z<=129660||z>=129664&&z<=129673||z>=129679&&z<=129734||z>=129742&&z<=129756||z>=129759&&z<=129769||z>=129776&&z<=129784||z>=131072&&z<=196605||z>=196608&&z<=262141}function Ez(z){if(!Number.isSafeInteger(z))throw TypeError(`Expected a code point, got \`${typeof z}\`.`)}function Cz(z,{ambiguousAsWide:$=!1}={}){if(Ez(z),Iz(z)||Rz(z)||$&&Tz(z))return 2;return 1}var Az=R(Qz(),1),Pz=new Intl.Segmenter,yz=/^\p{Default_Ignorable_Code_Point}$/u;function _(z,$={}){if(typeof z!=="string"||z.length===0)return 0;let{ambiguousIsNarrow:Q=!0,countAnsiEscapeCodes:Z=!1}=$;if(!Z)z=A6(z);if(z.length===0)return 0;let Y=0,X={ambiguousAsWide:!Q};for(let{segment:J}of Pz.segment(z)){let q=J.codePointAt(0);if(q<=31||q>=127&&q<=159)continue;if(q>=8203&&q<=8207||q===65279)continue;if(q>=768&&q<=879||q>=6832&&q<=6911||q>=7616&&q<=7679||q>=8400&&q<=8447||q>=65056&&q<=65071)continue;if(q>=55296&&q<=57343)continue;if(q>=65024&&q<=65039)continue;if(yz.test(J))continue;if(Az.default().test(J)){Y+=2;continue}Y+=Cz(q,X)}return Y}var t=10,O6=(z=0)=>($)=>`\x1B[${$+z}m`,B6=(z=0)=>($)=>`\x1B[${38+z};5;${$}m`,D6=(z=0)=>($,Q,Z)=>`\x1B[${38+z};2;${$};${Q};${Z}m`,T={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},w0=Object.keys(T.modifier),vz=Object.keys(T.color),kz=Object.keys(T.bgColor),O0=[...vz,...kz];function Sz(){let z=new Map;for(let[$,Q]of Object.entries(T)){for(let[Z,Y]of Object.entries(Q))T[Z]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},Q[Z]=T[Z],z.set(Y[0],Y[1]);Object.defineProperty(T,$,{value:Q,enumerable:!1})}return Object.defineProperty(T,"codes",{value:z,enumerable:!1}),T.color.close="\x1B[39m",T.bgColor.close="\x1B[49m",T.color.ansi=O6(),T.color.ansi256=B6(),T.color.ansi16m=D6(),T.bgColor.ansi=O6(t),T.bgColor.ansi256=B6(t),T.bgColor.ansi16m=D6(t),Object.defineProperties(T,{rgbToAnsi256:{value:($,Q,Z)=>{if($===Q&&Q===Z){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(Q/255*5)+Math.round(Z/255*5)},enumerable:!1},hexToRgb:{value:($)=>{let Q=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!Q)return[0,0,0];let[Z]=Q;if(Z.length===3)Z=[...Z].map((X)=>X+X).join("");let Y=Number.parseInt(Z,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:($)=>T.rgbToAnsi256(...T.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value:($)=>{if($<8)return 30+$;if($<16)return 90+($-8);let Q,Z,Y;if($>=232)Q=(($-232)*10+8)/255,Z=Q,Y=Q;else{$-=16;let q=$%36;Q=Math.floor($/36)/5,Z=Math.floor(q/6)/5,Y=q%6/5}let X=Math.max(Q,Z,Y)*2;if(X===0)return 30;let J=30+(Math.round(Y)<<2|Math.round(Z)<<1|Math.round(Q));if(X===2)J+=60;return J},enumerable:!1},rgbToAnsi:{value:($,Q,Z)=>T.ansi256ToAnsi(T.rgbToAnsi256($,Q,Z)),enumerable:!1},hexToAnsi:{value:($)=>T.ansi256ToAnsi(T.hexToAnsi256($)),enumerable:!1}}),T}var hz=Sz(),fz=hz,c=new Set(["\x1B","›"]),gz=39,Y6="\x07",P6="[",_z="]",y6="m",n=`${_z}8;;`,b6=(z)=>`${c.values().next().value}${P6}${z}${y6}`,N6=(z)=>`${c.values().next().value}${n}${z}${Y6}`,dz=(z)=>z.split(" ").map(($)=>_($)),e=(z,$,Q)=>{let Z=[...$],Y=!1,X=!1,J=_(A6(z.at(-1)));for(let[q,j]of Z.entries()){let G=_(j);if(J+G<=Q)z[z.length-1]+=j;else z.push(j),J=0;if(c.has(j))Y=!0,X=Z.slice(q+1,q+1+n.length).join("")===n;if(Y){if(X){if(j===Y6)Y=!1,X=!1}else if(j===y6)Y=!1;continue}if(J+=G,J===Q&&q<Z.length-1)z.push(""),J=0}if(!J&&z.at(-1).length>0&&z.length>1)z[z.length-2]+=z.pop()},uz=(z)=>{let $=z.split(" "),Q=$.length;while(Q>0){if(_($[Q-1])>0)break;Q--}if(Q===$.length)return z;return $.slice(0,Q).join(" ")+$.slice(Q).join("")},mz=(z,$,Q={})=>{if(Q.trim!==!1&&z.trim()==="")return"";let Z="",Y,X,J=dz(z),q=[""];for(let[V,U]of z.split(" ").entries()){if(Q.trim!==!1)q[q.length-1]=q.at(-1).trimStart();let W=_(q.at(-1));if(V!==0){if(W>=$&&(Q.wordWrap===!1||Q.trim===!1))q.push(""),W=0;if(W>0||Q.trim===!1)q[q.length-1]+=" ",W++}if(Q.hard&&J[V]>$){let H=$-W,O=1+Math.floor((J[V]-H-1)/$);if(Math.floor((J[V]-1)/$)<O)q.push("");e(q,U,$);continue}if(W+J[V]>$&&W>0&&J[V]>0){if(Q.wordWrap===!1&&W<$){e(q,U,$);continue}q.push("")}if(W+J[V]>$&&Q.wordWrap===!1){e(q,U,$);continue}q[q.length-1]+=U}if(Q.trim!==!1)q=q.map((V)=>uz(V));let j=q.join(`
11
+ `),G=[...j],K=0;for(let[V,U]of G.entries()){if(Z+=U,c.has(U)){let{groups:H}=new RegExp(`(?:\\${P6}(?<code>\\d+)m|\\${n}(?<uri>.*)${Y6})`).exec(j.slice(K))||{groups:{}};if(H.code!==void 0){let O=Number.parseFloat(H.code);Y=O===gz?void 0:O}else if(H.uri!==void 0)X=H.uri.length===0?void 0:H.uri}let W=fz.codes.get(Number(Y));if(G[V+1]===`
12
+ `){if(X)Z+=N6("");if(Y&&W)Z+=b6(W)}else if(U===`
13
+ `){if(Y&&W)Z+=b6(Y);if(X)Z+=N6(X)}K+=U.length}return Z};function T6(z,$,Q){return String(z).normalize().replaceAll(`\r
14
14
  `,`
15
15
  `).split(`
16
- `).map((Z)=>Sz(Z,$,Q)).join(`
17
- `)}class X6{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;_manualLine="";state="initial";error="";value;userInput="";constructor(z,$=!0){let{input:Q=Hz,output:Z=Vz,render:Y,signal:X,...J}=z;this.opts=J,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=Y.bind(this),this._track=$,this._abortSignal=X,this.input=Q,this.output=Z}unsubscribe(){this._subscribers.clear()}setSubscriber(z,$){let Q=this._subscribers.get(z)??[];Q.push($),this._subscribers.set(z,Q)}on(z,$){return this.setSubscriber(z,{cb:$}),this}once(z,$){return this.setSubscriber(z,{cb:$,once:!0}),this}emit(z,...$){let Q=this._subscribers.get(z)??[],Z=[];for(let Y of Q)if(Y.cb(...$),Y.once)Z.push(()=>Q.splice(Q.indexOf(Y),1));for(let Y of Z)Y();return this}prompt(){return new Promise((z)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),z(M6);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}if(this.rl=Fz.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0)this._setUserInput(this.opts.initialUserInput,!0);this.input.on("keypress",this.onKeypress),d(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(S.show),this.output.off("resize",this.render),d(this.input,!1),z(this.value)}),this.once("cancel",()=>{this.output.write(S.show),this.output.off("resize",this.render),d(this.input,!1),z(M6)})})}_isActionKey(z,$){return z==="\t"}_setValue(z){this.value=z,this.emit("value",this.value)}_setUserInput(z,$){if(this.userInput=z??"",this.emit("userInput",this.userInput),$&&this._track&&this.rl)this.rl.write(this.userInput),this._cursor=this.rl.cursor}onKeypress(z,$){if(this._track&&$.name!=="return"){if($.name&&this._isActionKey(z,$))this.rl?.write(null,{ctrl:!0,name:"h"});this._cursor=this.rl?.cursor??0;let Q=$.name==="tab"||$.name==="escape"||$.name==="backspace"||$.name==="delete"||$.name==="enter"||$.name==="return"||$.name&&["up","down","left","right"].includes($.name);if(z&&!Q&&z.length===1&&z>=" ")this._manualLine+=z;else if($.name==="backspace"&&this._manualLine.length>0)this._manualLine=this._manualLine.slice(0,-1);let Z=this._manualLine.length>=(this.rl?.line?.length||0)?this._manualLine:this.rl?.line;this._setUserInput(Z)}if(this.state==="error")this.state="active",this.error="";if($?.name){if(!this._track&&x.aliases.has($.name))this.emit("cursor",x.aliases.get($.name));if(x.actions.has($.name))this.emit("cursor",$.name)}if(z&&(z.toLowerCase()==="y"||z.toLowerCase()==="n"))this.emit("confirm",z.toLowerCase()==="y");if(this.emit("key",z?.toLowerCase(),$),$?.name==="return"){if(this.opts.validate){let Q=this.opts.validate(this.value);if(Q)this.error=Q instanceof Error?Q.message:Q,this.state="error"}if(this.state!=="error")this.state="submit"}if(C6([z,$?.name,$?.sequence],"cancel"))this.state="cancel";if(this.state==="submit"||this.state==="cancel")this.emit("finalize");if(this.render(),this.state==="submit"||this.state==="cancel")this.close()}close(){if(this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
16
+ `).map((Z)=>mz(Z,$,Q)).join(`
17
+ `)}class X6{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;_manualLine="";state="initial";error="";value;userInput="";constructor(z,$=!0){let{input:Q=Oz,output:Z=Bz,render:Y,signal:X,...J}=z;this.opts=J,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=Y.bind(this),this._track=$,this._abortSignal=X,this.input=Q,this.output=Z}unsubscribe(){this._subscribers.clear()}setSubscriber(z,$){let Q=this._subscribers.get(z)??[];Q.push($),this._subscribers.set(z,Q)}on(z,$){return this.setSubscriber(z,{cb:$}),this}once(z,$){return this.setSubscriber(z,{cb:$,once:!0}),this}emit(z,...$){let Q=this._subscribers.get(z)??[],Z=[];for(let Y of Q)if(Y.cb(...$),Y.once)Z.push(()=>Q.splice(Q.indexOf(Y),1));for(let Y of Z)Y();return this}prompt(){return new Promise((z)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),z(M6);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}if(this.rl=Dz.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0)this._setUserInput(this.opts.initialUserInput,!0);this.input.on("keypress",this.onKeypress),d(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(S.show),this.output.off("resize",this.render),d(this.input,!1),z(this.value)}),this.once("cancel",()=>{this.output.write(S.show),this.output.off("resize",this.render),d(this.input,!1),z(M6)})})}_isActionKey(z,$){return z==="\t"}_setValue(z){this.value=z,this.emit("value",this.value)}_setUserInput(z,$){if(this.userInput=z??"",this.emit("userInput",this.userInput),$&&this._track&&this.rl)this.rl.write(this.userInput),this._cursor=this.rl.cursor}onKeypress(z,$){if(this._track&&$.name!=="return"){if($.name&&this._isActionKey(z,$))this.rl?.write(null,{ctrl:!0,name:"h"});this._cursor=this.rl?.cursor??0;let Q=$.name==="tab"||$.name==="escape"||$.name==="backspace"||$.name==="delete"||$.name==="enter"||$.name==="return"||$.name&&["up","down","left","right"].includes($.name);if(z&&!Q&&z.length===1&&z>=" ")this._manualLine+=z;else if($.name==="backspace"&&this._manualLine.length>0)this._manualLine=this._manualLine.slice(0,-1);let Z=this._manualLine.length>=(this.rl?.line?.length||0)?this._manualLine:this.rl?.line;this._setUserInput(Z)}if(this.state==="error")this.state="active",this.error="";if($?.name){if(!this._track&&x.aliases.has($.name))this.emit("cursor",x.aliases.get($.name));if(x.actions.has($.name))this.emit("cursor",$.name)}if(z&&(z.toLowerCase()==="y"||z.toLowerCase()==="n"))this.emit("confirm",z.toLowerCase()==="y");if(this.emit("key",z?.toLowerCase(),$),$?.name==="return"){if(this.opts.validate){let Q=this.opts.validate(this.value);if(Q)this.error=Q instanceof Error?Q.message:Q,this.state="error"}if(this.state!=="error")this.state="submit"}if(C6([z,$?.name,$?.sequence],"cancel"))this.state="cancel";if(this.state==="submit"||this.state==="cancel")this.emit("finalize");if(this.render(),this.state==="submit"||this.state==="cancel")this.close()}close(){if(this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
18
18
  `),d(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.state==="cancel")setTimeout(()=>{this.unsubscribe()},10);else this.unsubscribe()}restoreCursor(){let z=T6(this._prevFrame,w6.stdout.columns,{hard:!0,trim:!1}).split(`
19
- `).length-1;this.output.write(S.move(-999,z*-1))}render(){let z=T6(this._render(this)??"",w6.stdout.columns,{hard:!0,trim:!1});if(z===this._prevFrame)return;if(this.state==="initial")this.output.write(S.hide);else{let $=jz(this._prevFrame,z);if(this.restoreCursor(),$&&$?.length===1){let Q=$[0];this.output.write(S.move(0,Q)),this.output.write(r.lines(1));let Z=z.split(`
19
+ `).length-1;this.output.write(S.move(-999,z*-1))}render(){let z=T6(this._render(this)??"",w6.stdout.columns,{hard:!0,trim:!1});if(z===this._prevFrame)return;if(this.state==="initial")this.output.write(S.hide);else{let $=wz(this._prevFrame,z);if(this.restoreCursor(),$&&$?.length===1){let Q=$[0];this.output.write(S.move(0,Q)),this.output.write(r.lines(1));let Z=z.split(`
20
20
  `);this.output.write(Z[Q]),this._prevFrame=z,this.output.write(S.move(0,Z.length-Q-1));return}if($&&$?.length>1){let Q=$[0];this.output.write(S.move(0,Q)),this.output.write(r.down());let Y=z.split(`
21
21
  `).slice(Q);this.output.write(Y.join(`
22
- `)),this._prevFrame=z;return}this.output.write(r.down())}if(this.output.write(z),this.state==="initial")this.state="active";this._prevFrame=z}}function hz(z,$){if(z===void 0)return 0;if($.length===0)return 0;let Z=$.findIndex((Y)=>Y.value===z);return Z!==-1?Z:0}function fz(z,$){return($.label??String($.value)).toLowerCase().includes(z.toLowerCase())}function gz(z,$){if(!$)return;if(z)return $;return $[0]}class _z extends X6{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#z=0;#Q="";#Z;#$;get cursor(){return this.#z}get userInputWithCursor(){if(!this.userInput)return s.default.inverse(s.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let z=this.userInput.slice(0,this._cursor),[$,...Q]=this.userInput.slice(this._cursor);return`${z}${s.default.inverse($)}${Q.join("")}`}get options(){if(typeof this.#$==="function")return this.#$();return this.#$}constructor(z){super(z);this.#$=z.options;let $=this.options;this.filteredOptions=[...$],this.multiple=z.multiple===!0,this.#Z=z.filter??fz;let Q;if(z.initialValue&&Array.isArray(z.initialValue))if(this.multiple)Q=z.initialValue;else Q=z.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)Q=[this.options[0].value];if(Q)for(let Z of Q){let Y=$.findIndex((X)=>X.value===Z);if(Y!==-1)this.toggleSelected(Z),this.#z=Y}this.focusedValue=this.options[this.#z]?.value,this.on("key",(Z,Y)=>this.#Y(Z,Y)),this.on("userInput",(Z)=>this.#X(Z))}_isActionKey(z,$){return z==="\t"||this.multiple&&this.isNavigating&&$.name==="space"&&z!==void 0&&z!==""}#Y(z,$){let Q=$.name==="up",Z=$.name==="down",Y=$.name==="return";if(Q||Z){if(this.#z=Math.max(0,Math.min(this.#z+(Q?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#z]?.value,!this.multiple)this.selectedValues=[this.focusedValue];this.isNavigating=!0}else if(Y)this.value=gz(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&($.name==="tab"||this.isNavigating&&$.name==="space"))this.toggleSelected(this.focusedValue);else this.isNavigating=!1;else{if(this.focusedValue)this.selectedValues=[this.focusedValue];this.isNavigating=!1}}deselectAll(){this.selectedValues=[]}toggleSelected(z){if(this.filteredOptions.length===0)return;if(this.multiple)if(this.selectedValues.includes(z))this.selectedValues=this.selectedValues.filter(($)=>$!==z);else this.selectedValues=[...this.selectedValues,z];else this.selectedValues=[z]}#X(z){if(z!==this.#Q){this.#Q=z;let $=this.options;if(z)this.filteredOptions=$.filter((Q)=>this.#Z(z,Q));else this.filteredOptions=[...$];if(this.#z=hz(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#z]?.value,!this.multiple)if(this.focusedValue!==void 0)this.toggleSelected(this.focusedValue);else this.deselectAll()}}}class dz extends X6{options;cursor=0;#z;getGroupItems(z){return this.options.filter(($)=>$.group===z)}isGroupSelected(z){let $=this.getGroupItems(z),Q=this.value;if(Q===void 0)return!1;return $.every((Z)=>Q.includes(Z.value))}toggleValue(){let z=this.options[this.cursor];if(this.value===void 0)this.value=[];if(z.group===!0){let $=z.value,Q=this.getGroupItems($);if(this.isGroupSelected($))this.value=this.value.filter((Z)=>Q.findIndex((Y)=>Y.value===Z)===-1);else this.value=[...this.value,...Q.map((Z)=>Z.value)];this.value=Array.from(new Set(this.value))}else{let $=this.value.includes(z.value);this.value=$?this.value.filter((Q)=>Q!==z.value):[...this.value,z.value]}}constructor(z){super(z,!1);let{options:$}=z;this.#z=z.selectableGroups!==!1,this.options=Object.entries($).flatMap(([Q,Z])=>[{value:Q,group:!0,label:Q},...Z.map((Y)=>({...Y,group:Q}))]),this.value=[...z.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:Q})=>Q===z.cursorAt),this.#z?0:1),this.on("cursor",(Q)=>{switch(Q){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let Z=this.options[this.cursor]?.group===!0;if(!this.#z&&Z)this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let Z=this.options[this.cursor]?.group===!0;if(!this.#z&&Z)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}var V0=I(C(),1);var F0=I(C(),1);var W0=I(C(),1),h={red:["\x1B[31m","\x1B[39m"],green:["\x1B[32m","\x1B[39m"],blue:["\x1B[34m","\x1B[39m"],yellow:["\x1B[33m","\x1B[39m"],cyan:["\x1B[36m","\x1B[39m"],magenta:["\x1B[35m","\x1B[39m"],white:["\x1B[37m","\x1B[39m"],gray:["\x1B[90m","\x1B[39m"],bgRed:["\x1B[41m","\x1B[49m"],bgGreen:["\x1B[42m","\x1B[49m"],bgBlue:["\x1B[44m","\x1B[49m"],bgYellow:["\x1B[43m","\x1B[49m"],bgCyan:["\x1B[46m","\x1B[49m"],bgMagenta:["\x1B[45m","\x1B[49m"],bold:["\x1B[1m","\x1B[22m"],italic:["\x1B[3m","\x1B[23m"],underline:["\x1B[4m","\x1B[24m"],dim:["\x1B[2m","\x1B[22m"],inverse:["\x1B[7m","\x1B[27m"],hidden:["\x1B[8m","\x1B[28m"],strikethrough:["\x1B[9m","\x1B[29m"]},g={primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"};function uz(){return!0}function mz(){let z={};z.supportsColor=uz();function $(Z,Y=[]){let X=Z===""?[]:[...Y,Z],J=function(j){if(!z.supportsColor)return j;let G="",K="";for(let V of X)if(V in g&&g[V]in h){let U=g[V];G+=h[U][0],K=h[U][1]+K}else if(V in h)G+=h[V][0],K=h[V][1]+K;return G+j+K},q=[...Object.keys(h),...Object.keys(g)];for(let j of q)if(!(j in J))Object.defineProperty(J,j,{get(){return $(j,X)}});return J}let Q=[...Object.keys(h),...Object.keys(g)];for(let Z of Q)if(!(Z in z))Object.defineProperty(z,Z,{get(){return $(Z)}});return z}var L0=mz();var xz=Yz();var T=(z,$)=>xz?z:$,M0=T("◆","*"),w0=T("■","x"),O0=T("▲","x"),B0=T("◇","o"),D0=T("┌","T"),lz=T("│","|"),b0=T("└","—"),N0=T("●",">"),T0=T("○"," "),I0=T("◻","[•]"),R0=T("◼","[+]"),E0=T("◻","[ ]"),C0=T("▪","•"),A0=T("─","-"),P0=T("╮","+"),y0=T("├","+"),v0=T("╯","+"),k0=T("●","•"),S0=T("◆","*"),h0=T("▲","!"),f0=T("■","x");var g0=I(C(),1);var _0=I(C(),1);var d0=I(C(),1);var u0=I(C(),1);var m0=I(C(),1);var x0=I(C(),1);var l0=I(C(),1);var n0=I(C(),1);var c0=I(C(),1),a0=I(C(),1);var i0={light:T("─","-"),heavy:T("━","="),block:T("█","#")};var p0=I(C(),1);var r0=I(C(),1);var nz=I(C(),1);function cz(){return`${nz.default.gray(lz)} `}var s0=cz();var t0=I(C(),1);var e0=I(C(),1);var v6="0.9.27";iz();async function pz(z="src/pantry"){if(!W.existsSync(z))throw Error(`Pantry directory not found: ${z}. Please run 'bun ./bin/cli.ts update-pantry' first.`);let $=[];function Q(Z,Y=""){let X=W.readdirSync(Z,{withFileTypes:!0}),J=R.join(Z,"package.yml");if(Y&&W.existsSync(J))$.push(Y);for(let q of X)if(q.isDirectory()&&!q.name.startsWith(".")){let j=Y?`${Y}/${q.name}`:q.name,G=R.join(Z,q.name);Q(G,j)}}return Q(z),console.log(`\uD83D\uDCE6 Found ${$.length} packages in local pantry`),$.sort()}async function rz(z=!1){async function $(J){let q=new URL("https://s3.amazonaws.com/dist.tea.xyz/");if(q.searchParams.set("list-type","2"),q.searchParams.set("prefix",""),q.searchParams.set("max-keys","1000"),J)q.searchParams.set("continuation-token",J);let j=await fetch(q.toString());if(!j.ok)throw Error(`Failed to fetch S3 listing: ${j.status}`);let G=await j.text(),K=[],V=G.match(/<Key>([^<]+)<\/Key>/g);if(V)for(let O of V){let b=O.replace(/<Key>([^<]+)<\/Key>/,"$1");K.push({Key:b})}let U=G.includes("<IsTruncated>true</IsTruncated>"),F=G.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/),H=F?F[1]:void 0;return{IsTruncated:U,NextContinuationToken:H,Contents:K}}console.log("Scraping packages from S3 registry...");let Q=new Set,Z;do{let J=await $(Z);for(let q of J.Contents){let j=q.Key,G=j.split("/");if(G.length===0)continue;if(G[0].startsWith(".")||G[0].includes(" ")||j.match(/\.(md|txt|yml|yaml|json)$/i))continue;let K=["darwin","linux","windows"],V=-1;for(let U=1;U<G.length;U++)if(K.includes(G[U])){V=U;break}if(V>0){let U=G.slice(0,V).join("/");if(U.includes("."))Q.add(U)}else if(G.length>=2&&G[0].includes(".")&&!G[1].startsWith("v")&&!G[1].match(/^\d/)){let U=`${G[0]}/${G[1]}`;Q.add(U)}else if(G.length>=1&&G[0].includes("."))Q.add(G[0])}Z=J.NextContinuationToken,console.log(`Found ${Q.size} packages so far...`)}while(Z);let Y=Array.from(Q).sort(),X=[];for(let J of Y){if(!J.includes(".")||J.match(/^[a-z0-9.-]+\.[a-z]{2,}(\/[\w.-]+){0,20}$/i)===null)continue;if(J.endsWith("/README.rst")||J.endsWith("/README")||J.includes("/docs/"))continue;if(J.endsWith("/.pkgroot"))continue;if(["amazon.com/aws","charm.sh","code.videolan.org","crates.io"].includes(J))continue;X.push(J)}return console.log(`\uD83D\uDCE6 Found ${X.length} valid packages in registry`),X}async function sz(z,$){let Z=`/**
22
+ `)),this._prevFrame=z;return}this.output.write(r.down())}if(this.output.write(z),this.state==="initial")this.state="active";this._prevFrame=z}}function xz(z,$){if(z===void 0)return 0;if($.length===0)return 0;let Z=$.findIndex((Y)=>Y.value===z);return Z!==-1?Z:0}function lz(z,$){return($.label??String($.value)).toLowerCase().includes(z.toLowerCase())}function nz(z,$){if(!$)return;if(z)return $;return $[0]}class cz extends X6{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#z=0;#Q="";#Z;#$;get cursor(){return this.#z}get userInputWithCursor(){if(!this.userInput)return s.default.inverse(s.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let z=this.userInput.slice(0,this._cursor),[$,...Q]=this.userInput.slice(this._cursor);return`${z}${s.default.inverse($)}${Q.join("")}`}get options(){if(typeof this.#$==="function")return this.#$();return this.#$}constructor(z){super(z);this.#$=z.options;let $=this.options;this.filteredOptions=[...$],this.multiple=z.multiple===!0,this.#Z=z.filter??lz;let Q;if(z.initialValue&&Array.isArray(z.initialValue))if(this.multiple)Q=z.initialValue;else Q=z.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)Q=[this.options[0].value];if(Q)for(let Z of Q){let Y=$.findIndex((X)=>X.value===Z);if(Y!==-1)this.toggleSelected(Z),this.#z=Y}this.focusedValue=this.options[this.#z]?.value,this.on("key",(Z,Y)=>this.#Y(Z,Y)),this.on("userInput",(Z)=>this.#X(Z))}_isActionKey(z,$){return z==="\t"||this.multiple&&this.isNavigating&&$.name==="space"&&z!==void 0&&z!==""}#Y(z,$){let Q=$.name==="up",Z=$.name==="down",Y=$.name==="return";if(Q||Z){if(this.#z=Math.max(0,Math.min(this.#z+(Q?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#z]?.value,!this.multiple)this.selectedValues=[this.focusedValue];this.isNavigating=!0}else if(Y)this.value=nz(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&($.name==="tab"||this.isNavigating&&$.name==="space"))this.toggleSelected(this.focusedValue);else this.isNavigating=!1;else{if(this.focusedValue)this.selectedValues=[this.focusedValue];this.isNavigating=!1}}deselectAll(){this.selectedValues=[]}toggleSelected(z){if(this.filteredOptions.length===0)return;if(this.multiple)if(this.selectedValues.includes(z))this.selectedValues=this.selectedValues.filter(($)=>$!==z);else this.selectedValues=[...this.selectedValues,z];else this.selectedValues=[z]}#X(z){if(z!==this.#Q){this.#Q=z;let $=this.options;if(z)this.filteredOptions=$.filter((Q)=>this.#Z(z,Q));else this.filteredOptions=[...$];if(this.#z=xz(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#z]?.value,!this.multiple)if(this.focusedValue!==void 0)this.toggleSelected(this.focusedValue);else this.deselectAll()}}}class az extends X6{options;cursor=0;#z;getGroupItems(z){return this.options.filter(($)=>$.group===z)}isGroupSelected(z){let $=this.getGroupItems(z),Q=this.value;if(Q===void 0)return!1;return $.every((Z)=>Q.includes(Z.value))}toggleValue(){let z=this.options[this.cursor];if(this.value===void 0)this.value=[];if(z.group===!0){let $=z.value,Q=this.getGroupItems($);if(this.isGroupSelected($))this.value=this.value.filter((Z)=>Q.findIndex((Y)=>Y.value===Z)===-1);else this.value=[...this.value,...Q.map((Z)=>Z.value)];this.value=Array.from(new Set(this.value))}else{let $=this.value.includes(z.value);this.value=$?this.value.filter((Q)=>Q!==z.value):[...this.value,z.value]}}constructor(z){super(z,!1);let{options:$}=z;this.#z=z.selectableGroups!==!1,this.options=Object.entries($).flatMap(([Q,Z])=>[{value:Q,group:!0,label:Q},...Z.map((Y)=>({...Y,group:Q}))]),this.value=[...z.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:Q})=>Q===z.cursorAt),this.#z?0:1),this.on("cursor",(Q)=>{switch(Q){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let Z=this.options[this.cursor]?.group===!0;if(!this.#z&&Z)this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let Z=this.options[this.cursor]?.group===!0;if(!this.#z&&Z)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}var B0=R(C(),1);var D0=R(C(),1);var b0=R(C(),1),h={red:["\x1B[31m","\x1B[39m"],green:["\x1B[32m","\x1B[39m"],blue:["\x1B[34m","\x1B[39m"],yellow:["\x1B[33m","\x1B[39m"],cyan:["\x1B[36m","\x1B[39m"],magenta:["\x1B[35m","\x1B[39m"],white:["\x1B[37m","\x1B[39m"],gray:["\x1B[90m","\x1B[39m"],bgRed:["\x1B[41m","\x1B[49m"],bgGreen:["\x1B[42m","\x1B[49m"],bgBlue:["\x1B[44m","\x1B[49m"],bgYellow:["\x1B[43m","\x1B[49m"],bgCyan:["\x1B[46m","\x1B[49m"],bgMagenta:["\x1B[45m","\x1B[49m"],bold:["\x1B[1m","\x1B[22m"],italic:["\x1B[3m","\x1B[23m"],underline:["\x1B[4m","\x1B[24m"],dim:["\x1B[2m","\x1B[22m"],inverse:["\x1B[7m","\x1B[27m"],hidden:["\x1B[8m","\x1B[28m"],strikethrough:["\x1B[9m","\x1B[29m"]},g={primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"};function iz(){return!0}function pz(){let z={};z.supportsColor=iz();function $(Z,Y=[]){let X=Z===""?[]:[...Y,Z],J=function(j){if(!z.supportsColor)return j;let G="",K="";for(let V of X)if(V in g&&g[V]in h){let U=g[V];G+=h[U][0],K=h[U][1]+K}else if(V in h)G+=h[V][0],K=h[V][1]+K;return G+j+K},q=[...Object.keys(h),...Object.keys(g)];for(let j of q)if(!(j in J))Object.defineProperty(J,j,{get(){return $(j,X)}});return J}let Q=[...Object.keys(h),...Object.keys(g)];for(let Z of Q)if(!(Z in z))Object.defineProperty(z,Z,{get(){return $(Z)}});return z}var N0=pz();var rz=jz();var I=(z,$)=>rz?z:$,T0=I("◆","*"),I0=I("■","x"),R0=I("▲","x"),E0=I("◇","o"),C0=I("┌","T"),sz=I("│","|"),A0=I("└","—"),P0=I("●",">"),y0=I("○"," "),v0=I("◻","[•]"),k0=I("◼","[+]"),S0=I("◻","[ ]"),h0=I("▪","•"),f0=I("─","-"),g0=I("╮","+"),_0=I("├","+"),d0=I("╯","+"),u0=I("●","•"),m0=I("◆","*"),x0=I("▲","!"),l0=I("■","x");var n0=R(C(),1);var c0=R(C(),1);var a0=R(C(),1);var i0=R(C(),1);var p0=R(C(),1);var r0=R(C(),1);var s0=R(C(),1);var t0=R(C(),1);var e0=R(C(),1),o0=R(C(),1);var z$={light:I("─","-"),heavy:I("━","="),block:I("█","#")};var $$=R(C(),1);var Q$=R(C(),1);var tz=R(C(),1);function ez(){return`${tz.default.gray(sz)} `}var Z$=ez();var Y$=R(C(),1);var X$=R(C(),1);var v6="0.9.29";z0();async function $0(z="src/pantry"){if(!L.existsSync(z))throw Error(`Pantry directory not found: ${z}. Please run 'bun ./bin/cli.ts update-pantry' first.`);let $=[];function Q(Z,Y=""){let X=L.readdirSync(Z,{withFileTypes:!0}),J=b.join(Z,"package.yml");if(Y&&L.existsSync(J))$.push(Y);for(let q of X)if(q.isDirectory()&&!q.name.startsWith(".")){let j=Y?`${Y}/${q.name}`:q.name,G=b.join(Z,q.name);Q(G,j)}}return Q(z),console.log(`\uD83D\uDCE6 Found ${$.length} packages in local pantry`),$.sort()}async function Q0(z=!1){async function $(J){let q=new URL("https://s3.amazonaws.com/dist.tea.xyz/");if(q.searchParams.set("list-type","2"),q.searchParams.set("prefix",""),q.searchParams.set("max-keys","1000"),J)q.searchParams.set("continuation-token",J);let j=await fetch(q.toString());if(!j.ok)throw Error(`Failed to fetch S3 listing: ${j.status}`);let G=await j.text(),K=[],V=G.match(/<Key>([^<]+)<\/Key>/g);if(V)for(let O of V){let N=O.replace(/<Key>([^<]+)<\/Key>/,"$1");K.push({Key:N})}let U=G.includes("<IsTruncated>true</IsTruncated>"),W=G.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/),H=W?W[1]:void 0;return{IsTruncated:U,NextContinuationToken:H,Contents:K}}console.log("Scraping packages from S3 registry...");let Q=new Set,Z;do{let J=await $(Z);for(let q of J.Contents){let j=q.Key,G=j.split("/");if(G.length===0)continue;if(G[0].startsWith(".")||G[0].includes(" ")||j.match(/\.(md|txt|yml|yaml|json)$/i))continue;let K=["darwin","linux","windows"],V=-1;for(let U=1;U<G.length;U++)if(K.includes(G[U])){V=U;break}if(V>0){let U=G.slice(0,V).join("/");if(U.includes("."))Q.add(U)}else if(G.length>=2&&G[0].includes(".")&&!G[1].startsWith("v")&&!G[1].match(/^\d/)){let U=`${G[0]}/${G[1]}`;Q.add(U)}else if(G.length>=1&&G[0].includes("."))Q.add(G[0])}Z=J.NextContinuationToken,console.log(`Found ${Q.size} packages so far...`)}while(Z);let Y=Array.from(Q).sort(),X=[];for(let J of Y){if(!J.includes(".")||J.match(/^[a-z0-9.-]+\.[a-z]{2,}(\/[\w.-]+){0,20}$/i)===null)continue;if(J.endsWith("/README.rst")||J.endsWith("/README")||J.includes("/docs/"))continue;if(J.endsWith("/.pkgroot"))continue;if(["amazon.com/aws","charm.sh","code.videolan.org","crates.io"].includes(J))continue;X.push(J)}return console.log(`\uD83D\uDCE6 Found ${X.length} valid packages in registry`),X}async function Z0(z,$){let Z=`/**
23
23
  * Constants used throughout the ts-pkgx package
24
24
  * This file is auto-generated from ${$}. Do not edit manually.
25
25
  * Generated on ${new Date().toISOString()}
@@ -71,27 +71,29 @@ export const ALL_KNOWN_PACKAGES: readonly string[] = [
71
71
  ${z.map((Y)=>` '${Y}',`).join(`
72
72
  `)}
73
73
  ] as const
74
- `;W.writeFileSync("src/consts.ts",Z,"utf-8")}var A=new Z6("ts-pkgx"),tz=1500000,j6=setTimeout(()=>{console.error("Force exiting after timeout - process may have hung"),L.exit(1)},tz);L.on("exit",()=>{clearTimeout(j6)});async function x6(z){console.log(`
75
- Received ${z} signal. Cleaning up resources...`),clearTimeout(j6);try{await p(),console.log("Resources cleaned up. Exiting.")}catch($){console.error("Error during cleanup:",$)}setTimeout(()=>{console.log("Forcing process exit..."),L.exit(0)},1000)}L.on("SIGINT",()=>x6("SIGINT"));L.on("SIGTERM",()=>x6("SIGTERM"));function k6(z){let $={};for(let[Q,Z]of Object.entries(h6))if(typeof Z==="string")$[Z]=Q;return $[z]||z}function S6(z){let $=z.map(k6),Q=z.map((Z)=>{let Y=k6(Z);return Y===Z?Z:Y});return{friendlyNames:$,mixedNames:Q}}A.command("fetch [packageName]","Fetch package information from pkgx.dev").option("-a, --all","Fetch all packages").option("-p, --pkg <packageNames>","Comma-separated list of package names to fetch").option("-o, --output-dir <dir>","Directory to save package data",{default:"src/packages"}).option("-c, --cache-dir <dir>","Directory to cache package data",{default:a}).option("-n, --no-cache","Disable caching").option("-e, --cache-expiration <minutes>","Cache expiration time in minutes",{default:J6}).option("-l, --limit <count>","Limit the number of packages to fetch (use with --all)").option("-t, --timeout <ms>","Timeout for network requests in milliseconds",{default:q6}).option("-r, --max-retries <count>","Maximum number of retry attempts for failed requests",{default:3}).option("-j, --json","Save as JSON instead of TypeScript").option("-d, --debug","Enable debug mode (save screenshots)").option("-v, --verbose","Enable verbose output").option("-y, --concurrency <count>","Number of packages to fetch concurrently (default: 8)",{default:8}).option("--output-json","Output results as JSON (for CI integration)").action(async(z,$)=>{let{all:Q,outputDir:Z="src/packages",cacheDir:Y=a,cache:X=!0,cacheExpiration:J=J6,limit:q,timeout:j=q6,json:G=!1,debug:K=!1,verbose:V=!1,concurrency:U=8,pkg:F,outputJson:H=!1}=$,O=R.resolve(L.cwd(),Z);if(!W.existsSync(O))W.mkdirSync(O,{recursive:!0});let b=R.resolve(L.cwd(),Y);if(X){if(!W.existsSync(b))W.mkdirSync(b,{recursive:!0})}try{let M=[],D=[];if(Q){if(!H)console.log("Fetching all packages...");let w={outputDir:Z,cacheDir:Y,cache:X,cacheExpirationMinutes:J,timeout:Number.parseInt(String(j),10),debug:K,limit:q?Number.parseInt(String(q),10):void 0,concurrency:Math.min(Number.parseInt(String(U),10),12),outputJson:H};M=await d6(w),D=[...M]}else if(F){let w=F.split(",").map((B)=>B.trim());if(!H)console.log(`Fetching ${w.length} packages: ${w.join(", ")}`);for(let B of w)try{let P=R.join(Y,`${B.replace(/\//g,"-")}.json`),y=!1;if(X&&W.existsSync(P)){let v=W.statSync(P),k=(Date.now()-v.mtime.getTime())/60000;if(k<J){if(!H)console.log(`Using cached data for ${B} (age: ${Math.round(k)} minutes)`);try{let H6=JSON.parse(W.readFileSync(P,"utf-8"));delete H6.fetchedAt;let l6=i(Z,B,H6);if(V&&!H)console.log(`Using cached data for ${B} (saved to ${l6})`);M.push(B),y=!0;continue}catch{console.warn(`Cache file corrupted for ${B}, will refetch`)}}}if(!y){let v=await U6(B,{timeout:Number.parseInt(String(j),10),debug:K,outputJson:H,cacheDir:Y,cache:X,cacheExpirationMinutes:J});if(v){let{outputPath:k}=G6(B,v.packageInfo,{cacheDir:Y,outputDir:Z,cache:X});if(M.push(B),D.push(B),V&&!H)console.log(`Successfully saved ${B} to ${k}`)}}}catch(P){console.error(`Error processing ${B}:`,P)}}else if(z){if(!H)console.log(`Fetching package: ${z}`);try{let w=R.join(b,`${z.replace(/\//g,"-")}.json`),B=!1;if(X&&W.existsSync(w)){let P=W.statSync(w),y=(Date.now()-P.mtime.getTime())/60000;if(y<J){if(!H)console.log(`Using cached data for ${z} (age: ${Math.round(y)} minutes)`);try{let v=JSON.parse(W.readFileSync(w,"utf-8"));delete v.fetchedAt;let k=i(O,z,v);if(V&&!H)console.log(`Using cached data for ${z} (saved to ${k})`);M.push(z),B=!0}catch{console.warn(`Cache file corrupted for ${z}, will refetch`)}}}if(!B){let P=await U6(z,{timeout:Number.parseInt(String(j),10),debug:K,outputJson:H,cacheDir:Y,cache:X,cacheExpirationMinutes:J});if(P){let{outputPath:y}=G6(z,P.packageInfo,{cacheDir:Y,outputDir:Z,cache:X});if(M.push(z),D.push(z),V&&!H)console.log(`Successfully saved ${z} to ${y}`)}}}catch(w){console.error(`Error processing ${z}:`,w)}}else{if(!H)console.error("Error: Please specify a package name, use --pkg, or use --all");L.exit(1)}if(!G&&M.length>0){let w=await K6();if(!H)console.log(`Successfully generated ${w}`)}if(Q&&M.length>0){let w=_6(O,M);if(w.length>0&&!H)console.log(`Cleaned up ${w.length} stale generated file(s)`)}if(H){let{friendlyNames:w,mixedNames:B}=S6(D),{friendlyNames:P,mixedNames:y}=S6(M),v={success:!0,updatedPackages:D,updatedPackagesFriendly:w,updatedPackagesMixed:B,allProcessedPackages:M,allProcessedFriendly:P,allProcessedMixed:y,totalUpdated:D.length,totalProcessed:M.length,timestamp:new Date().toISOString()};console.log(JSON.stringify(v))}else console.log(`Processed ${M.length} packages.`);clearTimeout(j6),await p(),setTimeout(()=>L.exit(0),1000)}catch(M){if(H){let D={success:!1,error:String(M),timestamp:new Date().toISOString()};console.log(JSON.stringify(D))}else console.error("Error:",M);await p(),setTimeout(()=>L.exit(1),1000)}});A.command("generate-index","Generate TypeScript index file for packages").option("-o, --output-dir <dir>","Directory containing package files",{default:"src/packages"}).action(async(z)=>{let{outputDir:$="src/packages"}=z,Q=R.resolve(L.cwd(),$);if(!W.existsSync(Q))console.error(`Error: Directory ${Q} does not exist`),L.exit(1);try{let Z=await K6();console.log(`Successfully generated ${Z}`),setTimeout(()=>L.exit(0),500)}catch(Z){console.error("Error generating index:",Z),L.exit(1)}});A.command("generate-ts","Generate TypeScript files from cached JSON files").option("--cache-dir <dir>","Directory with cached JSON files",{default:a}).option("--output-dir <dir>","Output directory for TypeScript files",{default:"packages"}).action(async(z)=>{try{console.log("Generating TypeScript files from cached JSON...");let{cacheDir:$,outputDir:Q}=z;if(!W.existsSync($))console.error(`Cache directory ${$} does not exist!`),L.exit(1);if(!W.existsSync(Q))W.mkdirSync(Q,{recursive:!0});let Z=W.readdirSync($).filter((X)=>X.endsWith(".json"));console.log(`Found ${Z.length} JSON files in cache directory`);let Y=0;for(let X of Z)try{let J=W.readFileSync(R.join($,X),"utf-8"),q=JSON.parse(J);delete q.fetchedAt;let j=X.replace(/\.json$/,""),G=i(Q,q.fullPath||q.domain||j,q);console.log(`Generated ${G}`),Y++}catch(J){console.error(`Error processing ${X}:`,J)}console.log(`Successfully generated ${Y} TypeScript files from JSON cache`)}catch($){console.error("Error generating TypeScript files:",$),L.exit(1)}});A.command("generate-aliases","Generate TypeScript aliases file for packages").action(async()=>{try{let z=await u6();console.log(`Successfully generated ${z}`),setTimeout(()=>L.exit(0),500)}catch(z){console.error("Error generating aliases:",z),L.exit(1)}});A.command("generate-docs","Generate comprehensive VitePress documentation for all packages").option("-o, --output-dir <dir>","Output directory for documentation",{default:"docs"}).action(async(z)=>{try{let{outputDir:$="docs"}=z;await m6($),setTimeout(()=>L.exit(0),500)}catch($){console.error("Error generating documentation:",$),L.exit(1)}});A.command("update-pantry","Download and extract the latest pantry.tgz file").option("-d, --pantry-dir <dir>","Directory to extract pantry files",{default:"src/pantry"}).action(async(z)=>{try{let{pantryDir:$="src/pantry"}=z,Q=R.resolve(L.cwd(),$);console.log("Downloading pantry.tgz...");let Z=await fetch("https://s3.amazonaws.com/dist.tea.xyz/pantry.tgz");if(!Z.ok)throw Error(`Failed to download pantry.tgz: ${Z.statusText}`);let Y=await Z.arrayBuffer(),X=R.join(L.cwd(),"pantry.tgz");W.writeFileSync(X,new Uint8Array(Y)),console.log(`Downloaded ${Y.byteLength} bytes`),W.mkdirSync(Q,{recursive:!0});let J=R.join(L.cwd(),"temp-pantry"),{spawn:q}=await import("node:child_process");if(W.existsSync(J))W.rmSync(J,{recursive:!0,force:!0});W.mkdirSync(J,{recursive:!0});let j=q("tar",["-xzf",X,"-C",J,"--strip-components=1"],{stdio:"inherit"});await new Promise((U,F)=>{j.on("close",(H)=>{if(H===0)U(H);else F(Error(`tar extraction failed with code ${H}`))}),j.on("error",F)});let G=R.join(J,"projects");if(W.existsSync(G)){let U=W.readdirSync(G),F=0,H=0,O=(b,M)=>{if(!W.existsSync(M))W.mkdirSync(M,{recursive:!0});for(let D of W.readdirSync(b,{withFileTypes:!0})){let w=R.join(b,D.name),B=R.join(M,D.name);if(D.isDirectory())O(w,B);else if(D.name==="package.yml")if(W.existsSync(B))H++;else W.renameSync(w,B),F++;else if(!W.existsSync(B))W.renameSync(w,B)}};console.log(`Merging ${U.length} projects from upstream...`);for(let b of U){let M=R.join(G,b),D=R.join(Q,b);if(W.statSync(M).isDirectory())O(M,D)}console.log(`Merged upstream pantry: ${F} new packages added, ${H} existing preserved`)}else console.log("Warning: No projects directory found in extracted pantry");if(W.unlinkSync(X),W.existsSync(J))W.rmSync(J,{recursive:!0,force:!0});console.log(`
76
- Downloading props files from pkgx/pantry GitHub repo...`);let V=await fetch("https://github.com/pkgxdev/pantry/archive/refs/heads/main.tar.gz");if(V.ok){let U=await V.arrayBuffer(),F=R.join(L.cwd(),"pantry-gh.tar.gz"),H=R.join(L.cwd(),"temp-pantry-gh");if(W.writeFileSync(F,new Uint8Array(U)),console.log(`Downloaded GitHub archive: ${(U.byteLength/1024/1024).toFixed(1)} MB`),W.existsSync(H))W.rmSync(H,{recursive:!0,force:!0});W.mkdirSync(H,{recursive:!0});let O=q("tar",["-xzf",F,"-C",H,"--strip-components=1"],{stdio:"inherit"});await new Promise((M,D)=>{O.on("close",(w)=>w===0?M(w):D(Error(`tar failed: ${w}`))),O.on("error",D)});let b=R.join(H,"projects");if(W.existsSync(b)){let M=0,D=0,w=(B,P)=>{if(!W.existsSync(B))return;for(let y of W.readdirSync(B,{withFileTypes:!0})){let v=R.join(B,y.name),k=R.join(P,y.name);if(y.isDirectory())w(v,k);else if(y.name!=="package.yml")if(W.mkdirSync(P,{recursive:!0}),W.copyFileSync(v,k),W.existsSync(k))D++;else M++}};w(b,Q),console.log(`Props files: ${M+D} synced (${M} new, ${D} updated)`)}if(W.unlinkSync(F),W.existsSync(H))W.rmSync(H,{recursive:!0,force:!0})}else console.log(`Warning: Could not download GitHub archive (${V.status}), props files will be missing`);if(console.log("Cleaned up temporary files"),W.existsSync(Q)){let U=W.readdirSync(Q).filter((F)=>{let H=R.join(Q,F);return W.statSync(H).isDirectory()&&!F.startsWith(".")});console.log(`Final result: ${U.length} projects in ${Q}`)}L.exit(0)}catch($){console.error("Error updating pantry:",$),L.exit(1)}});A.command("generate-consts","Generate or update the consts.ts file with all known packages").option("-s, --source <source>",'Source for packages: "pantry" (default) or "registry"',{default:"pantry"}).option("--pantry-dir <dir>","Directory containing pantry files",{default:"src/pantry"}).option("--validate","Validate a sample of packages (slower but more accurate)").action(async(z)=>{try{let{source:$="pantry",pantryDir:Q="src/pantry",validate:Z=!1}=z;console.log(`\uD83D\uDE80 Generating consts.ts file using ${$} as source...`);let Y=[];if($==="pantry")Y=await pz(Q);else if($==="registry")Y=await rz(Z);else console.error('Invalid source. Use "pantry" or "registry"'),L.exit(1);await sz(Y,$),console.log("✅ Successfully updated consts.ts"),console.log(`\uD83D\uDCCA Total packages: ${Y.length}`);let X=new Date().toISOString(),J=`Generated from ${$} at ${X}
74
+ `;L.writeFileSync("src/consts.ts",Z,"utf-8")}var A=new Z6("ts-pkgx"),Y0=1500000,j6=setTimeout(()=>{console.error("Force exiting after timeout - process may have hung"),F.exit(1)},Y0);F.on("exit",()=>{clearTimeout(j6)});async function r6(z){console.log(`
75
+ Received ${z} signal. Cleaning up resources...`),clearTimeout(j6);try{await p(),console.log("Resources cleaned up. Exiting.")}catch($){console.error("Error during cleanup:",$)}setTimeout(()=>{console.log("Forcing process exit..."),F.exit(0)},1000)}F.on("SIGINT",()=>r6("SIGINT"));F.on("SIGTERM",()=>r6("SIGTERM"));function k6(z){let $={};for(let[Q,Z]of Object.entries(h6))if(typeof Z==="string")$[Z]=Q;return $[z]||z}function S6(z){let $=z.map(k6),Q=z.map((Z)=>{let Y=k6(Z);return Y===Z?Z:Y});return{friendlyNames:$,mixedNames:Q}}A.command("fetch [packageName]","Fetch package information from pkgx.dev").option("-a, --all","Fetch all packages").option("-p, --pkg <packageNames>","Comma-separated list of package names to fetch").option("-o, --output-dir <dir>","Directory to save package data",{default:"src/packages"}).option("-c, --cache-dir <dir>","Directory to cache package data",{default:a}).option("-n, --no-cache","Disable caching").option("-e, --cache-expiration <minutes>","Cache expiration time in minutes",{default:J6}).option("-l, --limit <count>","Limit the number of packages to fetch (use with --all)").option("-t, --timeout <ms>","Timeout for network requests in milliseconds",{default:q6}).option("-r, --max-retries <count>","Maximum number of retry attempts for failed requests",{default:3}).option("-j, --json","Save as JSON instead of TypeScript").option("-d, --debug","Enable debug mode (save screenshots)").option("-v, --verbose","Enable verbose output").option("-y, --concurrency <count>","Number of packages to fetch concurrently (default: 8)",{default:8}).option("--output-json","Output results as JSON (for CI integration)").action(async(z,$)=>{let{all:Q,outputDir:Z="src/packages",cacheDir:Y=a,cache:X=!0,cacheExpiration:J=J6,limit:q,timeout:j=q6,json:G=!1,debug:K=!1,verbose:V=!1,concurrency:U=8,pkg:W,outputJson:H=!1}=$,O=b.resolve(F.cwd(),Z);if(!L.existsSync(O))L.mkdirSync(O,{recursive:!0});let N=b.resolve(F.cwd(),Y);if(X){if(!L.existsSync(N))L.mkdirSync(N,{recursive:!0})}try{let M=[],D=[];if(Q){if(!H)console.log("Fetching all packages...");let w={outputDir:Z,cacheDir:Y,cache:X,cacheExpirationMinutes:J,timeout:Number.parseInt(String(j),10),debug:K,limit:q?Number.parseInt(String(q),10):void 0,concurrency:Math.min(Number.parseInt(String(U),10),12),outputJson:H};M=await a6(w),D=[...M]}else if(W){let w=W.split(",").map((B)=>B.trim());if(!H)console.log(`Fetching ${w.length} packages: ${w.join(", ")}`);for(let B of w)try{let P=b.join(Y,`${B.replace(/\//g,"-")}.json`),y=!1;if(X&&L.existsSync(P)){let v=L.statSync(P),k=(Date.now()-v.mtime.getTime())/60000;if(k<J){if(!H)console.log(`Using cached data for ${B} (age: ${Math.round(k)} minutes)`);try{let H6=JSON.parse(L.readFileSync(P,"utf-8"));delete H6.fetchedAt;let s6=i(Z,B,H6);if(V&&!H)console.log(`Using cached data for ${B} (saved to ${s6})`);M.push(B),y=!0;continue}catch{console.warn(`Cache file corrupted for ${B}, will refetch`)}}}if(!y){let v=await U6(B,{timeout:Number.parseInt(String(j),10),debug:K,outputJson:H,cacheDir:Y,cache:X,cacheExpirationMinutes:J});if(v){let{outputPath:k}=G6(B,v.packageInfo,{cacheDir:Y,outputDir:Z,cache:X});if(M.push(B),D.push(B),V&&!H)console.log(`Successfully saved ${B} to ${k}`)}}}catch(P){console.error(`Error processing ${B}:`,P)}}else if(z){if(!H)console.log(`Fetching package: ${z}`);try{let w=b.join(N,`${z.replace(/\//g,"-")}.json`),B=!1;if(X&&L.existsSync(w)){let P=L.statSync(w),y=(Date.now()-P.mtime.getTime())/60000;if(y<J){if(!H)console.log(`Using cached data for ${z} (age: ${Math.round(y)} minutes)`);try{let v=JSON.parse(L.readFileSync(w,"utf-8"));delete v.fetchedAt;let k=i(O,z,v);if(V&&!H)console.log(`Using cached data for ${z} (saved to ${k})`);M.push(z),B=!0}catch{console.warn(`Cache file corrupted for ${z}, will refetch`)}}}if(!B){let P=await U6(z,{timeout:Number.parseInt(String(j),10),debug:K,outputJson:H,cacheDir:Y,cache:X,cacheExpirationMinutes:J});if(P){let{outputPath:y}=G6(z,P.packageInfo,{cacheDir:Y,outputDir:Z,cache:X});if(M.push(z),D.push(z),V&&!H)console.log(`Successfully saved ${z} to ${y}`)}}}catch(w){console.error(`Error processing ${z}:`,w)}}else{if(!H)console.error("Error: Please specify a package name, use --pkg, or use --all");F.exit(1)}if(!G&&M.length>0){let w=await K6();if(!H)console.log(`Successfully generated ${w}`)}if(Q&&M.length>0){let w=c6(O,M);if(w.length>0&&!H)console.log(`Cleaned up ${w.length} stale generated file(s)`)}if(H){let{friendlyNames:w,mixedNames:B}=S6(D),{friendlyNames:P,mixedNames:y}=S6(M),v={success:!0,updatedPackages:D,updatedPackagesFriendly:w,updatedPackagesMixed:B,allProcessedPackages:M,allProcessedFriendly:P,allProcessedMixed:y,totalUpdated:D.length,totalProcessed:M.length,timestamp:new Date().toISOString()};console.log(JSON.stringify(v))}else console.log(`Processed ${M.length} packages.`);clearTimeout(j6),await p(),setTimeout(()=>F.exit(0),1000)}catch(M){if(H){let D={success:!1,error:String(M),timestamp:new Date().toISOString()};console.log(JSON.stringify(D))}else console.error("Error:",M);await p(),setTimeout(()=>F.exit(1),1000)}});A.command("generate-index","Generate TypeScript index file for packages").option("-o, --output-dir <dir>","Directory containing package files",{default:"src/packages"}).action(async(z)=>{let{outputDir:$="src/packages"}=z,Q=b.resolve(F.cwd(),$);if(!L.existsSync(Q))console.error(`Error: Directory ${Q} does not exist`),F.exit(1);try{let Z=await K6();console.log(`Successfully generated ${Z}`),setTimeout(()=>F.exit(0),500)}catch(Z){console.error("Error generating index:",Z),F.exit(1)}});A.command("generate-ts","Generate TypeScript files from cached JSON files").option("--cache-dir <dir>","Directory with cached JSON files",{default:a}).option("--output-dir <dir>","Output directory for TypeScript files",{default:"packages"}).action(async(z)=>{try{console.log("Generating TypeScript files from cached JSON...");let{cacheDir:$,outputDir:Q}=z;if(!L.existsSync($))console.error(`Cache directory ${$} does not exist!`),F.exit(1);if(!L.existsSync(Q))L.mkdirSync(Q,{recursive:!0});let Z=L.readdirSync($).filter((X)=>X.endsWith(".json"));console.log(`Found ${Z.length} JSON files in cache directory`);let Y=0;for(let X of Z)try{let J=L.readFileSync(b.join($,X),"utf-8"),q=JSON.parse(J);delete q.fetchedAt;let j=X.replace(/\.json$/,""),G=i(Q,q.fullPath||q.domain||j,q);console.log(`Generated ${G}`),Y++}catch(J){console.error(`Error processing ${X}:`,J)}console.log(`Successfully generated ${Y} TypeScript files from JSON cache`)}catch($){console.error("Error generating TypeScript files:",$),F.exit(1)}});A.command("generate-aliases","Generate TypeScript aliases file for packages").action(async()=>{try{let z=await i6();console.log(`Successfully generated ${z}`),setTimeout(()=>F.exit(0),500)}catch(z){console.error("Error generating aliases:",z),F.exit(1)}});A.command("generate-docs","Generate comprehensive VitePress documentation for all packages").option("-o, --output-dir <dir>","Output directory for documentation",{default:"docs"}).action(async(z)=>{try{let{outputDir:$="docs"}=z;await p6($),setTimeout(()=>F.exit(0),500)}catch($){console.error("Error generating documentation:",$),F.exit(1)}});A.command("update-pantry","Download and extract the latest pantry.tgz file").option("-d, --pantry-dir <dir>","Directory to extract pantry files",{default:"src/pantry"}).action(async(z)=>{try{let{pantryDir:$="src/pantry"}=z,Q=b.resolve(F.cwd(),$);console.log("Downloading pantry.tgz...");let Z=await fetch("https://s3.amazonaws.com/dist.tea.xyz/pantry.tgz");if(!Z.ok)throw Error(`Failed to download pantry.tgz: ${Z.statusText}`);let Y=await Z.arrayBuffer(),X=b.join(F.cwd(),"pantry.tgz");L.writeFileSync(X,new Uint8Array(Y)),console.log(`Downloaded ${Y.byteLength} bytes`),L.mkdirSync(Q,{recursive:!0});let J=b.join(F.cwd(),"temp-pantry"),{spawn:q}=await import("node:child_process");if(L.existsSync(J))L.rmSync(J,{recursive:!0,force:!0});L.mkdirSync(J,{recursive:!0});let j=q("tar",["-xzf",X,"-C",J,"--strip-components=1"],{stdio:"inherit"});await new Promise((U,W)=>{j.on("close",(H)=>{if(H===0)U(H);else W(Error(`tar extraction failed with code ${H}`))}),j.on("error",W)});let G=b.join(J,"projects");if(L.existsSync(G)){let U=L.readdirSync(G),W=0,H=0,O=(N,M)=>{if(!L.existsSync(M))L.mkdirSync(M,{recursive:!0});for(let D of L.readdirSync(N,{withFileTypes:!0})){let w=b.join(N,D.name),B=b.join(M,D.name);if(D.isDirectory())O(w,B);else if(D.name==="package.yml")if(L.existsSync(B))H++;else L.renameSync(w,B),W++;else if(!L.existsSync(B))L.renameSync(w,B)}};console.log(`Merging ${U.length} projects from upstream...`);for(let N of U){let M=b.join(G,N),D=b.join(Q,N);if(L.statSync(M).isDirectory())O(M,D)}console.log(`Merged upstream pantry: ${W} new packages added, ${H} existing preserved`)}else console.log("Warning: No projects directory found in extracted pantry");if(L.unlinkSync(X),L.existsSync(J))L.rmSync(J,{recursive:!0,force:!0});console.log(`
76
+ Downloading props files from pkgx/pantry GitHub repo...`);let V=await fetch("https://github.com/pkgxdev/pantry/archive/refs/heads/main.tar.gz");if(V.ok){let U=await V.arrayBuffer(),W=b.join(F.cwd(),"pantry-gh.tar.gz"),H=b.join(F.cwd(),"temp-pantry-gh");if(L.writeFileSync(W,new Uint8Array(U)),console.log(`Downloaded GitHub archive: ${(U.byteLength/1024/1024).toFixed(1)} MB`),L.existsSync(H))L.rmSync(H,{recursive:!0,force:!0});L.mkdirSync(H,{recursive:!0});let O=q("tar",["-xzf",W,"-C",H,"--strip-components=1"],{stdio:"inherit"});await new Promise((M,D)=>{O.on("close",(w)=>w===0?M(w):D(Error(`tar failed: ${w}`))),O.on("error",D)});let N=b.join(H,"projects");if(L.existsSync(N)){let M=0,D=0,w=(B,P)=>{if(!L.existsSync(B))return;for(let y of L.readdirSync(B,{withFileTypes:!0})){let v=b.join(B,y.name),k=b.join(P,y.name);if(y.isDirectory())w(v,k);else if(y.name!=="package.yml")if(L.mkdirSync(P,{recursive:!0}),L.copyFileSync(v,k),L.existsSync(k))D++;else M++}};w(N,Q),console.log(`Props files: ${M+D} synced (${M} new, ${D} updated)`)}if(L.unlinkSync(W),L.existsSync(H))L.rmSync(H,{recursive:!0,force:!0})}else console.log(`Warning: Could not download GitHub archive (${V.status}), props files will be missing`);if(console.log("Cleaned up temporary files"),L.existsSync(Q)){let U=L.readdirSync(Q).filter((W)=>{let H=b.join(Q,W);return L.statSync(H).isDirectory()&&!W.startsWith(".")});console.log(`Final result: ${U.length} projects in ${Q}`)}F.exit(0)}catch($){console.error("Error updating pantry:",$),F.exit(1)}});A.command("generate-consts","Generate or update the consts.ts file with all known packages").option("-s, --source <source>",'Source for packages: "pantry" (default) or "registry"',{default:"pantry"}).option("--pantry-dir <dir>","Directory containing pantry files",{default:"src/pantry"}).option("--validate","Validate a sample of packages (slower but more accurate)").action(async(z)=>{try{let{source:$="pantry",pantryDir:Q="src/pantry",validate:Z=!1}=z;console.log(`\uD83D\uDE80 Generating consts.ts file using ${$} as source...`);let Y=[];if($==="pantry")Y=await $0(Q);else if($==="registry")Y=await Q0(Z);else console.error('Invalid source. Use "pantry" or "registry"'),F.exit(1);await Z0(Y,$),console.log("✅ Successfully updated consts.ts"),console.log(`\uD83D\uDCCA Total packages: ${Y.length}`);let X=new Date().toISOString(),J=`Generated from ${$} at ${X}
77
77
  Total packages: ${Y.length}
78
78
 
79
79
  ${Y.join(`
80
- `)}`;W.writeFileSync(`${$}-packages-summary.txt`,J),console.log(`\uD83D\uDCC4 Created ${$}-packages-summary.txt for reference`),L.exit(0)}catch($){console.error("Error generating consts file:",$),L.exit(1)}});A.command("resolve-deps [file]","Resolve all dependencies (including transitive) from a dependency file").option("-f, --file <path>","Path to dependency file (deps.yaml, dependencies.yaml, pkgx.yaml, etc.)").option("-d, --dir <directory>","Directory to search for dependency files",{default:"."}).option("--pantry-dir <dir>","Directory containing pantry files",{default:"src/pantry"}).option("--packages-dir <dir>","Directory containing generated package files",{default:"src/packages"}).option("--target-os <os>","Target OS for OS-specific dependencies (linux, darwin, windows)").option("--include-os-deps","Include OS-specific dependencies in resolution").option("--max-depth <depth>","Maximum recursion depth for dependency resolution",{default:10}).option("-v, --verbose","Enable verbose output").option("-j, --json","Output results as JSON").option("--install-command","Show install commands for resolved packages").action(async(z,$)=>{try{let{dir:Q=".",packagesDir:Z="src/packages",targetOs:Y,includeOsDeps:X=!1,maxDepth:J=10,verbose:q=!1,json:j=!1,installCommand:G=!1}=$,K=z||$.file;if(!K){let F=g6(Q);if(F.length===0)console.error(`No dependency files found in ${Q}`),console.error("Supported filenames: deps.yaml, dependencies.yaml, pkgx.yaml (and .yml variants)"),L.exit(1);else if(F.length>1)console.error(`Multiple dependency files found in ${Q}:`),F.forEach((H)=>console.error(` ${H}`)),console.error("Please specify which file to use with --file or [file] argument"),L.exit(1);else if(K=F[0],!j)console.log(`Found dependency file: ${K}`)}if(!W.existsSync(K))console.error(`Dependency file not found: ${K}`),L.exit(1);let V={packagesDir:Z,includeOsSpecific:X,targetOs:Y,maxDepth:Number.parseInt(String(J),10),verbose:q&&!j};if(!j)console.log("\uD83D\uDD0D Resolving dependencies...");let U=await f6(K,V);if(j){let F={success:!0,file:K,summary:{totalUnique:U.uniquePackages.length,conflicts:U.conflicts.length,osSpecific:{linux:U.osSpecificDeps.linux.length,darwin:U.osSpecificDeps.darwin.length,windows:U.osSpecificDeps.windows.length}},packages:U.uniquePackages,dependencies:U.allDependencies,conflicts:U.conflicts,osSpecificDeps:U.osSpecificDeps,timestamp:new Date().toISOString()};console.log(JSON.stringify(F,null,2))}else{if(console.log(`
80
+ `)}`;L.writeFileSync(`${$}-packages-summary.txt`,J),console.log(`\uD83D\uDCC4 Created ${$}-packages-summary.txt for reference`),F.exit(0)}catch($){console.error("Error generating consts file:",$),F.exit(1)}});A.command("resolve-deps [file]","Resolve all dependencies (including transitive) from a dependency file").option("-f, --file <path>","Path to dependency file (deps.yaml, dependencies.yaml, pkgx.yaml, etc.)").option("-d, --dir <directory>","Directory to search for dependency files",{default:"."}).option("--pantry-dir <dir>","Directory containing pantry files",{default:"src/pantry"}).option("--packages-dir <dir>","Directory containing generated package files",{default:"src/packages"}).option("--target-os <os>","Target OS for OS-specific dependencies (linux, darwin, windows)").option("--include-os-deps","Include OS-specific dependencies in resolution").option("--max-depth <depth>","Maximum recursion depth for dependency resolution",{default:10}).option("-v, --verbose","Enable verbose output").option("-j, --json","Output results as JSON").option("--install-command","Show install commands for resolved packages").action(async(z,$)=>{try{let{dir:Q=".",packagesDir:Z="src/packages",targetOs:Y,includeOsDeps:X=!1,maxDepth:J=10,verbose:q=!1,json:j=!1,installCommand:G=!1}=$,K=z||$.file;if(!K){let W=g6(Q);if(W.length===0)console.error(`No dependency files found in ${Q}`),console.error("Supported filenames: deps.yaml, dependencies.yaml, pkgx.yaml (and .yml variants)"),F.exit(1);else if(W.length>1)console.error(`Multiple dependency files found in ${Q}:`),W.forEach((H)=>console.error(` ${H}`)),console.error("Please specify which file to use with --file or [file] argument"),F.exit(1);else if(K=W[0],!j)console.log(`Found dependency file: ${K}`)}if(!L.existsSync(K))console.error(`Dependency file not found: ${K}`),F.exit(1);let V={packagesDir:Z,includeOsSpecific:X,targetOs:Y,maxDepth:Number.parseInt(String(J),10),verbose:q&&!j};if(!j)console.log("\uD83D\uDD0D Resolving dependencies...");let U=await f6(K,V);if(j){let W={success:!0,file:K,summary:{totalUnique:U.uniquePackages.length,conflicts:U.conflicts.length,osSpecific:{linux:U.osSpecificDeps.linux.length,darwin:U.osSpecificDeps.darwin.length,windows:U.osSpecificDeps.windows.length}},packages:U.uniquePackages,dependencies:U.allDependencies,conflicts:U.conflicts,osSpecificDeps:U.osSpecificDeps,timestamp:new Date().toISOString()};console.log(JSON.stringify(W,null,2))}else{if(console.log(`
81
81
  ✅ Dependency resolution complete!`),console.log(`\uD83D\uDCE6 Total unique packages: ${U.uniquePackages.length}`),U.conflicts.length>0)console.log(`⚠️ Version conflicts: ${U.conflicts.length}`),console.log(`
82
82
  Conflicts found:`),U.conflicts.forEach((H)=>{console.log(` ${H.package}: ${H.versions.join(", ")}`)});if(console.log(`
83
- \uD83D\uDCCB All unique packages to install:`),U.uniquePackages.forEach((H,O)=>{let b=U.allDependencies.find((D)=>D.name===H),M=b&&b.version&&b.version!=="latest"?` (${b.version})`:"";console.log(` ${O+1}. ${H}${M}`)}),G){console.log(`
83
+ \uD83D\uDCCB All unique packages to install:`),U.uniquePackages.forEach((H,O)=>{let N=U.allDependencies.find((D)=>D.name===H),M=N&&N.version&&N.version!=="latest"?` (${N.version})`:"";console.log(` ${O+1}. ${H}${M}`)}),G){console.log(`
84
84
  \uD83D\uDE80 Install commands:`),console.log(`
85
85
  Using pkgx:`);let H=U.uniquePackages.map((O)=>`+${O}`).join(" ");console.log(`sh <(curl https://pkgx.sh) ${H} -- $SHELL -i`),console.log(`
86
86
  Or install individually:`),U.uniquePackages.forEach((O)=>{console.log(`pkgx +${O}`)})}if(Object.values(U.osSpecificDeps).reduce((H,O)=>H+O.length,0)>0)console.log(`
87
- \uD83D\uDDA5️ OS-specific dependencies:`),Object.entries(U.osSpecificDeps).forEach(([H,O])=>{if(O.length>0)console.log(` ${H}: ${O.map((b)=>b.name).join(", ")}`)})}L.exit(0)}catch(Q){if($.json){let Z={success:!1,error:String(Q),timestamp:new Date().toISOString()};console.log(JSON.stringify(Z))}else console.error("Error resolving dependencies:",Q);L.exit(1)}});A.command("get-php-versions","Get PHP versions suitable for CI/CD workflows").option("--format <type>","Output format: json (default), yaml, or csv",{default:"json"}).option("--branches <branches>","Comma-separated list of PHP branches to include (e.g., 8.4,8.3,8.2)").option("--fallback <versions>","Comma-separated list of fallback versions if detection fails").action(async(z)=>{try{let{getPhpVersionsForWorkflow:$}=await import("../chunk-hkhtfzwy.js"),Q={};if(z.branches)Q.supportedBranches=z.branches.split(",").map((Y)=>Y.trim());if(z.fallback)Q.fallbackVersions=z.fallback.split(",").map((Y)=>Y.trim());let Z=$(Q);switch(z.format.toLowerCase()){case"yaml":console.log(`php_versions:
87
+ \uD83D\uDDA5️ OS-specific dependencies:`),Object.entries(U.osSpecificDeps).forEach(([H,O])=>{if(O.length>0)console.log(` ${H}: ${O.map((N)=>N.name).join(", ")}`)})}F.exit(0)}catch(Q){if($.json){let Z={success:!1,error:String(Q),timestamp:new Date().toISOString()};console.log(JSON.stringify(Z))}else console.error("Error resolving dependencies:",Q);F.exit(1)}});A.command("get-php-versions","Get PHP versions suitable for CI/CD workflows").option("--format <type>","Output format: json (default), yaml, or csv",{default:"json"}).option("--branches <branches>","Comma-separated list of PHP branches to include (e.g., 8.4,8.3,8.2)").option("--fallback <versions>","Comma-separated list of fallback versions if detection fails").action(async(z)=>{try{let{getPhpVersionsForWorkflow:$}=await import("../chunk-3a72qsn8.js"),Q={};if(z.branches)Q.supportedBranches=z.branches.split(",").map((Y)=>Y.trim());if(z.fallback)Q.fallbackVersions=z.fallback.split(",").map((Y)=>Y.trim());let Z=$(Q);switch(z.format.toLowerCase()){case"yaml":console.log(`php_versions:
88
88
  ${Z.map((Y)=>` - "${Y}"`).join(`
89
- `)}`);break;case"csv":console.log(Z.join(","));break;case"json":default:console.log(JSON.stringify(Z));break}L.exit(0)}catch($){console.error("Error getting PHP versions:",$),L.exit(1)}});A.command("generate-zig","Generate Zig package definitions from TypeScript packages").option("--packages-dir <dir>","Directory containing TypeScript package files",{default:"src/packages"}).option("--output <file>","Output Zig file path",{default:"packages.zig"}).option("--aliases","Also generate aliases file").option("--aliases-output <file>","Output file for Zig aliases",{default:"aliases.zig"}).action(async(z)=>{try{let{generateZigDefinitions:$,generateZigAliases:Q}=await import("../chunk-k4yefwkp.js"),{packagesDir:Z="src/packages",output:Y="packages.zig",aliases:X=!1,aliasesOutput:J="aliases.zig"}=z;if(console.log("\uD83D\uDE80 Generating Zig package definitions..."),await $(Z,Y),X)console.log(`
89
+ `)}`);break;case"csv":console.log(Z.join(","));break;case"json":default:console.log(JSON.stringify(Z));break}F.exit(0)}catch($){console.error("Error getting PHP versions:",$),F.exit(1)}});A.command("generate-zig","Generate Zig package definitions from TypeScript packages").option("--packages-dir <dir>","Directory containing TypeScript package files",{default:"src/packages"}).option("--output <file>","Output Zig file path",{default:"packages.zig"}).option("--aliases","Also generate aliases file").option("--aliases-output <file>","Output file for Zig aliases",{default:"aliases.zig"}).action(async(z)=>{try{let{generateZigDefinitions:$,generateZigAliases:Q}=await import("../chunk-gyn0s28q.js"),{packagesDir:Z="src/packages",output:Y="packages.zig",aliases:X=!1,aliasesOutput:J="aliases.zig"}=z;if(console.log("\uD83D\uDE80 Generating Zig package definitions..."),await $(Z,Y),X)console.log(`
90
90
  \uD83D\uDE80 Generating Zig package aliases...`),await Q(Z,J);console.log(`
91
- ✅ Zig code generation complete!`),L.exit(0)}catch($){console.error("Error generating Zig definitions:",$),L.exit(1)}});A.command("apps","List installed desktop applications with version info").option("-j, --json","Output as JSON").action(async(z)=>{try{let{scanInstalledApps:$}=await import("../chunk-h8phykmh.js"),Q=$();if(z.json)console.log(JSON.stringify({success:!0,apps:Q,total:Q.length}));else{console.log(`
91
+ ✅ Zig code generation complete!`),F.exit(0)}catch($){console.error("Error generating Zig definitions:",$),F.exit(1)}});A.command("apps","List installed desktop applications with version info").option("-j, --json","Output as JSON").action(async(z)=>{try{let{scanInstalledApps:$}=await import("../chunk-xkqrwk69.js"),Q=$();if(z.json)console.log(JSON.stringify({success:!0,apps:Q,total:Q.length}));else{console.log(`
92
92
  Installed Desktop Apps (${Q.length}):
93
- `),console.log("Application".padEnd(40)+"Version"),console.log("-".repeat(60));for(let Z of Q)console.log(`${Z.name.padEnd(40)}${Z.version}`)}L.exit(0)}catch($){console.error("Error listing apps:",$),L.exit(1)}});A.command("apps-outdated","Check for outdated desktop applications").option("-j, --json","Output as JSON").action(async(z)=>{try{let{checkAppUpdates:$}=await import("../chunk-h8phykmh.js");if(!z.json)console.log("Checking desktop apps for updates...");let Q=$(),Z=Q.filter((Y)=>Y.updateAvailable);if(z.json)console.log(JSON.stringify({success:!0,apps:Q,outdated:Z.length,total:Q.length,timestamp:new Date().toISOString()}));else{if(Z.length>0){console.log(`
93
+ `),console.log("Application".padEnd(40)+"Version"),console.log("-".repeat(60));for(let Z of Q)console.log(`${Z.name.padEnd(40)}${Z.version}`)}F.exit(0)}catch($){console.error("Error listing apps:",$),F.exit(1)}});A.command("apps-outdated","Check for outdated desktop applications").option("-j, --json","Output as JSON").action(async(z)=>{try{let{checkAppUpdates:$}=await import("../chunk-xkqrwk69.js");if(!z.json)console.log("Checking desktop apps for updates...");let Q=$(),Z=Q.filter((Y)=>Y.updateAvailable);if(z.json)console.log(JSON.stringify({success:!0,apps:Q,outdated:Z.length,total:Q.length,timestamp:new Date().toISOString()}));else{if(Z.length>0){console.log(`
94
94
  Outdated Apps (${Z.length}):
95
95
  `),console.log("Application".padEnd(30)+"Current".padEnd(16)+"Latest".padEnd(16)+"Source"),console.log("-".repeat(75));for(let X of Z)console.log(`${X.name.padEnd(30)}${X.currentVersion.padEnd(16)}${(X.latestVersion||"?").padEnd(16)}${X.source}`)}else console.log(`
96
96
  All desktop apps are up to date!`);let Y=Q.filter((X)=>!X.updateAvailable&&X.source!=="system"&&X.source!=="unknown");if(Y.length>0)console.log(`
97
- ${Y.length} app(s) up to date, ${Q.filter((X)=>X.source==="unknown").length} unchecked`)}L.exit(0)}catch($){console.error("Error checking app updates:",$),L.exit(1)}});A.command("apps-update <name>","Update a desktop application via Homebrew").action(async(z)=>{try{let{APP_CASK_MAP:$,getCaskToken:Q,updateApp:Z}=await import("../chunk-h8phykmh.js"),Y=$[z]||Q(z);if(!Y)console.error(`No Homebrew cask found for "${z}"`),L.exit(1);console.log(`Updating ${z} (cask: ${Y})...`);let X=await Z(Y);if(X.success)console.log(`Successfully updated ${z} to ${X.version}`);else console.error(`Failed to update ${z}: ${X.error}`),L.exit(1);L.exit(0)}catch($){console.error("Error updating app:",$),L.exit(1)}});A.help();A.version(v6);var U$=A.parse();if(L.argv.length<=2||L.argv.includes("--help")||L.argv.includes("-h"))L.exit(0);
97
+ ${Y.length} app(s) up to date, ${Q.filter((X)=>X.source==="unknown").length} unchecked`)}F.exit(0)}catch($){console.error("Error checking app updates:",$),F.exit(1)}});A.command("apps-update <name>","Update a desktop application via Homebrew").action(async(z)=>{try{let{APP_CASK_MAP:$,getCaskToken:Q,updateApp:Z}=await import("../chunk-xkqrwk69.js"),Y=$[z]||Q(z);if(!Y)console.error(`No Homebrew cask found for "${z}"`),F.exit(1);console.log(`Updating ${z} (cask: ${Y})...`);let X=await Z(Y);if(X.success)console.log(`Successfully updated ${z} to ${X.version}`);else console.error(`Failed to update ${z}: ${X.error}`),F.exit(1);F.exit(0)}catch($){console.error("Error updating app:",$),F.exit(1)}});A.command("install <pkg>","Install a system package (e.g. ziglang.org@0.17.0-dev)").option("--global","Link binaries into the user-level global bin so they appear on PATH").option("--install-dir <dir>","Where to download into (default: ./pantry)").option("--no-bin-links","Skip creating local .bin/ symlinks").option("--quiet","Suppress progress output").action(async(z,$)=>{let Q=z.lastIndexOf("@"),Z=Q>0,Y=Z?z.slice(0,Q):z,X=Z?z.slice(Q+1):"latest";try{let J=await d6(Y,X,{installDir:$.installDir,createBinLinks:$.binLinks!==!1,quiet:$.quiet,globalBin:$.global?!0:void 0});if(!$.quiet){if(console.log(`
98
+ ✓ ${J.name}@${J.version}`),console.log(` installed to: ${J.installPath}`),J.globalLinks&&J.globalLinks.length>0){if(console.log(` linked into: ${b.dirname(J.globalLinks[0])}`),!F.env.PATH?.split(b.delimiter).includes(b.dirname(J.globalLinks[0])))console.log(`
99
+ ⚠ ${b.dirname(J.globalLinks[0])} is not on your PATH yet.`),console.log(" Run `ts-pantry shell-init --install` once to fix that.")}}F.exit(0)}catch(J){console.error(`Error installing ${z}:`,J instanceof Error?J.message:J),F.exit(1)}});A.command("shell-init","Print the shell snippet that puts pantry-installed packages on PATH").option("--install","Append the snippet to your shell rc file (idempotent)").option("--uninstall","Remove a previously installed snippet").option("--shell <shell>","Force a shell (zsh|bash|fish) instead of autodetect").action(async(z)=>{let $=z.shell??u6();try{if(z.uninstall){let Z=n6({shell:$});console.log(Z.changed?`✓ Removed pantry shell-init from ${Z.rcFile}`:`Nothing to remove (no pantry shell-init block in ${Z.rcFile})`),F.exit(0)}if(z.install){let Z=l6({shell:$});if(Z.changed)console.log(`✓ Added pantry shell-init to ${Z.rcFile}`),console.log(` Restart your shell or run: source ${Z.rcFile}`);else console.log(`✓ Already integrated in ${Z.rcFile}`);F.exit(0)}let Q=m6($);if(F.stdout.isTTY){if(console.log(`# Detected shell: ${$}`),console.log(`# Global bin dir: ${_6()}`),Q)console.log(`# Append this to: ${Q}`);console.log("# Or run: ts-pantry shell-init --install"),console.log()}F.stdout.write(x6({shell:$})),F.exit(0)}catch(Q){console.error("Error:",Q instanceof Error?Q.message:Q),F.exit(1)}});A.help();A.version(v6);var w$=A.parse();if(F.argv.length<=2||F.argv.includes("--help")||F.argv.includes("-h"))F.exit(0);
@@ -1,3 +1,3 @@
1
1
  import{execSync as $}from"node:child_process";import z from"node:fs";var O={Arc:"arc","Brave Browser":"brave-browser",Firefox:"firefox","Google Chrome":"google-chrome","Microsoft Edge":"microsoft-edge",Opera:"opera",Vivaldi:"vivaldi","Zen Browser":"zen-browser",Orion:"orion",Chromium:"chromium","Tor Browser":"tor-browser","Visual Studio Code":"visual-studio-code",Cursor:"cursor",Zed:"zed","Sublime Text":"sublime-text","Sublime Merge":"sublime-merge",Nova:"nova",BBEdit:"bbedit",CotEditor:"coteditor","IntelliJ IDEA":"intellij-idea","IntelliJ IDEA CE":"intellij-idea-ce",PhpStorm:"phpstorm",WebStorm:"webstorm",PyCharm:"pycharm","PyCharm CE":"pycharm-ce",RubyMine:"rubymine",CLion:"clion",GoLand:"goland",DataGrip:"datagrip",Rider:"rider","Android Studio":"android-studio",Fleet:"jetbrains-fleet",iTerm:"iterm2",Ghostty:"ghostty",Warp:"warp",Alacritty:"alacritty",Kitty:"kitty",Hyper:"hyper","GitHub Desktop":"github",GitKraken:"gitkraken",Tower:"tower",Fork:"fork",Tinkerwell:"tinkerwell",TablePlus:"tableplus","Sequel Pro":"sequel-pro","Sequel Ace":"sequel-ace",Postman:"postman",Insomnia:"insomnia",Proxyman:"proxyman",Docker:"docker",OrbStack:"orbstack",Dynobase:"dynobase",HTTPie:"httpie",Charles:"charles",Paw:"paw",Dash:"dash",SourceTree:"sourcetree",WhatsApp:"whatsapp",Slack:"slack",Discord:"discord",Telegram:"telegram","Microsoft Teams":"microsoft-teams",Zoom:"zoom",Signal:"signal",Skype:"skype",Lark:"lark",Claude:"claude",ChatGPT:"chatgpt",Obsidian:"obsidian",Notion:"notion",Bear:"bear",Craft:"craft",Logseq:"logseq",Typora:"typora",Joplin:"joplin",Things3:"things",Things:"things",Todoist:"todoist",TickTick:"ticktick",Fantastical:"fantastical",Spark:"readdle-spark","1Password":"1password","1Password 7":"1password",Raycast:"raycast",Alfred:"alfred",BetterTouchTool:"bettertouchtool",Bartender:"bartender",Setapp:"setapp","Grammarly Desktop":"grammarly-desktop",Spotify:"spotify",IINA:"iina",VLC:"vlc",HandBrake:"handbrake",Kap:"kap",OBS:"obs","DaVinci Resolve":"davinci-resolve",Plex:"plex",Audacity:"audacity","Elmedia Player":"elmedia-player",Figma:"figma",Sketch:"sketch","Affinity Designer":"affinity-designer","Affinity Designer 2":"affinity-designer","Affinity Photo":"affinity-photo","Affinity Photo 2":"affinity-photo","Affinity Publisher":"affinity-publisher","Affinity Publisher 2":"affinity-publisher",ImageOptim:"imageoptim","Pixelmator Pro":"pixelmator-pro",Canva:"canva",AppCleaner:"appcleaner",Pearcleaner:"pearcleaner",CleanMyMac:"cleanmymac","CleanMyMac X":"cleanmymac",Caffeine:"caffeine",KeepingYouAwake:"keepingyouawake",Muzzle:"muzzle",Rectangle:"rectangle",Magnet:"magnet",MonitorControl:"monitorcontrol","iStat Menus":"istat-menus","CleanShot X":"cleanshot",Shottr:"shottr","Karabiner-Elements":"karabiner-elements","Logi Options+":"logi-options-plus",logioptionsplus:"logi-options-plus","Logi Options Plus":"logi-options-plus",Transmit:"transmit",Cyberduck:"cyberduck","The Unarchiver":"the-unarchiver",Keka:"keka",ForkLift:"forklift","Mountain Duck":"mountain-duck","Parallels Desktop":"parallels","VMware Fusion":"vmware-fusion",UTM:"utm",Steam:"steam","Epic Games Launcher":"epic-games",Tailscale:"tailscale",WireGuard:"wireguard-go",NordVPN:"nordvpn","Mullvad VPN":"mullvad-vpn","MongoDB Compass":"mongodb-compass","Redis Insight":"redisinsight","Robo 3T":"robo-3t",Numi:"numi",Maccy:"maccy",Camo:"camo",Linear:"linear-linear",Loom:"loom",Dropbox:"dropbox","Google Drive":"google-drive",OneDrive:"onedrive",MediaInfo:"mediainfo"},E=new Set(["Safari","Numbers","Pages","Keynote","GarageBand","iMovie","Color Picker","Simulator","Simulator (Watch)","Preview","TextEdit","Automator","Font Book","Migration Assistant","Photo Booth","System Preferences","System Settings","Disk Utility","Terminal","Activity Monitor","Console","Grapher","Script Editor","Time Machine","Photos","Mail","Calendar","Contacts","Reminders","Notes","Maps","Messages","FaceTime","Books","News","Stocks","Weather","Home","Podcasts","Music","TV","Voice Memos","Freeform","Shortcuts","Chess","Dictionary","Stickies","Image Capture","Xcode"]),I=new Set(["Xcode","Numbers","Pages","Keynote","GarageBand","iMovie","Things3","Grammarly for Safari","AdBlock","HP Smart","Audible","CleanMyMac_5_MAS","Mini Motorways","Snake.io+","Numbers Creator Studio"]);function D(G,F){if(!G||!F||G===F)return!1;if(F==="?")return!!G;let L=(Q)=>Q.replace(/[,+].*/g,"").replace(/-.*$/,"").split(".").map((R)=>Number.parseInt(R,10)||0),J=L(G),W=L(F);for(let Q=0;Q<Math.max(J.length,W.length);Q++){let R=J[Q]||0,j=W[Q]||0;if(R>j)return!0;if(R<j)return!1}return!1}function w(G){if(/[+()_]/.test(G))return null;if(G.length<2)return null;return G.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").trim()||null}function C(G){if(O[G])return O[G];return w(G)}function V(G="/Applications"){if(process.platform!=="darwin")return[];let F=[];if(!z.existsSync(G))return F;let L=z.readdirSync(G).filter((J)=>J.endsWith(".app"));for(let J of L){let W=J.replace(/\.app$/,""),Q=`${G}/${J}`,R="?",j;try{let H=`${Q}/Contents/Info.plist`;if(z.existsSync(H)){let X=$(`/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${H}" 2>/dev/null`,{timeout:5000,encoding:"utf-8"}).trim();if(X)R=X;try{j=$(`/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "${H}" 2>/dev/null`,{timeout:5000,encoding:"utf-8"}).trim()||void 0}catch{}}}catch{}F.push({name:W,version:R,path:Q,bundleId:j})}return F}function _(G){let F=new Map;if(G.length===0)return F;let L=20;for(let J=0;J<G.length;J+=L){let W=G.slice(J,J+L);try{let Q=$(["brew","info","--cask","--json=v2",...W].map((j)=>`'${j.replace(/'/g,"'\\''")}'`).join(" "),{timeout:60000,encoding:"utf-8",maxBuffer:10485760,shell:"/bin/sh"});if(!Q)continue;let R=JSON.parse(Q);for(let j of R.casks||[]){let H=[];for(let X of j.artifacts||[])if(X.app){for(let Z of X.app)if(typeof Z==="string")H.push(Z.replace(/\.app$/,""))}F.set(j.token,{token:j.token,version:(j.version||"").split(",")[0],autoUpdates:j.auto_updates||!1,appNames:H})}}catch{for(let Q of W)try{let R=$(`brew info --cask --json=v2 ${Q} 2>/dev/null`,{timeout:15000,encoding:"utf-8"});if(!R)continue;let H=JSON.parse(R).casks?.[0];if(H){let X=[];for(let Z of H.artifacts||[])if(Z.app){for(let q of Z.app)if(typeof q==="string")X.push(q.replace(/\.app$/,""))}F.set(H.token,{token:H.token,version:(H.version||"").split(",")[0],autoUpdates:H.auto_updates||!1,appNames:X})}}catch{}}}return F}function M(G){let F=G||V(),L=[],J=new Map,W=new Map;for(let j of F){if(E.has(j.name))continue;let H=C(j.name);if(H){W.set(j.name,H);let X=J.get(H)||[];X.push(j),J.set(H,X)}}let Q=Array.from(J.keys()),R=_(Q);for(let j of F){let H=E.has(j.name),X=I.has(j.name),Z=W.get(j.name)||null,q=Z?R.get(Z):null,B="unknown",K=null,Y=!1,U=!1;if(H)B="system";else if(X)B="mas";else if(q)if(K=q.version,U=q.autoUpdates,U)B="self-updating",Y=D(K,j.version);else B="brew-cask",Y=D(K,j.version);L.push({name:j.name,currentVersion:j.version,latestVersion:K,updateAvailable:Y,source:B,caskToken:Z,autoUpdates:U})}return L.sort((j,H)=>{if(j.updateAvailable&&!H.updateAvailable)return-1;if(!j.updateAvailable&&H.updateAvailable)return 1;return j.name.localeCompare(H.name)}),L}async function h(G){try{try{$(`brew upgrade --cask '${G.replace(/'/g,"'\\''")}' 2>&1`,{timeout:120000,encoding:"utf-8"});let F=G.replace(/'/g,"'\\''"),L=$(`brew info --cask --json=v2 '${F}' 2>/dev/null`,{timeout:15000,encoding:"utf-8"});return{success:!0,version:JSON.parse(L).casks?.[0]?.version?.split(",")?.[0]||"latest"}}catch(F){let L=F.stderr?.toString()||F.message||"",J=G.replace(/'/g,"'\\''");if(L.includes("not installed")||L.includes("No available")){$(`brew install --cask '${J}' 2>&1`,{timeout:120000,encoding:"utf-8"});let W=$(`brew info --cask --json=v2 '${J}' 2>/dev/null`,{timeout:15000,encoding:"utf-8"});return{success:!0,version:JSON.parse(W).casks?.[0]?.version?.split(",")?.[0]||"latest"}}throw F}}catch(F){return{success:!1,error:(F.stderr?.toString()||F.stdout?.toString()||F.message||"Update failed").trim().split(`
2
2
  `).pop()||"Update failed"}}}
3
- export{O as Ba,E as Ca,I as Da,D as Ea,w as Fa,C as Ga,V as Ha,_ as Ia,M as Ja,h as Ka};
3
+ export{O as Ha,E as Ia,I as Ja,D as Ka,w as La,C as Ma,V as Na,_ as Oa,M as Pa,h as Qa};