aicommits 1.5.0 → 1.6.0

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 (3) hide show
  1. package/README.md +79 -13
  2. package/dist/cli.mjs +79 -68
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -64,6 +64,15 @@ aicommits --dry-run
64
64
 
65
65
  > 👉 **Tip:** Use the `aic` alias if `aicommits` is too long for you.
66
66
 
67
+ #### Generate multiple recommendations
68
+
69
+ Sometimes the recommended commit message isn't the best so you want it to generate a few to pick from. You can generate multiple commit messages at once by passing in the `--generate` flag:
70
+ ```sh
71
+ aicommits --generate # or -g
72
+ ```
73
+
74
+ > Warning: this uses more tokens, meaning it costs more.
75
+
67
76
  ### Git hook
68
77
 
69
78
  You can also integrate _aicommits_ with Git via the [`prepare-commit-msg`](https://git-scm.com/docs/githooks#_prepare_commit_msg) hook. This lets you use Git like you normally would, and edit the commit message before committing.
@@ -96,6 +105,75 @@ aicommits hook uninstall
96
105
 
97
106
  3. Save and close the editor to commit!
98
107
 
108
+ ## Configuration
109
+
110
+ ### Reading a configuration value
111
+ To retrieve a configuration option, use the command:
112
+
113
+ ```sh
114
+ aicommits config get <key>
115
+ ```
116
+
117
+ For example, to retrieve the API key, you can use:
118
+ ```sh
119
+ aicommits config get OPENAI_KEY
120
+ ```
121
+
122
+ You can also retrieve multiple configuration options at once by separating them with spaces:
123
+
124
+ ```sh
125
+ aicommits config get OPENAI_KEY generate
126
+ ```
127
+
128
+ ### Setting a configuration value
129
+
130
+ To set a configuration option, use the command:
131
+
132
+ ```sh
133
+ aicommits config set <key>=<value>
134
+ ```
135
+
136
+ For example, to set the API key, you can use:
137
+
138
+ ```sh
139
+ aicommits config set OPENAI_KEY=<your-api-key>
140
+ ```
141
+
142
+ You can also set multiple configuration options at once by separating them with spaces, like
143
+
144
+ ```sh
145
+ aicommits config set OPENAI_KEY=<your-api-key> generate=3 locale=en
146
+ ```
147
+
148
+ ### Options
149
+ #### OPENAI_KEY
150
+
151
+ Required
152
+
153
+ The OpenAI API key. You can retrieve it from [OpenAI API Keys page](https://platform.openai.com/account/api-keys).
154
+
155
+ #### locale
156
+ Default: `en`
157
+
158
+ The locale to use for the generated commit messages. Consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes.
159
+
160
+ #### generate
161
+
162
+ Default: `1`
163
+
164
+ The number of commit messages to generate to pick from.
165
+
166
+ Note, this will use more tokens as it generates more results.
167
+
168
+ #### proxy
169
+
170
+ Set a HTTP/HTTPS proxy to use for requests.
171
+
172
+ To clear the proxy option, you can use the command (note the empty value after the equals sign):
173
+
174
+ ```sh
175
+ aicommits config set proxy=
176
+ ```
99
177
 
100
178
  ## How it works
101
179
 
@@ -103,18 +181,6 @@ This CLI tool runs `git diff` to grab all your latest code changes, sends them t
103
181
 
104
182
  Video coming soon where I rebuild it from scratch to show you how to easily build your own CLI tools powered by AI.
105
183
 
106
- ## Future tasks
107
-
108
- - Add support for conventional commits as a flag that users can enable
109
- - Migrate to chatGPT instead of GPT-3
110
- - Add support for diffs greater than 200 lines by grabbing the diff per file, optional flag
111
- - Add ability to specify a commit message from inside aicommit if user doesn't like generated one
112
- - Play around with prompt to produce optimal result
113
- - Add an alias called `aic` that does "git add . && aicommits && git push"
114
- - Add opt-in emoji flag to preface commits with an emoji, use [this](https://gitmoji.dev) as a guide
115
- - Add opt-in languages flag where it returns the commit in different languages
116
- - Build landing page for the 2.0 launch
117
-
118
184
  ## Maintainers
119
185
 
120
186
  - **Hassan El Mghari**: [@Nutlope](https://github.com/Nutlope) [<img src="https://img.shields.io/twitter/follow/nutlope?style=flat&label=nutlope&logo=twitter&color=0bf&logoColor=fff" align="center">](https://twitter.com/nutlope)
@@ -125,4 +191,4 @@ Video coming soon where I rebuild it from scratch to show you how to easily buil
125
191
 
126
192
  ## Contributing
127
193
 
128
- If you want to help fix a bug or implement a feature in [Issues](https://github.com/Nutlope/aicommits/issues), checkout the [Contribution Guide](CONTRIBUTING.md) to learn how to setup and test the project.
194
+ If you want to help fix a bug or implement a feature in [Issues](https://github.com/Nutlope/aicommits/issues), checkout the [Contribution Guide](CONTRIBUTING.md) to learn how to setup and test the project.
package/dist/cli.mjs CHANGED
@@ -1,78 +1,89 @@
1
1
  #!/usr/bin/env node
2
- import cu from"tty";import{Buffer as Lt}from"node:buffer";import L from"node:path";import lu from"node:child_process";import g,{stdin as fu,stdout as du}from"node:process";import Mt from"child_process";import V from"path";import Ee from"fs";import Gt from"node:url";import Ut,{constants as pu}from"node:os";import Wt from"assert";import Kt from"events";import qt from"buffer";import ge from"stream";import zt from"util";import*as ee from"node:readline";import Fu from"node:readline";import{WriteStream as Vt}from"node:tty";import v from"fs/promises";import Ht from"os";import Yt from"https";import{encoding_for_model as Jt}from"@dqbd/tiktoken";import{fileURLToPath as Xt}from"url";const Zt="known-flag",Qt="unknown-flag",en="argument",{stringify:H}=JSON,un=/\B([A-Z])/g,tn=e=>e.replace(un,"-$1").toLowerCase(),{hasOwnProperty:nn}=Object.prototype,Y=(e,u)=>nn.call(e,u),Dn=e=>Array.isArray(e),mu=e=>typeof e=="function"?[e,!1]:Dn(e)?[e[0],!0]:mu(e.type),rn=(e,u)=>e===Boolean?u!=="false":u,on=(e,u)=>typeof u=="boolean"?u:e===Number&&u===""?Number.NaN:e(u),sn=/[\s.:=]/,an=e=>{const u=`Flag name ${H(e)}`;if(e.length===0)throw new Error(`${u} cannot be empty`);if(e.length===1)throw new Error(`${u} must be longer than a character`);const t=e.match(sn);if(t)throw new Error(`${u} cannot contain ${H(t?.[0])}`)},cn=e=>{const u={},t=(n,D)=>{if(Y(u,n))throw new Error(`Duplicate flags named ${H(n)}`);u[n]=D};for(const n in e){if(!Y(e,n))continue;an(n);const D=e[n],r=[[],...mu(D),D];t(n,r);const i=tn(n);if(n!==i&&t(i,r),"alias"in D&&typeof D.alias=="string"){const{alias:o}=D,s=`Flag alias ${H(o)} for flag ${H(n)}`;if(o.length===0)throw new Error(`${s} cannot be empty`);if(o.length>1)throw new Error(`${s} must be a single character`);t(o,r)}}return u},ln=(e,u)=>{const t={};for(const n in e){if(!Y(e,n))continue;const[D,,r,i]=u[n];if(D.length===0&&"default"in i){let{default:o}=i;typeof o=="function"&&(o=o()),t[n]=o}else t[n]=r?D:D.pop()}return t},ue="--",fn=/[.:=]/,dn=/^-{1,2}\w/,pn=e=>{if(!dn.test(e))return;const u=!e.startsWith(ue);let t=e.slice(u?1:2),n;const D=t.match(fn);if(D){const{index:r}=D;n=t.slice(r+1),t=t.slice(0,r)}return[t,n,u]},Fn=(e,{onFlag:u,onArgument:t})=>{let n;const D=(r,i)=>{if(typeof n!="function")return!0;n(r,i),n=void 0};for(let r=0;r<e.length;r+=1){const i=e[r];if(i===ue){D();const s=e.slice(r+1);t?.(s,[r],!0);break}const o=pn(i);if(o){if(D(),!u)continue;const[s,a,l]=o;if(l)for(let c=0;c<s.length;c+=1){D();const f=c===s.length-1;n=u(s[c],f?a:void 0,[r,c+1,f])}else n=u(s,a,[r])}else D(i,[r])&&t?.([i],[r])}D()},mn=(e,u)=>{for(const[t,n,D]of u.reverse()){if(n){const r=e[t];let i=r.slice(0,n);if(D||(i+=r.slice(n+1)),i!=="-"){e[t]=i;continue}}e.splice(t,1)}},Cn=(e,u=process.argv.slice(2),{ignore:t}={})=>{const n=[],D=cn(e),r={},i=[];return i[ue]=[],Fn(u,{onFlag(o,s,a){const l=Y(D,o);if(!t?.(l?Zt:Qt,o,s)){if(l){const[c,f]=D[o],d=rn(f,s),F=(E,b)=>{n.push(a),b&&n.push(b),c.push(on(f,E||""))};return d===void 0?F:F(d)}Y(r,o)||(r[o]=[]),r[o].push(s===void 0?!0:s),n.push(a)}},onArgument(o,s,a){t?.(en,u[s[0]])||(i.push(...o),a?(i[ue]=o,u.splice(s[0])):n.push(s))}}),mn(u,n),{flags:ln(e,D),unknownFlags:r,_:i}};var hn=Object.create,te=Object.defineProperty,En=Object.defineProperties,gn=Object.getOwnPropertyDescriptor,Bn=Object.getOwnPropertyDescriptors,wn=Object.getOwnPropertyNames,Cu=Object.getOwnPropertySymbols,bn=Object.getPrototypeOf,hu=Object.prototype.hasOwnProperty,yn=Object.prototype.propertyIsEnumerable,Eu=(e,u,t)=>u in e?te(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,ne=(e,u)=>{for(var t in u||(u={}))hu.call(u,t)&&Eu(e,t,u[t]);if(Cu)for(var t of Cu(u))yn.call(u,t)&&Eu(e,t,u[t]);return e},Be=(e,u)=>En(e,Bn(u)),$n=e=>te(e,"__esModule",{value:!0}),An=(e,u)=>()=>(e&&(u=e(e=0)),u),vn=(e,u)=>()=>(u||e((u={exports:{}}).exports,u),u.exports),xn=(e,u,t,n)=>{if(u&&typeof u=="object"||typeof u=="function")for(let D of wn(u))!hu.call(e,D)&&(t||D!=="default")&&te(e,D,{get:()=>u[D],enumerable:!(n=gn(u,D))||n.enumerable});return e},Sn=(e,u)=>xn($n(te(e!=null?hn(bn(e)):{},"default",!u&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),y=An(()=>{}),On=vn((e,u)=>{y(),u.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});y(),y(),y();var In=e=>{var u,t,n;let D=(u=process.stdout.columns)!=null?u:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(D)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:D}:{columns:(t=e.columns)!=null?t:[],stdoutColumns:(n=e.stdoutColumns)!=null?n:D}};y(),y(),y(),y(),y();function Tn({onlyFirst:e=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,e?void 0:"g")}function gu(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Tn(),"")}y();function Pn(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var kn=Sn(On(),1);function k(e){if(typeof e!="string"||e.length===0||(e=gu(e),e.length===0))return 0;e=e.replace((0,kn.default)()," ");let u=0;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&t++,u+=Pn(n)?2:1)}return u}var Bu=e=>Math.max(...e.split(`
3
- `).map(k)),Rn=e=>{let u=[];for(let t of e){let{length:n}=t,D=n-u.length;for(let r=0;r<D;r+=1)u.push(0);for(let r=0;r<n;r+=1){let i=Bu(t[r]);i>u[r]&&(u[r]=i)}}return u};y();var wu=/^\d+%$/,bu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},_n=(e,u)=>{var t;let n=[];for(let D=0;D<e.length;D+=1){let r=(t=u[D])!=null?t:"auto";if(typeof r=="number"||r==="auto"||r==="content-width"||typeof r=="string"&&wu.test(r)){n.push(Be(ne({},bu),{width:r,contentWidth:e[D]}));continue}if(r&&typeof r=="object"){let i=Be(ne(ne({},bu),r),{contentWidth:e[D]});i.horizontalPadding=i.paddingLeft+i.paddingRight,n.push(i);continue}throw new Error(`Invalid column width: ${JSON.stringify(r)}`)}return n};function jn(e,u){for(let t of e){let{width:n}=t;if(n==="content-width"&&(t.width=t.contentWidth),n==="auto"){let s=Math.min(20,t.contentWidth);t.width=s,t.autoOverflow=t.contentWidth-s}if(typeof n=="string"&&wu.test(n)){let s=Number.parseFloat(n.slice(0,-1))/100;t.width=Math.floor(u*s)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:D}=t,r=1,i=r+D;if(i>=u){let s=i-u,a=Math.ceil(t.paddingLeft/D*s),l=s-a;t.paddingLeft-=a,t.paddingRight-=l,t.horizontalPadding=t.paddingLeft+t.paddingRight}t.paddingLeftString=t.paddingLeft?" ".repeat(t.paddingLeft):"",t.paddingRightString=t.paddingRight?" ".repeat(t.paddingRight):"";let o=u-t.horizontalPadding;t.width=Math.max(Math.min(t.width,o),r)}}var yu=()=>Object.assign([],{columns:0});function Nn(e,u){let t=[yu()],[n]=t;for(let D of e){let r=D.width+D.horizontalPadding;n.columns+r>u&&(n=yu(),t.push(n)),n.push(D),n.columns+=r}for(let D of t){let r=D.reduce((f,d)=>f+d.width+d.horizontalPadding,0),i=u-r;if(i===0)continue;let o=D.filter(f=>"autoOverflow"in f),s=o.filter(f=>f.autoOverflow>0),a=s.reduce((f,d)=>f+d.autoOverflow,0),l=Math.min(a,i);for(let f of s){let d=Math.floor(f.autoOverflow/a*l);f.width+=d,i-=d}let c=Math.floor(i/o.length);for(let f=0;f<o.length;f+=1){let d=o[f];f===o.length-1?d.width+=i:d.width+=c,i-=c}}return t}function Ln(e,u,t){let n=_n(t,u);return jn(n,e),Nn(n,e)}y(),y(),y();var we=10,$u=(e=0)=>u=>`\x1B[${u+e}m`,Au=(e=0)=>u=>`\x1B[${38+e};5;${u}m`,vu=(e=0)=>(u,t,n)=>`\x1B[${38+e};2;${u};${t};${n}m`;function Mn(){let e=new Map,u={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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(let[t,n]of Object.entries(u)){for(let[D,r]of Object.entries(n))u[D]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[D]=u[D],e.set(r[0],r[1]);Object.defineProperty(u,t,{value:n,enumerable:!1})}return Object.defineProperty(u,"codes",{value:e,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi=$u(),u.color.ansi256=Au(),u.color.ansi16m=vu(),u.bgColor.ansi=$u(we),u.bgColor.ansi256=Au(we),u.bgColor.ansi16m=vu(we),Object.defineProperties(u,{rgbToAnsi256:{value:(t,n,D)=>t===n&&n===D?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(D/255*5),enumerable:!1},hexToRgb:{value:t=>{let n=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!n)return[0,0,0];let{colorString:D}=n.groups;D.length===3&&(D=D.split("").map(i=>i+i).join(""));let r=Number.parseInt(D,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:t=>u.rgbToAnsi256(...u.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,D,r;if(t>=232)n=((t-232)*10+8)/255,D=n,r=n;else{t-=16;let s=t%36;n=Math.floor(t/36)/5,D=Math.floor(s/6)/5,r=s%6/5}let i=Math.max(n,D,r)*2;if(i===0)return 30;let o=30+(Math.round(r)<<2|Math.round(D)<<1|Math.round(n));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,n,D)=>u.ansi256ToAnsi(u.rgbToAnsi256(t,n,D)),enumerable:!1},hexToAnsi:{value:t=>u.ansi256ToAnsi(u.hexToAnsi256(t)),enumerable:!1}}),u}var Gn=Mn(),Un=Gn,De=new Set(["\x1B","\x9B"]),Wn=39,be="\x07",xu="[",Kn="]",Su="m",ye=`${Kn}8;;`,Ou=e=>`${De.values().next().value}${xu}${e}${Su}`,Iu=e=>`${De.values().next().value}${ye}${e}${be}`,qn=e=>e.split(" ").map(u=>k(u)),$e=(e,u,t)=>{let n=[...u],D=!1,r=!1,i=k(gu(e[e.length-1]));for(let[o,s]of n.entries()){let a=k(s);if(i+a<=t?e[e.length-1]+=s:(e.push(s),i=0),De.has(s)&&(D=!0,r=n.slice(o+1).join("").startsWith(ye)),D){r?s===be&&(D=!1,r=!1):s===Su&&(D=!1);continue}i+=a,i===t&&o<n.length-1&&(e.push(""),i=0)}!i&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},zn=e=>{let u=e.split(" "),t=u.length;for(;t>0&&!(k(u[t-1])>0);)t--;return t===u.length?e:u.slice(0,t).join(" ")+u.slice(t).join("")},Vn=(e,u,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let n="",D,r,i=qn(e),o=[""];for(let[a,l]of e.split(" ").entries()){t.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let c=k(o[o.length-1]);if(a!==0&&(c>=u&&(t.wordWrap===!1||t.trim===!1)&&(o.push(""),c=0),(c>0||t.trim===!1)&&(o[o.length-1]+=" ",c++)),t.hard&&i[a]>u){let f=u-c,d=1+Math.floor((i[a]-f-1)/u);Math.floor((i[a]-1)/u)<d&&o.push(""),$e(o,l,u);continue}if(c+i[a]>u&&c>0&&i[a]>0){if(t.wordWrap===!1&&c<u){$e(o,l,u);continue}o.push("")}if(c+i[a]>u&&t.wordWrap===!1){$e(o,l,u);continue}o[o.length-1]+=l}t.trim!==!1&&(o=o.map(a=>zn(a)));let s=[...o.join(`
4
- `)];for(let[a,l]of s.entries()){if(n+=l,De.has(l)){let{groups:f}=new RegExp(`(?:\\${xu}(?<code>\\d+)m|\\${ye}(?<uri>.*)${be})`).exec(s.slice(a).join(""))||{groups:{}};if(f.code!==void 0){let d=Number.parseFloat(f.code);D=d===Wn?void 0:d}else f.uri!==void 0&&(r=f.uri.length===0?void 0:f.uri)}let c=Un.codes.get(Number(D));s[a+1]===`
5
- `?(r&&(n+=Iu("")),D&&c&&(n+=Ou(c))):l===`
6
- `&&(D&&c&&(n+=Ou(D)),r&&(n+=Iu(r)))}return n};function Hn(e,u,t){return String(e).normalize().replace(/\r\n/g,`
2
+ import ce from"tty";import{Buffer as wn}from"node:buffer";import W from"node:path";import Ot from"node:child_process";import b,{stdin as It,stdout as Tt}from"node:process";import Bn from"child_process";import X from"path";import Te from"fs";import $n from"node:url";import vn,{constants as Pt}from"node:os";import _t from"assert";import Rt from"events";import An from"buffer";import Pe from"stream";import kt from"util";import*as le from"node:readline";import Mt from"node:readline";import{WriteStream as xn}from"node:tty";import O from"fs/promises";import jt from"os";import Sn from"https";import{encoding_for_model as On}from"@dqbd/tiktoken";import In from"net";import Tn from"tls";import Pn,{fileURLToPath as _n}from"url";const Rn="known-flag",kn="unknown-flag",Mn="argument",{stringify:Z}=JSON,jn=/\B([A-Z])/g,Ln=e=>e.replace(jn,"-$1").toLowerCase(),{hasOwnProperty:Nn}=Object.prototype,Q=(e,t)=>Nn.call(e,t),Gn=e=>Array.isArray(e),Lt=e=>typeof e=="function"?[e,!1]:Gn(e)?[e[0],!0]:Lt(e.type),Un=(e,t)=>e===Boolean?t!=="false":t,Wn=(e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),qn=/[\s.:=]/,Hn=e=>{const t=`Flag name ${Z(e)}`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const n=e.match(qn);if(n)throw new Error(`${t} cannot contain ${Z(n?.[0])}`)},zn=e=>{const t={},n=(u,r)=>{if(Q(t,u))throw new Error(`Duplicate flags named ${Z(u)}`);t[u]=r};for(const u in e){if(!Q(e,u))continue;Hn(u);const r=e[u],o=[[],...Lt(r),r];n(u,o);const s=Ln(u);if(u!==s&&n(s,o),"alias"in r&&typeof r.alias=="string"){const{alias:i}=r,D=`Flag alias ${Z(i)} for flag ${Z(u)}`;if(i.length===0)throw new Error(`${D} cannot be empty`);if(i.length>1)throw new Error(`${D} must be a single character`);n(i,o)}}return t},Kn=(e,t)=>{const n={};for(const u in e){if(!Q(e,u))continue;const[r,,o,s]=t[u];if(r.length===0&&"default"in s){let{default:i}=s;typeof i=="function"&&(i=i()),n[u]=i}else n[u]=o?r:r.pop()}return n},fe="--",Vn=/[.:=]/,Yn=/^-{1,2}\w/,Jn=e=>{if(!Yn.test(e))return;const t=!e.startsWith(fe);let n=e.slice(t?1:2),u;const r=n.match(Vn);if(r){const{index:o}=r;u=n.slice(o+1),n=n.slice(0,o)}return[n,u,t]},Xn=(e,{onFlag:t,onArgument:n})=>{let u;const r=(o,s)=>{if(typeof u!="function")return!0;u(o,s),u=void 0};for(let o=0;o<e.length;o+=1){const s=e[o];if(s===fe){r();const D=e.slice(o+1);n?.(D,[o],!0);break}const i=Jn(s);if(i){if(r(),!t)continue;const[D,l,f]=i;if(f)for(let a=0;a<D.length;a+=1){r();const c=a===D.length-1;u=t(D[a],c?l:void 0,[o,a+1,c])}else u=t(D,l,[o])}else r(s,[o])&&n?.([s],[o])}r()},Zn=(e,t)=>{for(const[n,u,r]of t.reverse()){if(u){const o=e[n];let s=o.slice(0,u);if(r||(s+=o.slice(u+1)),s!=="-"){e[n]=s;continue}}e.splice(n,1)}},Qn=(e,t=process.argv.slice(2),{ignore:n}={})=>{const u=[],r=zn(e),o={},s=[];return s[fe]=[],Xn(t,{onFlag(i,D,l){const f=Q(r,i);if(!n?.(f?Rn:kn,i,D)){if(f){const[a,c]=r[i],d=Un(c,D),p=(m,h)=>{u.push(l),h&&u.push(h),a.push(Wn(c,m||""))};return d===void 0?p:p(d)}Q(o,i)||(o[i]=[]),o[i].push(D===void 0?!0:D),u.push(l)}},onArgument(i,D,l){n?.(Mn,t[D[0]])||(s.push(...i),l?(s[fe]=i,t.splice(D[0])):u.push(D))}}),Zn(t,u),{flags:Kn(e,r),unknownFlags:o,_:s}};var er=Object.create,de=Object.defineProperty,tr=Object.defineProperties,ur=Object.getOwnPropertyDescriptor,nr=Object.getOwnPropertyDescriptors,rr=Object.getOwnPropertyNames,Nt=Object.getOwnPropertySymbols,or=Object.getPrototypeOf,Gt=Object.prototype.hasOwnProperty,sr=Object.prototype.propertyIsEnumerable,Ut=(e,t,n)=>t in e?de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pe=(e,t)=>{for(var n in t||(t={}))Gt.call(t,n)&&Ut(e,n,t[n]);if(Nt)for(var n of Nt(t))sr.call(t,n)&&Ut(e,n,t[n]);return e},_e=(e,t)=>tr(e,nr(t)),ir=e=>de(e,"__esModule",{value:!0}),Dr=(e,t)=>()=>(e&&(t=e(e=0)),t),ar=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),cr=(e,t,n,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of rr(t))!Gt.call(e,r)&&(n||r!=="default")&&de(e,r,{get:()=>t[r],enumerable:!(u=ur(t,r))||u.enumerable});return e},lr=(e,t)=>cr(ir(de(e!=null?er(or(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),A=Dr(()=>{}),fr=ar((e,t)=>{A(),t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});A(),A(),A();var dr=e=>{var t,n,u;let r=(t=process.stdout.columns)!=null?t:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(r)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:r}:{columns:(n=e.columns)!=null?n:[],stdoutColumns:(u=e.stdoutColumns)!=null?u:r}};A(),A(),A(),A(),A();function pr({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}function Wt(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(pr(),"")}A();function Cr(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var mr=lr(fr(),1);function k(e){if(typeof e!="string"||e.length===0||(e=Wt(e),e.length===0))return 0;e=e.replace((0,mr.default)()," ");let t=0;for(let n=0;n<e.length;n++){let u=e.codePointAt(n);u<=31||u>=127&&u<=159||u>=768&&u<=879||(u>65535&&n++,t+=Cr(u)?2:1)}return t}var qt=e=>Math.max(...e.split(`
3
+ `).map(k)),hr=e=>{let t=[];for(let n of e){let{length:u}=n,r=u-t.length;for(let o=0;o<r;o+=1)t.push(0);for(let o=0;o<u;o+=1){let s=qt(n[o]);s>t[o]&&(t[o]=s)}}return t};A();var Ht=/^\d+%$/,zt={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Fr=(e,t)=>{var n;let u=[];for(let r=0;r<e.length;r+=1){let o=(n=t[r])!=null?n:"auto";if(typeof o=="number"||o==="auto"||o==="content-width"||typeof o=="string"&&Ht.test(o)){u.push(_e(pe({},zt),{width:o,contentWidth:e[r]}));continue}if(o&&typeof o=="object"){let s=_e(pe(pe({},zt),o),{contentWidth:e[r]});s.horizontalPadding=s.paddingLeft+s.paddingRight,u.push(s);continue}throw new Error(`Invalid column width: ${JSON.stringify(o)}`)}return u};function gr(e,t){for(let n of e){let{width:u}=n;if(u==="content-width"&&(n.width=n.contentWidth),u==="auto"){let D=Math.min(20,n.contentWidth);n.width=D,n.autoOverflow=n.contentWidth-D}if(typeof u=="string"&&Ht.test(u)){let D=Number.parseFloat(u.slice(0,-1))/100;n.width=Math.floor(t*D)-(n.paddingLeft+n.paddingRight)}let{horizontalPadding:r}=n,o=1,s=o+r;if(s>=t){let D=s-t,l=Math.ceil(n.paddingLeft/r*D),f=D-l;n.paddingLeft-=l,n.paddingRight-=f,n.horizontalPadding=n.paddingLeft+n.paddingRight}n.paddingLeftString=n.paddingLeft?" ".repeat(n.paddingLeft):"",n.paddingRightString=n.paddingRight?" ".repeat(n.paddingRight):"";let i=t-n.horizontalPadding;n.width=Math.max(Math.min(n.width,i),o)}}var Kt=()=>Object.assign([],{columns:0});function Er(e,t){let n=[Kt()],[u]=n;for(let r of e){let o=r.width+r.horizontalPadding;u.columns+o>t&&(u=Kt(),n.push(u)),u.push(r),u.columns+=o}for(let r of n){let o=r.reduce((c,d)=>c+d.width+d.horizontalPadding,0),s=t-o;if(s===0)continue;let i=r.filter(c=>"autoOverflow"in c),D=i.filter(c=>c.autoOverflow>0),l=D.reduce((c,d)=>c+d.autoOverflow,0),f=Math.min(l,s);for(let c of D){let d=Math.floor(c.autoOverflow/l*f);c.width+=d,s-=d}let a=Math.floor(s/i.length);for(let c=0;c<i.length;c+=1){let d=i[c];c===i.length-1?d.width+=s:d.width+=a,s-=a}}return n}function yr(e,t,n){let u=Fr(n,t);return gr(u,e),Er(u,e)}A(),A(),A();var Re=10,Vt=(e=0)=>t=>`\x1B[${t+e}m`,Yt=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Jt=(e=0)=>(t,n,u)=>`\x1B[${38+e};2;${t};${n};${u}m`;function br(){let e=new Map,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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[n,u]of Object.entries(t)){for(let[r,o]of Object.entries(u))t[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},u[r]=t[r],e.set(o[0],o[1]);Object.defineProperty(t,n,{value:u,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",t.color.ansi=Vt(),t.color.ansi256=Yt(),t.color.ansi16m=Jt(),t.bgColor.ansi=Vt(Re),t.bgColor.ansi256=Yt(Re),t.bgColor.ansi16m=Jt(Re),Object.defineProperties(t,{rgbToAnsi256:{value:(n,u,r)=>n===u&&u===r?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(u/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:n=>{let u=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(n.toString(16));if(!u)return[0,0,0];let{colorString:r}=u.groups;r.length===3&&(r=r.split("").map(s=>s+s).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:n=>t.rgbToAnsi256(...t.hexToRgb(n)),enumerable:!1},ansi256ToAnsi:{value:n=>{if(n<8)return 30+n;if(n<16)return 90+(n-8);let u,r,o;if(n>=232)u=((n-232)*10+8)/255,r=u,o=u;else{n-=16;let D=n%36;u=Math.floor(n/36)/5,r=Math.floor(D/6)/5,o=D%6/5}let s=Math.max(u,r,o)*2;if(s===0)return 30;let i=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(u));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(n,u,r)=>t.ansi256ToAnsi(t.rgbToAnsi256(n,u,r)),enumerable:!1},hexToAnsi:{value:n=>t.ansi256ToAnsi(t.hexToAnsi256(n)),enumerable:!1}}),t}var wr=br(),Br=wr,Ce=new Set(["\x1B","\x9B"]),$r=39,ke="\x07",Xt="[",vr="]",Zt="m",Me=`${vr}8;;`,Qt=e=>`${Ce.values().next().value}${Xt}${e}${Zt}`,eu=e=>`${Ce.values().next().value}${Me}${e}${ke}`,Ar=e=>e.split(" ").map(t=>k(t)),je=(e,t,n)=>{let u=[...t],r=!1,o=!1,s=k(Wt(e[e.length-1]));for(let[i,D]of u.entries()){let l=k(D);if(s+l<=n?e[e.length-1]+=D:(e.push(D),s=0),Ce.has(D)&&(r=!0,o=u.slice(i+1).join("").startsWith(Me)),r){o?D===ke&&(r=!1,o=!1):D===Zt&&(r=!1);continue}s+=l,s===n&&i<u.length-1&&(e.push(""),s=0)}!s&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},xr=e=>{let t=e.split(" "),n=t.length;for(;n>0&&!(k(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},Sr=(e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let u="",r,o,s=Ar(e),i=[""];for(let[l,f]of e.split(" ").entries()){n.trim!==!1&&(i[i.length-1]=i[i.length-1].trimStart());let a=k(i[i.length-1]);if(l!==0&&(a>=t&&(n.wordWrap===!1||n.trim===!1)&&(i.push(""),a=0),(a>0||n.trim===!1)&&(i[i.length-1]+=" ",a++)),n.hard&&s[l]>t){let c=t-a,d=1+Math.floor((s[l]-c-1)/t);Math.floor((s[l]-1)/t)<d&&i.push(""),je(i,f,t);continue}if(a+s[l]>t&&a>0&&s[l]>0){if(n.wordWrap===!1&&a<t){je(i,f,t);continue}i.push("")}if(a+s[l]>t&&n.wordWrap===!1){je(i,f,t);continue}i[i.length-1]+=f}n.trim!==!1&&(i=i.map(l=>xr(l)));let D=[...i.join(`
4
+ `)];for(let[l,f]of D.entries()){if(u+=f,Ce.has(f)){let{groups:c}=new RegExp(`(?:\\${Xt}(?<code>\\d+)m|\\${Me}(?<uri>.*)${ke})`).exec(D.slice(l).join(""))||{groups:{}};if(c.code!==void 0){let d=Number.parseFloat(c.code);r=d===$r?void 0:d}else c.uri!==void 0&&(o=c.uri.length===0?void 0:c.uri)}let a=Br.codes.get(Number(r));D[l+1]===`
5
+ `?(o&&(u+=eu("")),r&&a&&(u+=Qt(a))):f===`
6
+ `&&(r&&a&&(u+=Qt(r)),o&&(u+=eu(o)))}return u};function Or(e,t,n){return String(e).normalize().replace(/\r\n/g,`
7
7
  `).split(`
8
- `).map(n=>Vn(n,u,t)).join(`
9
- `)}var Tu=e=>Array.from({length:e}).fill("");function Yn(e,u){let t=[],n=0;for(let D of e){let r=0,i=D.map(s=>{var a;let l=(a=u[n])!=null?a:"";n+=1,s.preprocess&&(l=s.preprocess(l)),Bu(l)>s.width&&(l=Hn(l,s.width,{hard:!0}));let c=l.split(`
10
- `);if(s.postprocess){let{postprocess:f}=s;c=c.map((d,F)=>f.call(s,d,F))}return s.paddingTop&&c.unshift(...Tu(s.paddingTop)),s.paddingBottom&&c.push(...Tu(s.paddingBottom)),c.length>r&&(r=c.length),Be(ne({},s),{lines:c})}),o=[];for(let s=0;s<r;s+=1){let a=i.map(l=>{var c;let f=(c=l.lines[s])!=null?c:"",d=Number.isFinite(l.width)?" ".repeat(l.width-k(f)):"",F=l.paddingLeftString;return l.align==="right"&&(F+=d),F+=f,l.align==="left"&&(F+=d),F+l.paddingRightString}).join("");o.push(a)}t.push(o.join(`
11
- `))}return t.join(`
12
- `)}function Jn(e,u){if(!e||e.length===0)return"";let t=Rn(e),n=t.length;if(n===0)return"";let{stdoutColumns:D,columns:r}=In(u);if(r.length>n)throw new Error(`${r.length} columns defined, but only ${n} columns found`);let i=Ln(D,r,t);return e.map(o=>Yn(i,o)).join(`
13
- `)}y();var Xn=["<",">","=",">=","<="];function Zn(e){if(!Xn.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function Qn(e){let u=Object.keys(e).map(t=>{let[n,D]=t.split(" ");Zn(n);let r=Number.parseInt(D,10);if(Number.isNaN(r))throw new TypeError(`Invalid breakpoint value: ${D}`);let i=e[t];return{operator:n,breakpoint:r,value:i}}).sort((t,n)=>n.breakpoint-t.breakpoint);return t=>{var n;return(n=u.find(({operator:D,breakpoint:r})=>D==="="&&t===r||D===">"&&t>r||D==="<"&&t<r||D===">="&&t>=r||D==="<="&&t<=r))==null?void 0:n.value}}const eD=e=>e.replace(/[\W_]([a-z\d])?/gi,(u,t)=>t?t.toUpperCase():""),uD=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),tD={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:e=>e.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function nD(e){let u=!1;return{type:"table",data:{tableData:Object.keys(e).sort((t,n)=>t.localeCompare(n)).map(t=>{const n=e[t],D="alias"in n;return D&&(u=!0),{name:t,flag:n,flagFormatted:`--${uD(t)}`,aliasesEnabled:u,aliasFormatted:D?`-${n.alias}`:void 0}}).map(t=>(t.aliasesEnabled=u,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:tD}}}const Pu=e=>!e||(e.version??(e.help?e.help.version:void 0)),ku=e=>{const u="parent"in e&&e.parent?.name;return(u?`${u} `:"")+e.name};function DD(e){const u=[];e.name&&u.push(ku(e));const t=Pu(e)??("parent"in e&&Pu(e.parent));if(t&&u.push(`v${t}`),u.length!==0)return{id:"name",type:"text",data:`${u.join(" ")}
14
- `}}function rD(e){const{help:u}=e;if(!(!u||!u.description))return{id:"description",type:"text",data:`${u.description}
15
- `}}function iD(e){const u=e.help||{};if("usage"in u)return u.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(u.usage)?u.usage.join(`
16
- `):u.usage}}:void 0;if(e.name){const t=[],n=[ku(e)];if(e.flags&&Object.keys(e.flags).length>0&&n.push("[flags...]"),e.parameters&&e.parameters.length>0){const{parameters:D}=e,r=D.indexOf("--"),i=r>-1&&D.slice(r+1).some(o=>o.startsWith("<"));n.push(D.map(o=>o!=="--"?o:i?"--":"[--]").join(" "))}if(n.length>1&&t.push(n.join(" ")),"commands"in e&&e.commands?.length&&t.push(`${e.name} <command>`),t.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:t.join(`
17
- `)}}}}function oD(e){return!("commands"in e)||!e.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:e.commands.map(u=>[u.options.name,u.options.help?u.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function sD(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:nD(e.flags),indentBody:0}}}function aD(e){const{help:u}=e;if(!u||!u.examples||u.examples.length===0)return;let{examples:t}=u;if(Array.isArray(t)&&(t=t.join(`
18
- `)),t)return{id:"examples",type:"section",data:{title:"Examples:",body:t}}}function cD(e){if(!("alias"in e)||!e.alias)return;const{alias:u}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(u)?u.join(", "):u}}}const lD=e=>[DD,rD,iD,oD,sD,aD,cD].map(u=>u(e)).filter(Boolean),fD=cu.WriteStream.prototype.hasColors();class dD{text(u){return u}bold(u){return fD?`\x1B[1m${u}\x1B[22m`:u.toLocaleUpperCase()}indentText({text:u,spaces:t}){return u.replace(/^/gm," ".repeat(t))}heading(u){return this.bold(u)}section({title:u,body:t,indentBody:n=2}){return`${(u?`${this.heading(u)}
19
- `:"")+(t?this.indentText({text:this.render(t),spaces:n}):"")}
20
- `}table({tableData:u,tableOptions:t,tableBreakpoints:n}){return Jn(u.map(D=>D.map(r=>this.render(r))),n?Qn(n):t)}flagParameter(u){return u===Boolean?"":u===String?"<string>":u===Number?"<number>":Array.isArray(u)?this.flagParameter(u[0]):"<value>"}flagOperator(u){return" "}flagName(u){const{flag:t,flagFormatted:n,aliasesEnabled:D,aliasFormatted:r}=u;let i="";if(r?i+=`${r}, `:D&&(i+=" "),i+=n,"placeholder"in t&&typeof t.placeholder=="string")i+=`${this.flagOperator(u)}${t.placeholder}`;else{const o=this.flagParameter("type"in t?t.type:t);o&&(i+=`${this.flagOperator(u)}${o}`)}return i}flagDefault(u){return JSON.stringify(u)}flagDescription({flag:u}){let t="description"in u?u.description??"":"";if("default"in u){let{default:n}=u;typeof n=="function"&&(n=n()),n&&(t+=` (default: ${this.flagDefault(n)})`)}return t}render(u){if(typeof u=="string")return u;if(Array.isArray(u))return u.map(t=>this.render(t)).join(`
21
- `);if("type"in u&&this[u.type]){const t=this[u.type];if(typeof t=="function")return t.call(this,u.data)}throw new Error(`Invalid node type: ${JSON.stringify(u)}`)}}const Ae=/^[\w.-]+$/,{stringify:x}=JSON,pD=/[|\\{}()[\]^$+*?.]/;function ve(e){const u=[];let t,n;for(const D of e){if(n)throw new Error(`Invalid parameter: Spread parameter ${x(n)} must be last`);const r=D[0],i=D[D.length-1];let o;if(r==="<"&&i===">"&&(o=!0,t))throw new Error(`Invalid parameter: Required parameter ${x(D)} cannot come after optional parameter ${x(t)}`);if(r==="["&&i==="]"&&(o=!1,t=D),o===void 0)throw new Error(`Invalid parameter: ${x(D)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let s=D.slice(1,-1);const a=s.slice(-3)==="...";a&&(n=D,s=s.slice(0,-3));const l=s.match(pD);if(l)throw new Error(`Invalid parameter: ${x(D)}. Invalid character found ${x(l[0])}`);u.push({name:s,required:o,spread:a})}return u}function xe(e,u,t,n){for(let D=0;D<u.length;D+=1){const{name:r,required:i,spread:o}=u[D],s=eD(r);if(s in e)throw new Error(`Invalid parameter: ${x(r)} is used more than once.`);const a=o?t.slice(D):t[D];if(o&&(D=u.length),i&&(!a||o&&a.length===0))return console.error(`Error: Missing required parameter ${x(r)}
22
- `),n(),process.exit(1);e[s]=a}}function FD(e){return e===void 0||e!==!1}function Ru(e,u,t,n){const D={...u.flags},r=u.version;r&&(D.version={type:Boolean,description:"Show version"});const{help:i}=u,o=FD(i);o&&!("help"in D)&&(D.help={type:Boolean,alias:"h",description:"Show help"});const s=Cn(D,n,{ignore:u.ignoreArgv}),a=()=>{console.log(u.version)};if(r&&s.flags.version===!0)return a(),process.exit(0);const l=new dD,c=o&&i?.render?i.render:F=>l.render(F),f=F=>{const E=lD({...u,...F?{help:F}:{},flags:D});console.log(c(E,l))};if(o&&s.flags.help===!0)return f(),process.exit(0);if(u.parameters){let{parameters:F}=u,E=s._;const b=F.indexOf("--"),P=F.slice(b+1),S=Object.create(null);if(b>-1&&P.length>0){F=F.slice(0,b);const Q=s._["--"];E=E.slice(0,-Q.length||void 0),xe(S,ve(F),E,f),xe(S,ve(P),Q,f)}else xe(S,ve(F),E,f);Object.assign(s._,S)}const d={...s,showVersion:a,showHelp:f};return typeof t=="function"&&t(d),{command:e,...d}}function mD(e,u){const t=new Map;for(const n of u){const D=[n.options.name],{alias:r}=n.options;r&&(Array.isArray(r)?D.push(...r):D.push(r));for(const i of D){if(t.has(i))throw new Error(`Duplicate command name found: ${x(i)}`);t.set(i,n)}}return t.get(e)}function CD(e,u,t=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Ae.test(e.name)))throw new Error(`Invalid script name: ${x(e.name)}`);const n=t[0];if(e.commands&&Ae.test(n)){const D=mD(n,e.commands);if(D)return Ru(D.options.name,{...D.options,parent:e},D.callback,t.slice(1))}return Ru(void 0,e,u,t)}function _u(e,u){if(!e)throw new Error("Command options are required");const{name:t}=e;if(e.name===void 0)throw new Error("Command name is required");if(!Ae.test(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:e,callback:u}}var ju="1.5.0",hD="Writes your git commit messages for you with AI",I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},R={},ED={get exports(){return R},set exports(e){R=e}},Se,Nu;function gD(){if(Nu)return Se;Nu=1,Se=n,n.sync=D;var e=Ee;function u(r,i){var o=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!o||(o=o.split(";"),o.indexOf("")!==-1))return!0;for(var s=0;s<o.length;s++){var a=o[s].toLowerCase();if(a&&r.substr(-a.length).toLowerCase()===a)return!0}return!1}function t(r,i,o){return!r.isSymbolicLink()&&!r.isFile()?!1:u(i,o)}function n(r,i,o){e.stat(r,function(s,a){o(s,s?!1:t(a,r,i))})}function D(r,i){return t(e.statSync(r),r,i)}return Se}var Oe,Lu;function BD(){if(Lu)return Oe;Lu=1,Oe=u,u.sync=t;var e=Ee;function u(r,i,o){e.stat(r,function(s,a){o(s,s?!1:n(a,i))})}function t(r,i){return n(e.statSync(r),i)}function n(r,i){return r.isFile()&&D(r,i)}function D(r,i){var o=r.mode,s=r.uid,a=r.gid,l=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),c=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),f=parseInt("100",8),d=parseInt("010",8),F=parseInt("001",8),E=f|d,b=o&F||o&d&&a===c||o&f&&s===l||o&E&&l===0;return b}return Oe}var re;process.platform==="win32"||I.TESTING_WINDOWS?re=gD():re=BD();var wD=Ie;Ie.sync=bD;function Ie(e,u,t){if(typeof u=="function"&&(t=u,u={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,D){Ie(e,u||{},function(r,i){r?D(r):n(i)})})}re(e,u||{},function(n,D){n&&(n.code==="EACCES"||u&&u.ignoreErrors)&&(n=null,D=!1),t(n,D)})}function bD(e,u){try{return re.sync(e,u||{})}catch(t){if(u&&u.ignoreErrors||t.code==="EACCES")return!1;throw t}}const M=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Mu=V,yD=M?";":":",Gu=wD,Uu=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Wu=(e,u)=>{const t=u.colon||yD,n=e.match(/\//)||M&&e.match(/\\/)?[""]:[...M?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(t)],D=M?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",r=M?D.split(t):[""];return M&&e.indexOf(".")!==-1&&r[0]!==""&&r.unshift(""),{pathEnv:n,pathExt:r,pathExtExe:D}},Ku=(e,u,t)=>{typeof u=="function"&&(t=u,u={}),u||(u={});const{pathEnv:n,pathExt:D,pathExtExe:r}=Wu(e,u),i=[],o=a=>new Promise((l,c)=>{if(a===n.length)return u.all&&i.length?l(i):c(Uu(e));const f=n[a],d=/^".*"$/.test(f)?f.slice(1,-1):f,F=Mu.join(d,e),E=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+F:F;l(s(E,a,0))}),s=(a,l,c)=>new Promise((f,d)=>{if(c===D.length)return f(o(l+1));const F=D[c];Gu(a+F,{pathExt:r},(E,b)=>{if(!E&&b)if(u.all)i.push(a+F);else return f(a+F);return f(s(a,l,c+1))})});return t?o(0).then(a=>t(null,a),t):o(0)},$D=(e,u)=>{u=u||{};const{pathEnv:t,pathExt:n,pathExtExe:D}=Wu(e,u),r=[];for(let i=0;i<t.length;i++){const o=t[i],s=/^".*"$/.test(o)?o.slice(1,-1):o,a=Mu.join(s,e),l=!s&&/^\.[\\\/]/.test(e)?e.slice(0,2)+a:a;for(let c=0;c<n.length;c++){const f=l+n[c];try{if(Gu.sync(f,{pathExt:D}))if(u.all)r.push(f);else return f}catch{}}}if(u.all&&r.length)return r;if(u.nothrow)return null;throw Uu(e)};var AD=Ku;Ku.sync=$D;var ie={},vD={get exports(){return ie},set exports(e){ie=e}};const qu=(e={})=>{const u=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(u).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};vD.exports=qu,ie.default=qu;const zu=V,xD=AD,SD=ie;function Vu(e,u){const t=e.options.env||process.env,n=process.cwd(),D=e.options.cwd!=null,r=D&&process.chdir!==void 0&&!process.chdir.disabled;if(r)try{process.chdir(e.options.cwd)}catch{}let i;try{i=xD.sync(e.command,{path:t[SD({env:t})],pathExt:u?zu.delimiter:void 0})}catch{}finally{r&&process.chdir(n)}return i&&(i=zu.resolve(D?e.options.cwd:"",i)),i}function OD(e){return Vu(e)||Vu(e,!0)}var ID=OD,Te={};const Pe=/([()\][%!^"`<>&|;, *?])/g;function TD(e){return e=e.replace(Pe,"^$1"),e}function PD(e,u){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Pe,"^$1"),u&&(e=e.replace(Pe,"^$1")),e}Te.command=TD,Te.argument=PD;var kD=/^#!(.*)/;const RD=kD;var _D=(e="")=>{const u=e.match(RD);if(!u)return null;const[t,n]=u[0].replace(/#! ?/,"").split(" "),D=t.split("/").pop();return D==="env"?n:n?`${D} ${n}`:D};const ke=Ee,jD=_D;function ND(e){const t=Buffer.alloc(150);let n;try{n=ke.openSync(e,"r"),ke.readSync(n,t,0,150,0),ke.closeSync(n)}catch{}return jD(t.toString())}var LD=ND;const MD=V,Hu=ID,Yu=Te,GD=LD,UD=process.platform==="win32",WD=/\.(?:com|exe)$/i,KD=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qD(e){e.file=Hu(e);const u=e.file&&GD(e.file);return u?(e.args.unshift(e.file),e.command=u,Hu(e)):e.file}function zD(e){if(!UD)return e;const u=qD(e),t=!WD.test(u);if(e.options.forceShell||t){const n=KD.test(u);e.command=MD.normalize(e.command),e.command=Yu.command(e.command),e.args=e.args.map(r=>Yu.argument(r,n));const D=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${D}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function VD(e,u,t){u&&!Array.isArray(u)&&(t=u,u=null),u=u?u.slice(0):[],t=Object.assign({},t);const n={command:e,args:u,options:t,file:void 0,original:{command:e,args:u}};return t.shell?n:zD(n)}var HD=VD;const Re=process.platform==="win32";function _e(e,u){return Object.assign(new Error(`${u} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${u} ${e.command}`,path:e.command,spawnargs:e.args})}function YD(e,u){if(!Re)return;const t=e.emit;e.emit=function(n,D){if(n==="exit"){const r=Ju(D,u);if(r)return t.call(e,"error",r)}return t.apply(e,arguments)}}function Ju(e,u){return Re&&e===1&&!u.file?_e(u.original,"spawn"):null}function JD(e,u){return Re&&e===1&&!u.file?_e(u.original,"spawnSync"):null}var XD={hookChildProcess:YD,verifyENOENT:Ju,verifyENOENTSync:JD,notFoundError:_e};const Xu=Mt,je=HD,Ne=XD;function Zu(e,u,t){const n=je(e,u,t),D=Xu.spawn(n.command,n.args,n.options);return Ne.hookChildProcess(D,n),D}function ZD(e,u,t){const n=je(e,u,t),D=Xu.spawnSync(n.command,n.args,n.options);return D.error=D.error||Ne.verifyENOENTSync(D.status,n),D}ED.exports=Zu,R.spawn=Zu,R.sync=ZD,R._parse=je,R._enoent=Ne;function QD(e){const u=typeof e=="string"?`
8
+ `).map(u=>Sr(u,t,n)).join(`
9
+ `)}var tu=e=>Array.from({length:e}).fill("");function Ir(e,t){let n=[],u=0;for(let r of e){let o=0,s=r.map(D=>{var l;let f=(l=t[u])!=null?l:"";u+=1,D.preprocess&&(f=D.preprocess(f)),qt(f)>D.width&&(f=Or(f,D.width,{hard:!0}));let a=f.split(`
10
+ `);if(D.postprocess){let{postprocess:c}=D;a=a.map((d,p)=>c.call(D,d,p))}return D.paddingTop&&a.unshift(...tu(D.paddingTop)),D.paddingBottom&&a.push(...tu(D.paddingBottom)),a.length>o&&(o=a.length),_e(pe({},D),{lines:a})}),i=[];for(let D=0;D<o;D+=1){let l=s.map(f=>{var a;let c=(a=f.lines[D])!=null?a:"",d=Number.isFinite(f.width)?" ".repeat(f.width-k(c)):"",p=f.paddingLeftString;return f.align==="right"&&(p+=d),p+=c,f.align==="left"&&(p+=d),p+f.paddingRightString}).join("");i.push(l)}n.push(i.join(`
11
+ `))}return n.join(`
12
+ `)}function Tr(e,t){if(!e||e.length===0)return"";let n=hr(e),u=n.length;if(u===0)return"";let{stdoutColumns:r,columns:o}=dr(t);if(o.length>u)throw new Error(`${o.length} columns defined, but only ${u} columns found`);let s=yr(r,o,n);return e.map(i=>Ir(s,i)).join(`
13
+ `)}A();var Pr=["<",">","=",">=","<="];function _r(e){if(!Pr.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function Rr(e){let t=Object.keys(e).map(n=>{let[u,r]=n.split(" ");_r(u);let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new TypeError(`Invalid breakpoint value: ${r}`);let s=e[n];return{operator:u,breakpoint:o,value:s}}).sort((n,u)=>u.breakpoint-n.breakpoint);return n=>{var u;return(u=t.find(({operator:r,breakpoint:o})=>r==="="&&n===o||r===">"&&n>o||r==="<"&&n<o||r===">="&&n>=o||r==="<="&&n<=o))==null?void 0:u.value}}const kr=e=>e.replace(/[\W_]([a-z\d])?/gi,(t,n)=>n?n.toUpperCase():""),Mr=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),jr={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:e=>e.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function Lr(e){let t=!1;return{type:"table",data:{tableData:Object.keys(e).sort((n,u)=>n.localeCompare(u)).map(n=>{const u=e[n],r="alias"in u;return r&&(t=!0),{name:n,flag:u,flagFormatted:`--${Mr(n)}`,aliasesEnabled:t,aliasFormatted:r?`-${u.alias}`:void 0}}).map(n=>(n.aliasesEnabled=t,[{type:"flagName",data:n},{type:"flagDescription",data:n}])),tableBreakpoints:jr}}}const uu=e=>!e||(e.version??(e.help?e.help.version:void 0)),nu=e=>{const t="parent"in e&&e.parent?.name;return(t?`${t} `:"")+e.name};function Nr(e){const t=[];e.name&&t.push(nu(e));const n=uu(e)??("parent"in e&&uu(e.parent));if(n&&t.push(`v${n}`),t.length!==0)return{id:"name",type:"text",data:`${t.join(" ")}
14
+ `}}function Gr(e){const{help:t}=e;if(!(!t||!t.description))return{id:"description",type:"text",data:`${t.description}
15
+ `}}function Ur(e){const t=e.help||{};if("usage"in t)return t.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(t.usage)?t.usage.join(`
16
+ `):t.usage}}:void 0;if(e.name){const n=[],u=[nu(e)];if(e.flags&&Object.keys(e.flags).length>0&&u.push("[flags...]"),e.parameters&&e.parameters.length>0){const{parameters:r}=e,o=r.indexOf("--"),s=o>-1&&r.slice(o+1).some(i=>i.startsWith("<"));u.push(r.map(i=>i!=="--"?i:s?"--":"[--]").join(" "))}if(u.length>1&&n.push(u.join(" ")),"commands"in e&&e.commands?.length&&n.push(`${e.name} <command>`),n.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:n.join(`
17
+ `)}}}}function Wr(e){return!("commands"in e)||!e.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:e.commands.map(t=>[t.options.name,t.options.help?t.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function qr(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:Lr(e.flags),indentBody:0}}}function Hr(e){const{help:t}=e;if(!t||!t.examples||t.examples.length===0)return;let{examples:n}=t;if(Array.isArray(n)&&(n=n.join(`
18
+ `)),n)return{id:"examples",type:"section",data:{title:"Examples:",body:n}}}function zr(e){if(!("alias"in e)||!e.alias)return;const{alias:t}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(t)?t.join(", "):t}}}const Kr=e=>[Nr,Gr,Ur,Wr,qr,Hr,zr].map(t=>t(e)).filter(Boolean),Vr=ce.WriteStream.prototype.hasColors();class Yr{text(t){return t}bold(t){return Vr?`\x1B[1m${t}\x1B[22m`:t.toLocaleUpperCase()}indentText({text:t,spaces:n}){return t.replace(/^/gm," ".repeat(n))}heading(t){return this.bold(t)}section({title:t,body:n,indentBody:u=2}){return`${(t?`${this.heading(t)}
19
+ `:"")+(n?this.indentText({text:this.render(n),spaces:u}):"")}
20
+ `}table({tableData:t,tableOptions:n,tableBreakpoints:u}){return Tr(t.map(r=>r.map(o=>this.render(o))),u?Rr(u):n)}flagParameter(t){return t===Boolean?"":t===String?"<string>":t===Number?"<number>":Array.isArray(t)?this.flagParameter(t[0]):"<value>"}flagOperator(t){return" "}flagName(t){const{flag:n,flagFormatted:u,aliasesEnabled:r,aliasFormatted:o}=t;let s="";if(o?s+=`${o}, `:r&&(s+=" "),s+=u,"placeholder"in n&&typeof n.placeholder=="string")s+=`${this.flagOperator(t)}${n.placeholder}`;else{const i=this.flagParameter("type"in n?n.type:n);i&&(s+=`${this.flagOperator(t)}${i}`)}return s}flagDefault(t){return JSON.stringify(t)}flagDescription({flag:t}){let n="description"in t?t.description??"":"";if("default"in t){let{default:u}=t;typeof u=="function"&&(u=u()),u&&(n+=` (default: ${this.flagDefault(u)})`)}return n}render(t){if(typeof t=="string")return t;if(Array.isArray(t))return t.map(n=>this.render(n)).join(`
21
+ `);if("type"in t&&this[t.type]){const n=this[t.type];if(typeof n=="function")return n.call(this,t.data)}throw new Error(`Invalid node type: ${JSON.stringify(t)}`)}}const Le=/^[\w.-]+$/,{stringify:I}=JSON,Jr=/[|\\{}()[\]^$+*?.]/;function Ne(e){const t=[];let n,u;for(const r of e){if(u)throw new Error(`Invalid parameter: Spread parameter ${I(u)} must be last`);const o=r[0],s=r[r.length-1];let i;if(o==="<"&&s===">"&&(i=!0,n))throw new Error(`Invalid parameter: Required parameter ${I(r)} cannot come after optional parameter ${I(n)}`);if(o==="["&&s==="]"&&(i=!1,n=r),i===void 0)throw new Error(`Invalid parameter: ${I(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let D=r.slice(1,-1);const l=D.slice(-3)==="...";l&&(u=r,D=D.slice(0,-3));const f=D.match(Jr);if(f)throw new Error(`Invalid parameter: ${I(r)}. Invalid character found ${I(f[0])}`);t.push({name:D,required:i,spread:l})}return t}function Ge(e,t,n,u){for(let r=0;r<t.length;r+=1){const{name:o,required:s,spread:i}=t[r],D=kr(o);if(D in e)throw new Error(`Invalid parameter: ${I(o)} is used more than once.`);const l=i?n.slice(r):n[r];if(i&&(r=t.length),s&&(!l||i&&l.length===0))return console.error(`Error: Missing required parameter ${I(o)}
22
+ `),u(),process.exit(1);e[D]=l}}function Xr(e){return e===void 0||e!==!1}function ru(e,t,n,u){const r={...t.flags},o=t.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:s}=t,i=Xr(s);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const D=Qn(r,u,{ignore:t.ignoreArgv}),l=()=>{console.log(t.version)};if(o&&D.flags.version===!0)return l(),process.exit(0);const f=new Yr,a=i&&s?.render?s.render:p=>f.render(p),c=p=>{const m=Kr({...t,...p?{help:p}:{},flags:r});console.log(a(m,f))};if(i&&D.flags.help===!0)return c(),process.exit(0);if(t.parameters){let{parameters:p}=t,m=D._;const h=p.indexOf("--"),F=p.slice(h+1),B=Object.create(null);if(h>-1&&F.length>0){p=p.slice(0,h);const T=D._["--"];m=m.slice(0,-T.length||void 0),Ge(B,Ne(p),m,c),Ge(B,Ne(F),T,c)}else Ge(B,Ne(p),m,c);Object.assign(D._,B)}const d={...D,showVersion:l,showHelp:c};return typeof n=="function"&&n(d),{command:e,...d}}function Zr(e,t){const n=new Map;for(const u of t){const r=[u.options.name],{alias:o}=u.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const s of r){if(n.has(s))throw new Error(`Duplicate command name found: ${I(s)}`);n.set(s,u)}}return n.get(e)}function Qr(e,t,n=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Le.test(e.name)))throw new Error(`Invalid script name: ${I(e.name)}`);const u=n[0];if(e.commands&&Le.test(u)){const r=Zr(u,e.commands);if(r)return ru(r.options.name,{...r.options,parent:e},r.callback,n.slice(1))}return ru(void 0,e,t,n)}function ou(e,t){if(!e)throw new Error("Command options are required");const{name:n}=e;if(e.name===void 0)throw new Error("Command name is required");if(!Le.test(n))throw new Error(`Invalid command name ${JSON.stringify(n)}. Command names must be one word.`);return{options:e,callback:t}}var su="1.6.0",eo="Writes your git commit messages for you with AI",w=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},M={},to={get exports(){return M},set exports(e){M=e}},Ue,iu;function uo(){if(iu)return Ue;iu=1,Ue=u,u.sync=r;var e=Te;function t(o,s){var i=s.pathExt!==void 0?s.pathExt:process.env.PATHEXT;if(!i||(i=i.split(";"),i.indexOf("")!==-1))return!0;for(var D=0;D<i.length;D++){var l=i[D].toLowerCase();if(l&&o.substr(-l.length).toLowerCase()===l)return!0}return!1}function n(o,s,i){return!o.isSymbolicLink()&&!o.isFile()?!1:t(s,i)}function u(o,s,i){e.stat(o,function(D,l){i(D,D?!1:n(l,o,s))})}function r(o,s){return n(e.statSync(o),o,s)}return Ue}var We,Du;function no(){if(Du)return We;Du=1,We=t,t.sync=n;var e=Te;function t(o,s,i){e.stat(o,function(D,l){i(D,D?!1:u(l,s))})}function n(o,s){return u(e.statSync(o),s)}function u(o,s){return o.isFile()&&r(o,s)}function r(o,s){var i=o.mode,D=o.uid,l=o.gid,f=s.uid!==void 0?s.uid:process.getuid&&process.getuid(),a=s.gid!==void 0?s.gid:process.getgid&&process.getgid(),c=parseInt("100",8),d=parseInt("010",8),p=parseInt("001",8),m=c|d,h=i&p||i&d&&l===a||i&c&&D===f||i&m&&f===0;return h}return We}var me;process.platform==="win32"||w.TESTING_WINDOWS?me=uo():me=no();var ro=qe;qe.sync=oo;function qe(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(u,r){qe(e,t||{},function(o,s){o?r(o):u(s)})})}me(e,t||{},function(u,r){u&&(u.code==="EACCES"||t&&t.ignoreErrors)&&(u=null,r=!1),n(u,r)})}function oo(e,t){try{return me.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const q=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",au=X,so=q?";":":",cu=ro,lu=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),fu=(e,t)=>{const n=t.colon||so,u=e.match(/\//)||q&&e.match(/\\/)?[""]:[...q?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],r=q?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=q?r.split(n):[""];return q&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:u,pathExt:o,pathExtExe:r}},du=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:u,pathExt:r,pathExtExe:o}=fu(e,t),s=[],i=l=>new Promise((f,a)=>{if(l===u.length)return t.all&&s.length?f(s):a(lu(e));const c=u[l],d=/^".*"$/.test(c)?c.slice(1,-1):c,p=au.join(d,e),m=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;f(D(m,l,0))}),D=(l,f,a)=>new Promise((c,d)=>{if(a===r.length)return c(i(f+1));const p=r[a];cu(l+p,{pathExt:o},(m,h)=>{if(!m&&h)if(t.all)s.push(l+p);else return c(l+p);return c(D(l,f,a+1))})});return n?i(0).then(l=>n(null,l),n):i(0)},io=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:u,pathExtExe:r}=fu(e,t),o=[];for(let s=0;s<n.length;s++){const i=n[s],D=/^".*"$/.test(i)?i.slice(1,-1):i,l=au.join(D,e),f=!D&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let a=0;a<u.length;a++){const c=f+u[a];try{if(cu.sync(c,{pathExt:r}))if(t.all)o.push(c);else return c}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw lu(e)};var Do=du;du.sync=io;var he={},ao={get exports(){return he},set exports(e){he=e}};const pu=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(u=>u.toUpperCase()==="PATH")||"Path"};ao.exports=pu,he.default=pu;const Cu=X,co=Do,lo=he;function mu(e,t){const n=e.options.env||process.env,u=process.cwd(),r=e.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let s;try{s=co.sync(e.command,{path:n[lo({env:n})],pathExt:t?Cu.delimiter:void 0})}catch{}finally{o&&process.chdir(u)}return s&&(s=Cu.resolve(r?e.options.cwd:"",s)),s}function fo(e){return mu(e)||mu(e,!0)}var po=fo,He={};const ze=/([()\][%!^"`<>&|;, *?])/g;function Co(e){return e=e.replace(ze,"^$1"),e}function mo(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(ze,"^$1"),t&&(e=e.replace(ze,"^$1")),e}He.command=Co,He.argument=mo;var ho=/^#!(.*)/;const Fo=ho;var go=(e="")=>{const t=e.match(Fo);if(!t)return null;const[n,u]=t[0].replace(/#! ?/,"").split(" "),r=n.split("/").pop();return r==="env"?u:u?`${r} ${u}`:r};const Ke=Te,Eo=go;function yo(e){const n=Buffer.alloc(150);let u;try{u=Ke.openSync(e,"r"),Ke.readSync(u,n,0,150,0),Ke.closeSync(u)}catch{}return Eo(n.toString())}var bo=yo;const wo=X,hu=po,Fu=He,Bo=bo,$o=process.platform==="win32",vo=/\.(?:com|exe)$/i,Ao=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function xo(e){e.file=hu(e);const t=e.file&&Bo(e.file);return t?(e.args.unshift(e.file),e.command=t,hu(e)):e.file}function So(e){if(!$o)return e;const t=xo(e),n=!vo.test(t);if(e.options.forceShell||n){const u=Ao.test(t);e.command=wo.normalize(e.command),e.command=Fu.command(e.command),e.args=e.args.map(o=>Fu.argument(o,u));const r=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${r}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Oo(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const u={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?u:So(u)}var Io=Oo;const Ve=process.platform==="win32";function Ye(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function To(e,t){if(!Ve)return;const n=e.emit;e.emit=function(u,r){if(u==="exit"){const o=gu(r,t);if(o)return n.call(e,"error",o)}return n.apply(e,arguments)}}function gu(e,t){return Ve&&e===1&&!t.file?Ye(t.original,"spawn"):null}function Po(e,t){return Ve&&e===1&&!t.file?Ye(t.original,"spawnSync"):null}var _o={hookChildProcess:To,verifyENOENT:gu,verifyENOENTSync:Po,notFoundError:Ye};const Eu=Bn,Je=Io,Xe=_o;function yu(e,t,n){const u=Je(e,t,n),r=Eu.spawn(u.command,u.args,u.options);return Xe.hookChildProcess(r,u),r}function Ro(e,t,n){const u=Je(e,t,n),r=Eu.spawnSync(u.command,u.args,u.options);return r.error=r.error||Xe.verifyENOENTSync(r.status,u),r}to.exports=yu,M.spawn=yu,M.sync=Ro,M._parse=Je,M._enoent=Xe;function ko(e){const t=typeof e=="string"?`
23
23
  `:`
24
- `.charCodeAt(),t=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===u&&(e=e.slice(0,-1)),e[e.length-1]===t&&(e=e.slice(0,-1)),e}function Qu(e={}){const{env:u=process.env,platform:t=process.platform}=e;return t!=="win32"?"PATH":Object.keys(u).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}function er(e={}){const{cwd:u=g.cwd(),path:t=g.env[Qu()],execPath:n=g.execPath}=e;let D;const r=u instanceof URL?Gt.fileURLToPath(u):u;let i=L.resolve(r);const o=[];for(;D!==i;)o.push(L.join(i,"node_modules/.bin")),D=i,i=L.resolve(i,"..");return o.push(L.resolve(r,n,"..")),[...o,t].join(L.delimiter)}function ur({env:e=g.env,...u}={}){e={...e};const t=Qu({env:e});return u.path=e[t],e[t]=er(u),e}const tr=(e,u,t,n)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const D=Object.getOwnPropertyDescriptor(e,t),r=Object.getOwnPropertyDescriptor(u,t);!nr(D,r)&&n||Object.defineProperty(e,t,r)},nr=function(e,u){return e===void 0||e.configurable||e.writable===u.writable&&e.enumerable===u.enumerable&&e.configurable===u.configurable&&(e.writable||e.value===u.value)},Dr=(e,u)=>{const t=Object.getPrototypeOf(u);t!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,t)},rr=(e,u)=>`/* Wrapped ${e}*/
25
- ${u}`,ir=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),or=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),sr=(e,u,t)=>{const n=t===""?"":`with ${t.trim()}() `,D=rr.bind(null,n,u.toString());Object.defineProperty(D,"name",or),Object.defineProperty(e,"toString",{...ir,value:D})};function ar(e,u,{ignoreNonConfigurable:t=!1}={}){const{name:n}=e;for(const D of Reflect.ownKeys(u))tr(e,u,D,t);return Dr(e,u),sr(e,u,n),e}const oe=new WeakMap,et=(e,u={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let t,n=0;const D=e.displayName||e.name||"<anonymous>",r=function(...i){if(oe.set(r,++n),n===1)t=e.apply(this,i),e=null;else if(u.throw===!0)throw new Error(`Function \`${D}\` can only be called once`);return t};return ar(r,e),oe.set(r,n),r};et.callCount=e=>{if(!oe.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return oe.get(e)};const cr=function(){const e=tt-ut+1;return Array.from({length:e},lr)},lr=function(e,u){return{name:`SIGRT${u+1}`,number:ut+u,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},ut=34,tt=64,fr=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],nt=function(){const e=cr();return[...fr,...e].map(dr)},dr=function({name:e,number:u,description:t,action:n,forced:D=!1,standard:r}){const{signals:{[e]:i}}=pu,o=i!==void 0;return{name:e,number:o?i:u,description:t,supported:o,action:n,forced:D,standard:r}},pr=function(){const e=nt();return Object.fromEntries(e.map(Fr))},Fr=function({name:e,number:u,description:t,supported:n,action:D,forced:r,standard:i}){return[e,{name:e,number:u,description:t,supported:n,action:D,forced:r,standard:i}]},mr=pr(),Cr=function(){const e=nt(),u=tt+1,t=Array.from({length:u},(n,D)=>hr(D,e));return Object.assign({},...t)},hr=function(e,u){const t=Er(e,u);if(t===void 0)return{};const{name:n,description:D,supported:r,action:i,forced:o,standard:s}=t;return{[e]:{name:n,number:e,description:D,supported:r,action:i,forced:o,standard:s}}},Er=function(e,u){const t=u.find(({name:n})=>pu.signals[n]===e);return t!==void 0?t:u.find(n=>n.number===e)};Cr();const gr=({timedOut:e,timeout:u,errorCode:t,signal:n,signalDescription:D,exitCode:r,isCanceled:i})=>e?`timed out after ${u} milliseconds`:i?"was canceled":t!==void 0?`failed with ${t}`:n!==void 0?`was killed with ${n} (${D})`:r!==void 0?`failed with exit code ${r}`:"failed",Dt=({stdout:e,stderr:u,all:t,error:n,signal:D,exitCode:r,command:i,escapedCommand:o,timedOut:s,isCanceled:a,killed:l,parsed:{options:{timeout:c}}})=>{r=r===null?void 0:r,D=D===null?void 0:D;const f=D===void 0?void 0:mr[D].description,d=n&&n.code,E=`Command ${gr({timedOut:s,timeout:c,errorCode:d,signal:D,signalDescription:f,exitCode:r,isCanceled:a})}: ${i}`,b=Object.prototype.toString.call(n)==="[object Error]",P=b?`${E}
26
- ${n.message}`:E,S=[P,u,e].filter(Boolean).join(`
27
- `);return b?(n.originalMessage=n.message,n.message=S):n=new Error(S),n.shortMessage=P,n.command=i,n.escapedCommand=o,n.exitCode=r,n.signal=D,n.signalDescription=f,n.stdout=e,n.stderr=u,t!==void 0&&(n.all=t),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=Boolean(s),n.isCanceled=a,n.killed=l&&!s,n},se=["stdin","stdout","stderr"],Br=e=>se.some(u=>e[u]!==void 0),wr=e=>{if(!e)return;const{stdio:u}=e;if(u===void 0)return se.map(n=>e[n]);if(Br(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${se.map(n=>`\`${n}\``).join(", ")}`);if(typeof u=="string")return u;if(!Array.isArray(u))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof u}\``);const t=Math.max(u.length,se.length);return Array.from({length:t},(n,D)=>u[D])};var G={},rt={get exports(){return G},set exports(e){G=e}},ae={},br={get exports(){return ae},set exports(e){ae=e}},it;function yr(){return it||(it=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(br)),ae}var m=I.process;const _=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!_(m))rt.exports=function(){return function(){}};else{var $r=Wt,J=yr(),Ar=/^win/i.test(m.platform),ce=Kt;typeof ce!="function"&&(ce=ce.EventEmitter);var B;m.__signal_exit_emitter__?B=m.__signal_exit_emitter__:(B=m.__signal_exit_emitter__=new ce,B.count=0,B.emitted={}),B.infinite||(B.setMaxListeners(1/0),B.infinite=!0),rt.exports=function(e,u){if(!_(I.process))return function(){};$r.equal(typeof e,"function","a callback must be provided for exit handler"),X===!1&&ot();var t="exit";u&&u.alwaysLast&&(t="afterexit");var n=function(){B.removeListener(t,e),B.listeners("exit").length===0&&B.listeners("afterexit").length===0&&Le()};return B.on(t,e),n};var Le=function(){!X||!_(I.process)||(X=!1,J.forEach(function(u){try{m.removeListener(u,Me[u])}catch{}}),m.emit=Ge,m.reallyExit=st,B.count-=1)};G.unload=Le;var U=function(u,t,n){B.emitted[u]||(B.emitted[u]=!0,B.emit(u,t,n))},Me={};J.forEach(function(e){Me[e]=function(){if(_(I.process)){var t=m.listeners(e);t.length===B.count&&(Le(),U("exit",null,e),U("afterexit",null,e),Ar&&e==="SIGHUP"&&(e="SIGINT"),m.kill(m.pid,e))}}}),G.signals=function(){return J};var X=!1,ot=function(){X||!_(I.process)||(X=!0,B.count+=1,J=J.filter(function(u){try{return m.on(u,Me[u]),!0}catch{return!1}}),m.emit=xr,m.reallyExit=vr)};G.load=ot;var st=m.reallyExit,vr=function(u){_(I.process)&&(m.exitCode=u||0,U("exit",m.exitCode,null),U("afterexit",m.exitCode,null),st.call(m,m.exitCode))},Ge=m.emit,xr=function(u,t){if(u==="exit"&&_(I.process)){t!==void 0&&(m.exitCode=t);var n=Ge.apply(this,arguments);return U("exit",m.exitCode,null),U("afterexit",m.exitCode,null),n}else return Ge.apply(this,arguments)}}const Sr=1e3*5,Or=(e,u="SIGTERM",t={})=>{const n=e(u);return Ir(e,u,t,n),n},Ir=(e,u,t,n)=>{if(!Tr(u,t,n))return;const D=kr(t),r=setTimeout(()=>{e("SIGKILL")},D);r.unref&&r.unref()},Tr=(e,{forceKillAfterTimeout:u},t)=>Pr(e)&&u!==!1&&t,Pr=e=>e===Ut.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",kr=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Sr;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Rr=(e,u)=>{e.kill()&&(u.isCanceled=!0)},_r=(e,u,t)=>{e.kill(u),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:u}))},jr=(e,{timeout:u,killSignal:t="SIGTERM"},n)=>{if(u===0||u===void 0)return n;let D;const r=new Promise((o,s)=>{D=setTimeout(()=>{_r(e,t,s)},u)}),i=n.finally(()=>{clearTimeout(D)});return Promise.race([r,i])},Nr=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Lr=async(e,{cleanup:u,detached:t},n)=>{if(!u||t)return n;const D=G(()=>{e.kill()});return n.finally(()=>{D()})};function Mr(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}var j={},Gr={get exports(){return j},set exports(e){j=e}};const{PassThrough:Ur}=ge;var Wr=e=>{e={...e};const{array:u}=e;let{encoding:t}=e;const n=t==="buffer";let D=!1;u?D=!(t||n):t=t||"utf8",n&&(t=null);const r=new Ur({objectMode:D});t&&r.setEncoding(t);let i=0;const o=[];return r.on("data",s=>{o.push(s),D?i=o.length:i+=s.length}),r.getBufferedValue=()=>u?o:n?Buffer.concat(o,i):o.join(""),r.getBufferedLength=()=>i,r};const{constants:Kr}=qt,qr=ge,{promisify:zr}=zt,Vr=Wr,Hr=zr(qr.pipeline);class at extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function Ue(e,u){if(!e)throw new Error("Expected a stream");u={maxBuffer:1/0,...u};const{maxBuffer:t}=u,n=Vr(u);return await new Promise((D,r)=>{const i=o=>{o&&n.getBufferedLength()<=Kr.MAX_LENGTH&&(o.bufferedData=n.getBufferedValue()),r(o)};(async()=>{try{await Hr(e,n),D()}catch(o){i(o)}})(),n.on("data",()=>{n.getBufferedLength()>t&&i(new at)})}),n.getBufferedValue()}Gr.exports=Ue,j.buffer=(e,u)=>Ue(e,{...u,encoding:"buffer"}),j.array=(e,u)=>Ue(e,{...u,array:!0}),j.MaxBufferError=at;const{PassThrough:Yr}=ge;var Jr=function(){var e=[],u=new Yr({objectMode:!0});return u.setMaxListeners(0),u.add=t,u.isEmpty=n,u.on("unpipe",D),Array.prototype.slice.call(arguments).forEach(t),u;function t(r){return Array.isArray(r)?(r.forEach(t),this):(e.push(r),r.once("end",D.bind(null,r)),r.once("error",u.emit.bind(u,"error")),r.pipe(u,{end:!1}),this)}function n(){return e.length==0}function D(r){e=e.filter(function(i){return i!==r}),!e.length&&u.readable&&u.end()}};const Xr=(e,u)=>{u!==void 0&&(Mr(u)?u.pipe(e.stdin):e.stdin.end(u))},Zr=(e,{all:u})=>{if(!u||!e.stdout&&!e.stderr)return;const t=Jr();return e.stdout&&t.add(e.stdout),e.stderr&&t.add(e.stderr),t},We=async(e,u)=>{if(!(!e||u===void 0)){e.destroy();try{return await u}catch(t){return t.bufferedData}}},Ke=(e,{encoding:u,buffer:t,maxBuffer:n})=>{if(!(!e||!t))return u?j(e,{encoding:u,maxBuffer:n}):j.buffer(e,{maxBuffer:n})},Qr=async({stdout:e,stderr:u,all:t},{encoding:n,buffer:D,maxBuffer:r},i)=>{const o=Ke(e,{encoding:n,buffer:D,maxBuffer:r}),s=Ke(u,{encoding:n,buffer:D,maxBuffer:r}),a=Ke(t,{encoding:n,buffer:D,maxBuffer:r*2});try{return await Promise.all([i,o,s,a])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},We(e,o),We(u,s),We(t,a)])}},ei=(async()=>{})().constructor.prototype,ui=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(ei,e)]),ct=(e,u)=>{for(const[t,n]of ui){const D=typeof u=="function"?(...r)=>Reflect.apply(n.value,u(),r):n.value.bind(u);Reflect.defineProperty(e,t,{...n,value:D})}return e},ti=e=>new Promise((u,t)=>{e.on("exit",(n,D)=>{u({exitCode:n,signal:D})}),e.on("error",n=>{t(n)}),e.stdin&&e.stdin.on("error",n=>{t(n)})}),lt=(e,u=[])=>Array.isArray(u)?[e,...u]:[e],ni=/^[\w.-]+$/,Di=/"/g,ri=e=>typeof e!="string"||ni.test(e)?e:`"${e.replace(Di,'\\"')}"`,ii=(e,u)=>lt(e,u).join(" "),oi=(e,u)=>lt(e,u).map(t=>ri(t)).join(" "),si=1e3*1e3*100,ai=({env:e,extendEnv:u,preferLocal:t,localDir:n,execPath:D})=>{const r=u?{...g.env,...e}:e;return t?ur({env:r,cwd:n,execPath:D}):r},ci=(e,u,t={})=>{const n=R._parse(e,u,t);return e=n.command,u=n.args,t=n.options,t={maxBuffer:si,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||g.cwd(),execPath:g.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...t},t.env=ai(t),t.stdio=wr(t),g.platform==="win32"&&L.basename(e,".exe")==="cmd"&&u.unshift("/q"),{file:e,args:u,options:t,parsed:n}},qe=(e,u,t)=>typeof u!="string"&&!Lt.isBuffer(u)?t===void 0?void 0:"":e.stripFinalNewline?QD(u):u;function le(e,u,t){const n=ci(e,u,t),D=ii(e,u),r=oi(e,u);Nr(n.options);let i;try{i=lu.spawn(n.file,n.args,n.options)}catch(d){const F=new lu.ChildProcess,E=Promise.reject(Dt({error:d,stdout:"",stderr:"",all:"",command:D,escapedCommand:r,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return ct(F,E)}const o=ti(i),s=jr(i,n.options,o),a=Lr(i,n.options,s),l={isCanceled:!1};i.kill=Or.bind(null,i.kill.bind(i)),i.cancel=Rr.bind(null,i,l);const f=et(async()=>{const[{error:d,exitCode:F,signal:E,timedOut:b},P,S,Q]=await Qr(i,n.options,a),iu=qe(n.options,P),ou=qe(n.options,S),su=qe(n.options,Q);if(d||F!==0||E!==null){const au=Dt({error:d,exitCode:F,signal:E,stdout:iu,stderr:ou,all:su,command:D,escapedCommand:r,parsed:n,timedOut:b,isCanceled:l.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:i.killed});if(!n.options.reject)return au;throw au}return{command:D,escapedCommand:r,exitCode:0,stdout:iu,stderr:ou,all:su,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Xr(i,n.options.input),i.all=Zr(i,n.options),ct(i,f)}let N=!0;const W=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let ft=0;if(W.process&&W.process.env&&W.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:u,NO_COLOR:t,TERM:n}=W.process.env;u||t||e==="0"?N=!1:e==="1"||e==="2"||e==="3"?N=!0:n==="dumb"?N=!1:"CI"in W.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(D=>D in W.process.env)?N=!0:N=process.stdout.isTTY,N&&(ft=n&&n.endsWith("-256color")?2:1)}let dt={enabled:N,supportLevel:ft};function Z(e,u,t=1){const n=`\x1B[${e}m`,D=`\x1B[${u}m`,r=new RegExp(`\\x1b\\[${u}m`,"g");return i=>dt.enabled&&dt.supportLevel>=t?n+(""+i).replace(r,n)+D:""+i}const ze=Z(2,22),pt=Z(30,39),fe=Z(31,39),de=Z(32,39),Ft=Z(46,49),Ve="\x1B",h=`${Ve}[`,li="\x07",He={to(e,u){return u?`${h}${u+1};${e+1}H`:`${h}${e+1}G`},move(e,u){let t="";return e<0?t+=`${h}${-e}D`:e>0&&(t+=`${h}${e}C`),u<0?t+=`${h}${-u}A`:u>0&&(t+=`${h}${u}B`),t},up:(e=1)=>`${h}${e}A`,down:(e=1)=>`${h}${e}B`,forward:(e=1)=>`${h}${e}C`,backward:(e=1)=>`${h}${e}D`,nextLine:(e=1)=>`${h}E`.repeat(e),prevLine:(e=1)=>`${h}F`.repeat(e),left:`${h}G`,hide:`${h}?25l`,show:`${h}?25h`,save:`${Ve}7`,restore:`${Ve}8`},fi={up:(e=1)=>`${h}S`.repeat(e),down:(e=1)=>`${h}T`.repeat(e)},di={screen:`${h}2J`,up:(e=1)=>`${h}1J`.repeat(e),down:(e=1)=>`${h}J`.repeat(e),line:`${h}2K`,lineEnd:`${h}K`,lineStart:`${h}1K`,lines(e){let u="";for(let t=0;t<e;t++)u+=this.line+(t<e-1?He.up():"");return e&&(u+=He.left),u}};var w={cursor:He,scroll:fi,erase:di,beep:li},p={},pi={get exports(){return p},set exports(e){p=e}};let Fi=cu,mi=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Fi.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),C=(e,u,t=e)=>n=>{let D=""+n,r=D.indexOf(u,e.length);return~r?e+mt(D,u,t,r)+u:e+D+u},mt=(e,u,t,n)=>{let D=e.substring(0,n)+t,r=e.substring(n+u.length),i=r.indexOf(u);return~i?D+mt(r,u,t,i):D+r},Ct=(e=mi)=>({isColorSupported:e,reset:e?u=>`\x1B[0m${u}\x1B[0m`:String,bold:e?C("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?C("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?C("\x1B[3m","\x1B[23m"):String,underline:e?C("\x1B[4m","\x1B[24m"):String,inverse:e?C("\x1B[7m","\x1B[27m"):String,hidden:e?C("\x1B[8m","\x1B[28m"):String,strikethrough:e?C("\x1B[9m","\x1B[29m"):String,black:e?C("\x1B[30m","\x1B[39m"):String,red:e?C("\x1B[31m","\x1B[39m"):String,green:e?C("\x1B[32m","\x1B[39m"):String,yellow:e?C("\x1B[33m","\x1B[39m"):String,blue:e?C("\x1B[34m","\x1B[39m"):String,magenta:e?C("\x1B[35m","\x1B[39m"):String,cyan:e?C("\x1B[36m","\x1B[39m"):String,white:e?C("\x1B[37m","\x1B[39m"):String,gray:e?C("\x1B[90m","\x1B[39m"):String,bgBlack:e?C("\x1B[40m","\x1B[49m"):String,bgRed:e?C("\x1B[41m","\x1B[49m"):String,bgGreen:e?C("\x1B[42m","\x1B[49m"):String,bgYellow:e?C("\x1B[43m","\x1B[49m"):String,bgBlue:e?C("\x1B[44m","\x1B[49m"):String,bgMagenta:e?C("\x1B[45m","\x1B[49m"):String,bgCyan:e?C("\x1B[46m","\x1B[49m"):String,bgWhite:e?C("\x1B[47m","\x1B[49m"):String});pi.exports=Ct(),p.createColors=Ct;function Ci(e,u){if(e===u)return;const t=e.split(`
28
- `),n=u.split(`
29
- `),D=[];for(let r=0;r<Math.max(t.length,n.length);r++)t[r]!==n[r]&&D.push(r);return D}const ht=Symbol("clack:cancel");function Et(e){return e===ht}function pe(e,u){e.isTTY&&e.setRawMode(u)}const gt=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),hi=new Set(["up","down","left","right","space","enter"]);class Bt{constructor({render:u,input:t=fu,output:n=du,...D},r=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=D,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=u.bind(this),this._track=r,this.input=t,this.output=n}prompt(){const u=new Vt(0);return u._write=(t,n,D)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),D()},this.input.pipe(u),this.rl=Fu.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),Fu.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),pe(this.input,!0),this.render(),new Promise((t,n)=>{this.once("submit",()=>{this.output.write(w.cursor.show),pe(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(w.cursor.show),pe(this.input,!1),t(ht)})})}on(u,t){const n=this.subscribers.get(u)??[];n.push({cb:t}),this.subscribers.set(u,n)}once(u,t){const n=this.subscribers.get(u)??[];n.push({cb:t,once:!0}),this.subscribers.set(u,n)}emit(u,...t){const n=this.subscribers.get(u)??[],D=[];for(const r of n)r.cb(...t),r.once&&D.push(()=>n.splice(n.indexOf(r),1));for(const r of D)r()}unsubscribe(){this.subscribers.clear()}onKeypress(u,t){if(this.state==="error"&&(this.state="active"),t?.name&&!this._track&&gt.has(t.name)&&this.emit("cursor",gt.get(t.name)),t?.name&&hi.has(t.name)&&this.emit("cursor",t.name),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u&&this.emit("key",u.toLowerCase()),t?.name==="return"){if(this.opts.validate){const n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}u===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
30
- `),pe(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const u=this._prevFrame.split(`
31
- `).length-1;this.output.write(w.cursor.move(-999,u*-1))}render(){const u=this._render(this)??"";if(u!==this._prevFrame){if(this.state==="initial")this.output.write(w.cursor.hide);else{const t=Ci(this._prevFrame,u);if(this.restoreCursor(),t&&t?.length===1){const n=t[0];this.output.write(w.cursor.move(0,n)),this.output.write(w.erase.lines(1));const D=u.split(`
32
- `);this.output.write(D[n]),this._prevFrame=u,this.output.write(w.cursor.move(0,D.length-n-1));return}else if(t&&t?.length>1){const n=t[0];this.output.write(w.cursor.move(0,n)),this.output.write(w.erase.down());const D=u.split(`
33
- `).slice(n);this.output.write(D.join(`
34
- `)),this._prevFrame=u;return}this.output.write(w.erase.down())}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u}}}class Ei extends Bt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,!1),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(w.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}class gi extends Bt{constructor(u){super(u,!1),this.cursor=0,this.options=u.options,this.cursor=this.options.findIndex(({value:t})=>t===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){case"left":case"up":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;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}function Bi({input:e=fu,output:u=du,overwrite:t=!0,hideCursor:n=!0}={}){const D=ee.createInterface({input:e,output:u,prompt:"",tabSize:1});ee.emitKeypressEvents(e,D),e.isTTY&&e.setRawMode(!0);const r=(i,{name:o})=>{if(String(i)===""&&process.exit(0),!t)return;let s=o==="return"?0:-1,a=o==="return"?-1:0;ee.moveCursor(u,s,a,()=>{ee.clearLine(u,1,()=>{e.once("keypress",r)})})};return n&&process.stdout.write(w.cursor.hide),e.once("keypress",r),()=>{e.off("keypress",r),n&&process.stdout.write(w.cursor.show),D.terminal=!1,D.close()}}function wi(){return g.platform!=="win32"?g.env.TERM!=="linux":Boolean(g.env.CI)||Boolean(g.env.WT_SESSION)||Boolean(g.env.TERMINUS_SUBLIME)||g.env.ConEmuTask==="{cmd::Cmder}"||g.env.TERM_PROGRAM==="Terminus-Sublime"||g.env.TERM_PROGRAM==="vscode"||g.env.TERM==="xterm-256color"||g.env.TERM==="alacritty"||g.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Ye=wi(),O=(e,u)=>Ye?e:u,bi=O("\u25C6","*"),yi=O("\u25A0","x"),$i=O("\u25B2","x"),wt=O("\u25C7","o"),Ai=O("\u250C","T"),A=O("\u2502","|"),Je=O("\u2514","\u2014"),Xe=O("\u25CF",">"),Ze=O("\u25CB"," "),bt=e=>{switch(e){case"initial":case"active":return p.cyan(bi);case"cancel":return p.red(yi);case"error":return p.yellow($i);case"submit":return p.green(wt)}},vi=e=>{const u=e.active??"Yes",t=e.inactive??"No";return new Ei({active:u,inactive:t,initialValue:e.initialValue??!0,render(){const n=`${p.gray(A)}
35
- ${bt(this.state)} ${e.message}
36
- `,D=this.value?u:t;switch(this.state){case"submit":return`${n}${p.gray(A)} ${p.dim(D)}`;case"cancel":return`${n}${p.gray(A)} ${p.strikethrough(p.dim(D))}
37
- ${p.gray(A)}`;default:return`${n}${p.cyan(A)} ${this.value?`${p.green(Xe)} ${u}`:`${p.dim(Ze)} ${p.dim(u)}`} ${p.dim("/")} ${this.value?`${p.dim(Ze)} ${p.dim(t)}`:`${p.green(Xe)} ${t}`}
38
- ${p.cyan(Je)}
39
- `}}}).prompt()},xi=e=>{const u=(t,n)=>{const D=t.label??String(t.value);return n==="active"?`${p.green(Xe)} ${D} ${t.hint?p.dim(`(${t.hint})`):""}`:n==="selected"?`${p.dim(D)}`:n==="cancelled"?`${p.strikethrough(p.dim(D))}`:`${p.dim(Ze)} ${p.dim(D)}`};return new gi({options:e.options,initialValue:e.initialValue,render(){const t=`${p.gray(A)}
40
- ${bt(this.state)} ${e.message}
41
- `;switch(this.state){case"submit":return`${t}${p.gray(A)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${t}${p.gray(A)} ${u(this.options[this.cursor],"cancelled")}
42
- ${p.gray(A)}`;default:return`${t}${p.cyan(A)} ${this.options.map((n,D)=>u(n,D===this.cursor?"active":"inactive")).join(`
43
- ${p.cyan(A)} `)}
44
- ${p.cyan(Je)}
45
- `}}}).prompt()},yt=(e="")=>{process.stdout.write(`${p.gray(Ai)} ${e}
46
- `)},K=(e="")=>{process.stdout.write(`${p.gray(A)}
47
- ${p.gray(Je)} ${e}
24
+ `.charCodeAt(),n=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}function bu(e={}){const{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(u=>u.toUpperCase()==="PATH")||"Path"}function Mo(e={}){const{cwd:t=b.cwd(),path:n=b.env[bu()],execPath:u=b.execPath}=e;let r;const o=t instanceof URL?$n.fileURLToPath(t):t;let s=W.resolve(o);const i=[];for(;r!==s;)i.push(W.join(s,"node_modules/.bin")),r=s,s=W.resolve(s,"..");return i.push(W.resolve(o,u,"..")),[...i,n].join(W.delimiter)}function jo({env:e=b.env,...t}={}){e={...e};const n=bu({env:e});return t.path=e[n],e[n]=Mo(t),e}const Lo=(e,t,n,u)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;const r=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);!No(r,o)&&u||Object.defineProperty(e,n,o)},No=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Go=(e,t)=>{const n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Uo=(e,t)=>`/* Wrapped ${e}*/
25
+ ${t}`,Wo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),qo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ho=(e,t,n)=>{const u=n===""?"":`with ${n.trim()}() `,r=Uo.bind(null,u,t.toString());Object.defineProperty(r,"name",qo),Object.defineProperty(e,"toString",{...Wo,value:r})};function zo(e,t,{ignoreNonConfigurable:n=!1}={}){const{name:u}=e;for(const r of Reflect.ownKeys(t))Lo(e,t,r,n);return Go(e,t),Ho(e,t,u),e}const Fe=new WeakMap,wu=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,u=0;const r=e.displayName||e.name||"<anonymous>",o=function(...s){if(Fe.set(o,++u),u===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return n};return zo(o,e),Fe.set(o,u),o};wu.callCount=e=>{if(!Fe.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Fe.get(e)};const Ko=function(){const e=$u-Bu+1;return Array.from({length:e},Vo)},Vo=function(e,t){return{name:`SIGRT${t+1}`,number:Bu+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},Bu=34,$u=64,Yo=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],vu=function(){const e=Ko();return[...Yo,...e].map(Jo)},Jo=function({name:e,number:t,description:n,action:u,forced:r=!1,standard:o}){const{signals:{[e]:s}}=Pt,i=s!==void 0;return{name:e,number:i?s:t,description:n,supported:i,action:u,forced:r,standard:o}},Xo=function(){const e=vu();return Object.fromEntries(e.map(Zo))},Zo=function({name:e,number:t,description:n,supported:u,action:r,forced:o,standard:s}){return[e,{name:e,number:t,description:n,supported:u,action:r,forced:o,standard:s}]},Qo=Xo(),es=function(){const e=vu(),t=$u+1,n=Array.from({length:t},(u,r)=>ts(r,e));return Object.assign({},...n)},ts=function(e,t){const n=us(e,t);if(n===void 0)return{};const{name:u,description:r,supported:o,action:s,forced:i,standard:D}=n;return{[e]:{name:u,number:e,description:r,supported:o,action:s,forced:i,standard:D}}},us=function(e,t){const n=t.find(({name:u})=>Pt.signals[u]===e);return n!==void 0?n:t.find(u=>u.number===e)};es();const ns=({timedOut:e,timeout:t,errorCode:n,signal:u,signalDescription:r,exitCode:o,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:u!==void 0?`was killed with ${u} (${r})`:o!==void 0?`failed with exit code ${o}`:"failed",Au=({stdout:e,stderr:t,all:n,error:u,signal:r,exitCode:o,command:s,escapedCommand:i,timedOut:D,isCanceled:l,killed:f,parsed:{options:{timeout:a}}})=>{o=o===null?void 0:o,r=r===null?void 0:r;const c=r===void 0?void 0:Qo[r].description,d=u&&u.code,m=`Command ${ns({timedOut:D,timeout:a,errorCode:d,signal:r,signalDescription:c,exitCode:o,isCanceled:l})}: ${s}`,h=Object.prototype.toString.call(u)==="[object Error]",F=h?`${m}
26
+ ${u.message}`:m,B=[F,t,e].filter(Boolean).join(`
27
+ `);return h?(u.originalMessage=u.message,u.message=B):u=new Error(B),u.shortMessage=F,u.command=s,u.escapedCommand=i,u.exitCode=o,u.signal=r,u.signalDescription=c,u.stdout=e,u.stderr=t,n!==void 0&&(u.all=n),"bufferedData"in u&&delete u.bufferedData,u.failed=!0,u.timedOut=Boolean(D),u.isCanceled=l,u.killed=f&&!D,u},ge=["stdin","stdout","stderr"],rs=e=>ge.some(t=>e[t]!==void 0),os=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return ge.map(u=>e[u]);if(rs(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ge.map(u=>`\`${u}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,ge.length);return Array.from({length:n},(u,r)=>t[r])};var H={},xu={get exports(){return H},set exports(e){H=e}},Ee={},ss={get exports(){return Ee},set exports(e){Ee=e}},Su;function is(){return Su||(Su=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(ss)),Ee}var g=w.process;const j=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!j(g))xu.exports=function(){return function(){}};else{var Ds=_t,ee=is(),as=/^win/i.test(g.platform),ye=Rt;typeof ye!="function"&&(ye=ye.EventEmitter);var $;g.__signal_exit_emitter__?$=g.__signal_exit_emitter__:($=g.__signal_exit_emitter__=new ye,$.count=0,$.emitted={}),$.infinite||($.setMaxListeners(1/0),$.infinite=!0),xu.exports=function(e,t){if(!j(w.process))return function(){};Ds.equal(typeof e,"function","a callback must be provided for exit handler"),te===!1&&Ou();var n="exit";t&&t.alwaysLast&&(n="afterexit");var u=function(){$.removeListener(n,e),$.listeners("exit").length===0&&$.listeners("afterexit").length===0&&Ze()};return $.on(n,e),u};var Ze=function(){!te||!j(w.process)||(te=!1,ee.forEach(function(t){try{g.removeListener(t,Qe[t])}catch{}}),g.emit=et,g.reallyExit=Iu,$.count-=1)};H.unload=Ze;var z=function(t,n,u){$.emitted[t]||($.emitted[t]=!0,$.emit(t,n,u))},Qe={};ee.forEach(function(e){Qe[e]=function(){if(j(w.process)){var n=g.listeners(e);n.length===$.count&&(Ze(),z("exit",null,e),z("afterexit",null,e),as&&e==="SIGHUP"&&(e="SIGINT"),g.kill(g.pid,e))}}}),H.signals=function(){return ee};var te=!1,Ou=function(){te||!j(w.process)||(te=!0,$.count+=1,ee=ee.filter(function(t){try{return g.on(t,Qe[t]),!0}catch{return!1}}),g.emit=ls,g.reallyExit=cs)};H.load=Ou;var Iu=g.reallyExit,cs=function(t){j(w.process)&&(g.exitCode=t||0,z("exit",g.exitCode,null),z("afterexit",g.exitCode,null),Iu.call(g,g.exitCode))},et=g.emit,ls=function(t,n){if(t==="exit"&&j(w.process)){n!==void 0&&(g.exitCode=n);var u=et.apply(this,arguments);return z("exit",g.exitCode,null),z("afterexit",g.exitCode,null),u}else return et.apply(this,arguments)}}const fs=1e3*5,ds=(e,t="SIGTERM",n={})=>{const u=e(t);return ps(e,t,n,u),u},ps=(e,t,n,u)=>{if(!Cs(t,n,u))return;const r=hs(n),o=setTimeout(()=>{e("SIGKILL")},r);o.unref&&o.unref()},Cs=(e,{forceKillAfterTimeout:t},n)=>ms(e)&&t!==!1&&n,ms=e=>e===vn.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",hs=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return fs;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Fs=(e,t)=>{e.kill()&&(t.isCanceled=!0)},gs=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Es=(e,{timeout:t,killSignal:n="SIGTERM"},u)=>{if(t===0||t===void 0)return u;let r;const o=new Promise((i,D)=>{r=setTimeout(()=>{gs(e,n,D)},t)}),s=u.finally(()=>{clearTimeout(r)});return Promise.race([o,s])},ys=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},bs=async(e,{cleanup:t,detached:n},u)=>{if(!t||n)return u;const r=H(()=>{e.kill()});return u.finally(()=>{r()})};function ws(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}var L={},Bs={get exports(){return L},set exports(e){L=e}};const{PassThrough:$s}=Pe;var vs=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const u=n==="buffer";let r=!1;t?r=!(n||u):n=n||"utf8",u&&(n=null);const o=new $s({objectMode:r});n&&o.setEncoding(n);let s=0;const i=[];return o.on("data",D=>{i.push(D),r?s=i.length:s+=D.length}),o.getBufferedValue=()=>t?i:u?Buffer.concat(i,s):i.join(""),o.getBufferedLength=()=>s,o};const{constants:As}=An,xs=Pe,{promisify:Ss}=kt,Os=vs,Is=Ss(xs.pipeline);class Tu extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function tt(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:n}=t,u=Os(t);return await new Promise((r,o)=>{const s=i=>{i&&u.getBufferedLength()<=As.MAX_LENGTH&&(i.bufferedData=u.getBufferedValue()),o(i)};(async()=>{try{await Is(e,u),r()}catch(i){s(i)}})(),u.on("data",()=>{u.getBufferedLength()>n&&s(new Tu)})}),u.getBufferedValue()}Bs.exports=tt,L.buffer=(e,t)=>tt(e,{...t,encoding:"buffer"}),L.array=(e,t)=>tt(e,{...t,array:!0}),L.MaxBufferError=Tu;const{PassThrough:Ts}=Pe;var Ps=function(){var e=[],t=new Ts({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=u,t.on("unpipe",r),Array.prototype.slice.call(arguments).forEach(n),t;function n(o){return Array.isArray(o)?(o.forEach(n),this):(e.push(o),o.once("end",r.bind(null,o)),o.once("error",t.emit.bind(t,"error")),o.pipe(t,{end:!1}),this)}function u(){return e.length==0}function r(o){e=e.filter(function(s){return s!==o}),!e.length&&t.readable&&t.end()}};const _s=(e,t)=>{t!==void 0&&(ws(t)?t.pipe(e.stdin):e.stdin.end(t))},Rs=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const n=Ps();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},ut=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(n){return n.bufferedData}}},nt=(e,{encoding:t,buffer:n,maxBuffer:u})=>{if(!(!e||!n))return t?L(e,{encoding:t,maxBuffer:u}):L.buffer(e,{maxBuffer:u})},ks=async({stdout:e,stderr:t,all:n},{encoding:u,buffer:r,maxBuffer:o},s)=>{const i=nt(e,{encoding:u,buffer:r,maxBuffer:o}),D=nt(t,{encoding:u,buffer:r,maxBuffer:o}),l=nt(n,{encoding:u,buffer:r,maxBuffer:o*2});try{return await Promise.all([s,i,D,l])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},ut(e,i),ut(t,D),ut(n,l)])}},Ms=(async()=>{})().constructor.prototype,js=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Ms,e)]),Pu=(e,t)=>{for(const[n,u]of js){const r=typeof t=="function"?(...o)=>Reflect.apply(u.value,t(),o):u.value.bind(t);Reflect.defineProperty(e,n,{...u,value:r})}return e},Ls=e=>new Promise((t,n)=>{e.on("exit",(u,r)=>{t({exitCode:u,signal:r})}),e.on("error",u=>{n(u)}),e.stdin&&e.stdin.on("error",u=>{n(u)})}),_u=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Ns=/^[\w.-]+$/,Gs=/"/g,Us=e=>typeof e!="string"||Ns.test(e)?e:`"${e.replace(Gs,'\\"')}"`,Ws=(e,t)=>_u(e,t).join(" "),qs=(e,t)=>_u(e,t).map(n=>Us(n)).join(" "),Hs=1e3*1e3*100,zs=({env:e,extendEnv:t,preferLocal:n,localDir:u,execPath:r})=>{const o=t?{...b.env,...e}:e;return n?jo({env:o,cwd:u,execPath:r}):o},Ks=(e,t,n={})=>{const u=M._parse(e,t,n);return e=u.command,t=u.args,n=u.options,n={maxBuffer:Hs,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||b.cwd(),execPath:b.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n},n.env=zs(n),n.stdio=os(n),b.platform==="win32"&&W.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:u}},rt=(e,t,n)=>typeof t!="string"&&!wn.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?ko(t):t;function be(e,t,n){const u=Ks(e,t,n),r=Ws(e,t),o=qs(e,t);ys(u.options);let s;try{s=Ot.spawn(u.file,u.args,u.options)}catch(d){const p=new Ot.ChildProcess,m=Promise.reject(Au({error:d,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:u,timedOut:!1,isCanceled:!1,killed:!1}));return Pu(p,m)}const i=Ls(s),D=Es(s,u.options,i),l=bs(s,u.options,D),f={isCanceled:!1};s.kill=ds.bind(null,s.kill.bind(s)),s.cancel=Fs.bind(null,s,f);const c=wu(async()=>{const[{error:d,exitCode:p,signal:m,timedOut:h},F,B,T]=await ks(s,u.options,l),ae=rt(u.options,F),R=rt(u.options,B),Ie=rt(u.options,T);if(d||p!==0||m!==null){const U=Au({error:d,exitCode:p,signal:m,stdout:ae,stderr:R,all:Ie,command:r,escapedCommand:o,parsed:u,timedOut:h,isCanceled:f.isCanceled||(u.options.signal?u.options.signal.aborted:!1),killed:s.killed});if(!u.options.reject)return U;throw U}return{command:r,escapedCommand:o,exitCode:0,stdout:ae,stderr:R,all:Ie,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return _s(s,u.options.input),s.all=Rs(s,u.options),Pu(s,c)}let N=!0;const K=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Ru=0;if(K.process&&K.process.env&&K.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:n,TERM:u}=K.process.env;t||n||e==="0"?N=!1:e==="1"||e==="2"||e==="3"?N=!0:u==="dumb"?N=!1:"CI"in K.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(r=>r in K.process.env)?N=!0:N=process.stdout.isTTY,N&&(Ru=u&&u.endsWith("-256color")?2:1)}let ku={enabled:N,supportLevel:Ru};function ue(e,t,n=1){const u=`\x1B[${e}m`,r=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return s=>ku.enabled&&ku.supportLevel>=n?u+(""+s).replace(o,u)+r:""+s}const ot=ue(2,22),Mu=ue(30,39),we=ue(31,39),Be=ue(32,39),ju=ue(46,49),st="\x1B",y=`${st}[`,Vs="\x07",it={to(e,t){return t?`${y}${t+1};${e+1}H`:`${y}${e+1}G`},move(e,t){let n="";return e<0?n+=`${y}${-e}D`:e>0&&(n+=`${y}${e}C`),t<0?n+=`${y}${-t}A`:t>0&&(n+=`${y}${t}B`),n},up:(e=1)=>`${y}${e}A`,down:(e=1)=>`${y}${e}B`,forward:(e=1)=>`${y}${e}C`,backward:(e=1)=>`${y}${e}D`,nextLine:(e=1)=>`${y}E`.repeat(e),prevLine:(e=1)=>`${y}F`.repeat(e),left:`${y}G`,hide:`${y}?25l`,show:`${y}?25h`,save:`${st}7`,restore:`${st}8`},Ys={up:(e=1)=>`${y}S`.repeat(e),down:(e=1)=>`${y}T`.repeat(e)},Js={screen:`${y}2J`,up:(e=1)=>`${y}1J`.repeat(e),down:(e=1)=>`${y}J`.repeat(e),line:`${y}2K`,lineEnd:`${y}K`,lineStart:`${y}1K`,lines(e){let t="";for(let n=0;n<e;n++)t+=this.line+(n<e-1?it.up():"");return e&&(t+=it.left),t}};var v={cursor:it,scroll:Ys,erase:Js,beep:Vs},C={},Xs={get exports(){return C},set exports(e){C=e}};let Zs=ce,Qs=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Zs.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),E=(e,t,n=e)=>u=>{let r=""+u,o=r.indexOf(t,e.length);return~o?e+Lu(r,t,n,o)+t:e+r+t},Lu=(e,t,n,u)=>{let r=e.substring(0,u)+n,o=e.substring(u+t.length),s=o.indexOf(t);return~s?r+Lu(o,t,n,s):r+o},Nu=(e=Qs)=>({isColorSupported:e,reset:e?t=>`\x1B[0m${t}\x1B[0m`:String,bold:e?E("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?E("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?E("\x1B[3m","\x1B[23m"):String,underline:e?E("\x1B[4m","\x1B[24m"):String,inverse:e?E("\x1B[7m","\x1B[27m"):String,hidden:e?E("\x1B[8m","\x1B[28m"):String,strikethrough:e?E("\x1B[9m","\x1B[29m"):String,black:e?E("\x1B[30m","\x1B[39m"):String,red:e?E("\x1B[31m","\x1B[39m"):String,green:e?E("\x1B[32m","\x1B[39m"):String,yellow:e?E("\x1B[33m","\x1B[39m"):String,blue:e?E("\x1B[34m","\x1B[39m"):String,magenta:e?E("\x1B[35m","\x1B[39m"):String,cyan:e?E("\x1B[36m","\x1B[39m"):String,white:e?E("\x1B[37m","\x1B[39m"):String,gray:e?E("\x1B[90m","\x1B[39m"):String,bgBlack:e?E("\x1B[40m","\x1B[49m"):String,bgRed:e?E("\x1B[41m","\x1B[49m"):String,bgGreen:e?E("\x1B[42m","\x1B[49m"):String,bgYellow:e?E("\x1B[43m","\x1B[49m"):String,bgBlue:e?E("\x1B[44m","\x1B[49m"):String,bgMagenta:e?E("\x1B[45m","\x1B[49m"):String,bgCyan:e?E("\x1B[46m","\x1B[49m"):String,bgWhite:e?E("\x1B[47m","\x1B[49m"):String});Xs.exports=Nu(),C.createColors=Nu;function ei(e,t){if(e===t)return;const n=e.split(`
28
+ `),u=t.split(`
29
+ `),r=[];for(let o=0;o<Math.max(n.length,u.length);o++)n[o]!==u[o]&&r.push(o);return r}const Gu=Symbol("clack:cancel");function Uu(e){return e===Gu}function $e(e,t){e.isTTY&&e.setRawMode(t)}const Wu=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),ti=new Set(["up","down","left","right","space","enter"]);class qu{constructor({render:t,input:n=It,output:u=Tt,...r},o=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=t.bind(this),this._track=o,this.input=n,this.output=u}prompt(){const t=new xn(0);return t._write=(n,u,r)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),r()},this.input.pipe(t),this.rl=Mt.createInterface({input:this.input,output:t,tabSize:2,prompt:"",escapeCodeTimeout:50}),Mt.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),$e(this.input,!0),this.render(),new Promise((n,u)=>{this.once("submit",()=>{this.output.write(v.cursor.show),$e(this.input,!1),n(this.value)}),this.once("cancel",()=>{this.output.write(v.cursor.show),$e(this.input,!1),n(Gu)})})}on(t,n){const u=this.subscribers.get(t)??[];u.push({cb:n}),this.subscribers.set(t,u)}once(t,n){const u=this.subscribers.get(t)??[];u.push({cb:n,once:!0}),this.subscribers.set(t,u)}emit(t,...n){const u=this.subscribers.get(t)??[],r=[];for(const o of u)o.cb(...n),o.once&&r.push(()=>u.splice(u.indexOf(o),1));for(const o of r)o()}unsubscribe(){this.subscribers.clear()}onKeypress(t,n){if(this.state==="error"&&(this.state="active"),n?.name&&!this._track&&Wu.has(n.name)&&this.emit("cursor",Wu.get(n.name)),n?.name&&ti.has(n.name)&&this.emit("cursor",n.name),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t&&this.emit("key",t.toLowerCase()),n?.name==="return"){if(this.opts.validate){const u=this.opts.validate(this.value);u&&(this.error=u,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}t===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
30
+ `),$e(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const t=this._prevFrame.split(`
31
+ `).length-1;this.output.write(v.cursor.move(-999,t*-1))}render(){const t=this._render(this)??"";if(t!==this._prevFrame){if(this.state==="initial")this.output.write(v.cursor.hide);else{const n=ei(this._prevFrame,t);if(this.restoreCursor(),n&&n?.length===1){const u=n[0];this.output.write(v.cursor.move(0,u)),this.output.write(v.erase.lines(1));const r=t.split(`
32
+ `);this.output.write(r[u]),this._prevFrame=t,this.output.write(v.cursor.move(0,r.length-u-1));return}else if(n&&n?.length>1){const u=n[0];this.output.write(v.cursor.move(0,u)),this.output.write(v.erase.down());const r=t.split(`
33
+ `).slice(u);this.output.write(r.join(`
34
+ `)),this._prevFrame=t;return}this.output.write(v.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}class ui extends qu{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",n=>{this.output.write(v.cursor.move(0,-1)),this.value=n,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}class ni extends qu{constructor(t){super(t,!1),this.cursor=0,this.options=t.options,this.cursor=this.options.findIndex(({value:n})=>n===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",n=>{switch(n){case"left":case"up":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;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}function ri({input:e=It,output:t=Tt,overwrite:n=!0,hideCursor:u=!0}={}){const r=le.createInterface({input:e,output:t,prompt:"",tabSize:1});le.emitKeypressEvents(e,r),e.isTTY&&e.setRawMode(!0);const o=(s,{name:i})=>{if(String(s)===""&&process.exit(0),!n)return;let D=i==="return"?0:-1,l=i==="return"?-1:0;le.moveCursor(t,D,l,()=>{le.clearLine(t,1,()=>{e.once("keypress",o)})})};return u&&process.stdout.write(v.cursor.hide),e.once("keypress",o),()=>{e.off("keypress",o),u&&process.stdout.write(v.cursor.show),r.terminal=!1,r.close()}}function oi(){return b.platform!=="win32"?b.env.TERM!=="linux":Boolean(b.env.CI)||Boolean(b.env.WT_SESSION)||Boolean(b.env.TERMINUS_SUBLIME)||b.env.ConEmuTask==="{cmd::Cmder}"||b.env.TERM_PROGRAM==="Terminus-Sublime"||b.env.TERM_PROGRAM==="vscode"||b.env.TERM==="xterm-256color"||b.env.TERM==="alacritty"||b.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Dt=oi(),P=(e,t)=>Dt?e:t,si=P("\u25C6","*"),ii=P("\u25A0","x"),Di=P("\u25B2","x"),Hu=P("\u25C7","o"),ai=P("\u250C","T"),S=P("\u2502","|"),at=P("\u2514","\u2014"),ct=P("\u25CF",">"),lt=P("\u25CB"," "),zu=e=>{switch(e){case"initial":case"active":return C.cyan(si);case"cancel":return C.red(ii);case"error":return C.yellow(Di);case"submit":return C.green(Hu)}},ci=e=>{const t=e.active??"Yes",n=e.inactive??"No";return new ui({active:t,inactive:n,initialValue:e.initialValue??!0,render(){const u=`${C.gray(S)}
35
+ ${zu(this.state)} ${e.message}
36
+ `,r=this.value?t:n;switch(this.state){case"submit":return`${u}${C.gray(S)} ${C.dim(r)}`;case"cancel":return`${u}${C.gray(S)} ${C.strikethrough(C.dim(r))}
37
+ ${C.gray(S)}`;default:return`${u}${C.cyan(S)} ${this.value?`${C.green(ct)} ${t}`:`${C.dim(lt)} ${C.dim(t)}`} ${C.dim("/")} ${this.value?`${C.dim(lt)} ${C.dim(n)}`:`${C.green(ct)} ${n}`}
38
+ ${C.cyan(at)}
39
+ `}}}).prompt()},li=e=>{const t=(n,u)=>{const r=n.label??String(n.value);return u==="active"?`${C.green(ct)} ${r} ${n.hint?C.dim(`(${n.hint})`):""}`:u==="selected"?`${C.dim(r)}`:u==="cancelled"?`${C.strikethrough(C.dim(r))}`:`${C.dim(lt)} ${C.dim(r)}`};return new ni({options:e.options,initialValue:e.initialValue,render(){const n=`${C.gray(S)}
40
+ ${zu(this.state)} ${e.message}
41
+ `;switch(this.state){case"submit":return`${n}${C.gray(S)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${n}${C.gray(S)} ${t(this.options[this.cursor],"cancelled")}
42
+ ${C.gray(S)}`;default:return`${n}${C.cyan(S)} ${this.options.map((u,r)=>t(u,r===this.cursor?"active":"inactive")).join(`
43
+ ${C.cyan(S)} `)}
44
+ ${C.cyan(at)}
45
+ `}}}).prompt()},Ku=(e="")=>{process.stdout.write(`${C.gray(ai)} ${e}
46
+ `)},V=(e="")=>{process.stdout.write(`${C.gray(S)}
47
+ ${C.gray(at)} ${e}
48
48
 
49
- `)},Qe=Ye?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],eu=()=>{let e,u;const t=Ye?80:120;return{start(n=""){n=n.replace(/\.?\.?\.$/,""),e=Bi(),process.stdout.write(`${p.gray(A)}
50
- ${p.magenta("\u25CB")} ${n}
51
- `);let D=0,r=0;u=setInterval(()=>{let i=Qe[D];process.stdout.write(w.cursor.move(-999,-1)),process.stdout.write(`${p.magenta(i)} ${n}${Math.floor(r)>=1?".".repeat(Math.floor(r)).slice(0,3):""}
52
- `),D=D===Qe.length-1?0:D+1,r=r===Qe.length?0:r+.125},t)},stop(n=""){process.stdout.write(w.cursor.move(-999,-2)),process.stdout.write(w.erase.down(2)),clearInterval(u),process.stdout.write(`${p.gray(A)}
53
- ${p.green(wt)} ${n}
54
- `),e()}}};class $ extends Error{}const uu=" ",Fe=e=>{e instanceof Error&&!(e instanceof $)&&(e.stack&&console.error(ze(e.stack.split(`
49
+ `)},ft=Dt?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],dt=()=>{let e,t;const n=Dt?80:120;return{start(u=""){u=u.replace(/\.?\.?\.$/,""),e=ri(),process.stdout.write(`${C.gray(S)}
50
+ ${C.magenta("\u25CB")} ${u}
51
+ `);let r=0,o=0;t=setInterval(()=>{let s=ft[r];process.stdout.write(v.cursor.move(-999,-1)),process.stdout.write(`${C.magenta(s)} ${u}${Math.floor(o)>=1?".".repeat(Math.floor(o)).slice(0,3):""}
52
+ `),r=r===ft.length-1?0:r+1,o=o===ft.length?0:o+.125},n)},stop(u=""){process.stdout.write(v.cursor.move(-999,-2)),process.stdout.write(v.erase.down(2)),clearInterval(t),process.stdout.write(`${C.gray(S)}
53
+ ${C.green(Hu)} ${u}
54
+ `),e()}}};class x extends Error{}const pt=" ",ve=e=>{e instanceof Error&&!(e instanceof x)&&(e.stack&&console.error(ot(e.stack.split(`
55
55
  `).slice(1).join(`
56
56
  `))),console.error(`
57
- ${uu}${ze(`aicommits v${ju}`)}`),console.error(`
58
- ${uu}Please open a Bug report with the information above:`),console.error(`${uu}https://github.com/Nutlope/aicommits/issues/new/choose`))},$t=async()=>{const{stdout:e}=await le("git",["rev-parse","--is-inside-work-tree"],{reject:!1});if(e!=="true")throw new $("The current directory must be a Git repository!")},At=["package-lock.json","pnpm-lock.yaml","*.lock"].map(e=>`:(exclude)${e}`),vt=async()=>{const e=["diff","--cached"],{stdout:u}=await le("git",[...e,"--name-only",...At]);if(!u)return;const{stdout:t}=await le("git",[...e,...At]);return{files:u.split(`
59
- `),diff:t}},Si=e=>`Detected ${e.length.toLocaleString()} staged file${e.length>1?"s":""}`,{hasOwnProperty:tu}=Object.prototype,me=typeof process<"u"&&process.platform==="win32"?`\r
57
+ ${pt}${ot(`aicommits v${su}`)}`),console.error(`
58
+ ${pt}Please open a Bug report with the information above:`),console.error(`${pt}https://github.com/Nutlope/aicommits/issues/new/choose`))},Vu=async()=>{const{stdout:e}=await be("git",["rev-parse","--is-inside-work-tree"],{reject:!1});if(e!=="true")throw new x("The current directory must be a Git repository!")},Yu=e=>`:(exclude)${e}`,Ju=["package-lock.json","pnpm-lock.yaml","*.lock"].map(Yu),Xu=async e=>{const t=["diff","--cached"],{stdout:n}=await be("git",[...t,"--name-only",...Ju,...e?e.map(Yu):[]]);if(!n)return;const{stdout:u}=await be("git",[...t,...Ju]);return{files:n.split(`
59
+ `),diff:u}},fi=e=>`Detected ${e.length.toLocaleString()} staged file${e.length>1?"s":""}`,{hasOwnProperty:Ct}=Object.prototype,Ae=typeof process<"u"&&process.platform==="win32"?`\r
60
60
  `:`
61
- `,nu=(e,u)=>{const t=[];let n="";typeof u=="string"?u={section:u,whitespace:!1}:(u=u||Object.create(null),u.whitespace=u.whitespace===!0);const D=u.whitespace?" = ":"=";for(const r of Object.keys(e)){const i=e[r];if(i&&Array.isArray(i))for(const o of i)n+=q(r+"[]")+D+q(o)+me;else i&&typeof i=="object"?t.push(r):n+=q(r)+D+q(i)+me}u.section&&n.length&&(n="["+q(u.section)+"]"+me+n);for(const r of t){const i=xt(r).join("\\."),o=(u.section?u.section+".":"")+i,{whitespace:s}=u,a=nu(e[r],{section:o,whitespace:s});n.length&&a.length&&(n+=me),n+=a}return n},xt=e=>e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(u=>u.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")),St=e=>{const u=Object.create(null);let t=u,n=null;const D=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,r=e.split(/[\r\n]+/g);for(const o of r){if(!o||o.match(/^\s*[;#]/))continue;const s=o.match(D);if(!s)continue;if(s[1]!==void 0){if(n=Ce(s[1]),n==="__proto__"){t=Object.create(null);continue}t=u[n]=u[n]||Object.create(null);continue}const a=Ce(s[2]),l=a.length>2&&a.slice(-2)==="[]",c=l?a.slice(0,-2):a;if(c==="__proto__")continue;const f=s[3]?Ce(s[4]):!0,d=f==="true"||f==="false"||f==="null"?JSON.parse(f):f;l&&(tu.call(t,c)?Array.isArray(t[c])||(t[c]=[t[c]]):t[c]=[]),Array.isArray(t[c])?t[c].push(d):t[c]=d}const i=[];for(const o of Object.keys(u)){if(!tu.call(u,o)||typeof u[o]!="object"||Array.isArray(u[o]))continue;const s=xt(o);t=u;const a=s.pop(),l=a.replace(/\\\./g,".");for(const c of s)c!=="__proto__"&&((!tu.call(t,c)||typeof t[c]!="object")&&(t[c]=Object.create(null)),t=t[c]);t===u&&l===a||(t[l]=u[o],i.push(o))}for(const o of i)delete u[o];return u},Ot=e=>e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"),q=e=>typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&Ot(e)||e!==e.trim()?JSON.stringify(e):e.split(";").join("\\;").split("#").join("\\#"),Ce=(e,u)=>{if(e=(e||"").trim(),Ot(e)){e.charAt(0)==="'"&&(e=e.slice(1,-1));try{e=JSON.parse(e)}catch{}}else{let t=!1,n="";for(let D=0,r=e.length;D<r;D++){const i=e.charAt(D);if(t)"\\;#".indexOf(i)!==-1?n+=i:n+="\\"+i,t=!1;else{if(";#".indexOf(i)!==-1)break;i==="\\"?t=!0:n+=i}}return t&&(n+="\\"),n.trim()}return e};var It={parse:St,decode:St,stringify:nu,encode:nu,safe:q,unsafe:Ce};const Tt=e=>v.lstat(e).then(()=>!0,()=>!1),{hasOwnProperty:Oi}=Object.prototype,Pt=(e,u)=>Oi.call(e,u),z=(e,u,t)=>{if(!u)throw new $(`Invalid config property ${e}: ${t}`)},he={OPENAI_KEY(e){if(!e)throw new $("Please set your OpenAI API key via `aicommits config set OPENAI_KEY=<your token>`");return z("OPENAI_KEY",e.startsWith("sk-"),'Must start with "sk-"'),e},locale(e){return e?(z("locale",e,"Cannot be empty"),z("locale",/^[a-z-]+$/i.test(e),"Must be a valid locale (letters and dashes/underscores). You can consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes"),e):"en"},generate(e){if(!e)return 1;z("generate",/^\d+$/.test(e),"Must be an integer");const u=Number(e);return z("generate",u>0,"Must be greater than 0"),z("generate",u<=5,"Must be less or equal to 5"),u}},Du=V.join(Ht.homedir(),".aicommits"),kt=async()=>{if(!await Tt(Du))return Object.create(null);const u=await v.readFile(Du,"utf8");return It.parse(u)},ru=async e=>{const u=await kt(),t={};for(const n of Object.keys(he)){const D=he[n],r=e?.[n]??u[n];t[n]=D(r)}return t},Ii=async e=>{const u=await kt();for(const[t,n]of e){if(!Pt(he,t))throw new $(`Invalid config property: ${t}`);const D=he[t](n);u[t]=D}await v.writeFile(Du,It.stringify(u),"utf8")},Ti=async(e,u,t,n)=>new Promise((D,r)=>{const i=JSON.stringify(n),o=Yt.request({port:443,hostname:e,path:u,method:"POST",headers:{...t,"Content-Type":"application/json","Content-Length":Buffer.byteLength(i)},timeout:1e4},s=>{const a=[];s.on("data",l=>a.push(l)),s.on("end",()=>{D({request:o,response:s,data:Buffer.concat(a).toString()})})});o.on("error",r),o.on("timeout",()=>{o.destroy(),r(new $("Request timed out"))}),o.write(i),o.end()}),Pi=async(e,u)=>{const{response:t,data:n}=await Ti("api.openai.com","/v1/chat/completions",{Authorization:`Bearer ${e}`},u);if(!t.statusCode||t.statusCode<200||t.statusCode>299){let D=`OpenAI API Error: ${t.statusCode} - ${t.statusMessage}`;throw n&&(D+=`
61
+ `,mt=(e,t)=>{const n=[];let u="";typeof t=="string"?t={section:t,whitespace:!1}:(t=t||Object.create(null),t.whitespace=t.whitespace===!0);const r=t.whitespace?" = ":"=";for(const o of Object.keys(e)){const s=e[o];if(s&&Array.isArray(s))for(const i of s)u+=Y(o+"[]")+r+Y(i)+Ae;else s&&typeof s=="object"?n.push(o):u+=Y(o)+r+Y(s)+Ae}t.section&&u.length&&(u="["+Y(t.section)+"]"+Ae+u);for(const o of n){const s=Zu(o).join("\\."),i=(t.section?t.section+".":"")+s,{whitespace:D}=t,l=mt(e[o],{section:i,whitespace:D});u.length&&l.length&&(u+=Ae),u+=l}return u},Zu=e=>e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(t=>t.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")),Qu=e=>{const t=Object.create(null);let n=t,u=null;const r=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=e.split(/[\r\n]+/g);for(const i of o){if(!i||i.match(/^\s*[;#]/))continue;const D=i.match(r);if(!D)continue;if(D[1]!==void 0){if(u=xe(D[1]),u==="__proto__"){n=Object.create(null);continue}n=t[u]=t[u]||Object.create(null);continue}const l=xe(D[2]),f=l.length>2&&l.slice(-2)==="[]",a=f?l.slice(0,-2):l;if(a==="__proto__")continue;const c=D[3]?xe(D[4]):!0,d=c==="true"||c==="false"||c==="null"?JSON.parse(c):c;f&&(Ct.call(n,a)?Array.isArray(n[a])||(n[a]=[n[a]]):n[a]=[]),Array.isArray(n[a])?n[a].push(d):n[a]=d}const s=[];for(const i of Object.keys(t)){if(!Ct.call(t,i)||typeof t[i]!="object"||Array.isArray(t[i]))continue;const D=Zu(i);n=t;const l=D.pop(),f=l.replace(/\\\./g,".");for(const a of D)a!=="__proto__"&&((!Ct.call(n,a)||typeof n[a]!="object")&&(n[a]=Object.create(null)),n=n[a]);n===t&&f===l||(n[f]=t[i],s.push(i))}for(const i of s)delete t[i];return t},en=e=>e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"),Y=e=>typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&en(e)||e!==e.trim()?JSON.stringify(e):e.split(";").join("\\;").split("#").join("\\#"),xe=(e,t)=>{if(e=(e||"").trim(),en(e)){e.charAt(0)==="'"&&(e=e.slice(1,-1));try{e=JSON.parse(e)}catch{}}else{let n=!1,u="";for(let r=0,o=e.length;r<o;r++){const s=e.charAt(r);if(n)"\\;#".indexOf(s)!==-1?u+=s:u+="\\"+s,n=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?n=!0:u+=s}}return n&&(u+="\\"),u.trim()}return e};var tn={parse:Qu,decode:Qu,stringify:mt,encode:mt,safe:Y,unsafe:xe};const un=e=>O.lstat(e).then(()=>!0,()=>!1),{hasOwnProperty:di}=Object.prototype,nn=(e,t)=>di.call(e,t),G=(e,t,n)=>{if(!t)throw new x(`Invalid config property ${e}: ${n}`)},Se={OPENAI_KEY(e){if(!e)throw new x("Please set your OpenAI API key via `aicommits config set OPENAI_KEY=<your token>`");return G("OPENAI_KEY",e.startsWith("sk-"),'Must start with "sk-"'),e},locale(e){return e?(G("locale",e,"Cannot be empty"),G("locale",/^[a-z-]+$/i.test(e),"Must be a valid locale (letters and dashes/underscores). You can consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes"),e):"en"},generate(e){if(!e)return 1;G("generate",/^\d+$/.test(e),"Must be an integer");const t=Number(e);return G("generate",t>0,"Must be greater than 0"),G("generate",t<=5,"Must be less or equal to 5"),t},proxy(e){if(!(!e||e.length===0))return G("proxy",/^https?:\/\//.test(e),"Must be a valid URL"),e}},ht=X.join(jt.homedir(),".aicommits"),rn=async()=>{if(!await un(ht))return Object.create(null);const t=await O.readFile(ht,"utf8");return tn.parse(t)},Ft=async e=>{const t=await rn(),n={};for(const u of Object.keys(Se)){const r=Se[u],o=e?.[u]??t[u];n[u]=r(o)}return n},pi=async e=>{const t=await rn();for(const[n,u]of e){if(!nn(Se,n))throw new x(`Invalid config property: ${n}`);const r=Se[n](u);t[n]=r}await O.writeFile(ht,tn.stringify(t),"utf8")};var gt={},ne={},Ci={get exports(){return ne},set exports(e){ne=e}},re={},mi={get exports(){return re},set exports(e){re=e}},Et,on;function hi(){if(on)return Et;on=1;var e=1e3,t=e*60,n=t*60,u=n*24,r=u*7,o=u*365.25;Et=function(f,a){a=a||{};var c=typeof f;if(c==="string"&&f.length>0)return s(f);if(c==="number"&&isFinite(f))return a.long?D(f):i(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function s(f){if(f=String(f),!(f.length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(f);if(a){var c=parseFloat(a[1]),d=(a[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*r;case"days":case"day":case"d":return c*u;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function i(f){var a=Math.abs(f);return a>=u?Math.round(f/u)+"d":a>=n?Math.round(f/n)+"h":a>=t?Math.round(f/t)+"m":a>=e?Math.round(f/e)+"s":f+"ms"}function D(f){var a=Math.abs(f);return a>=u?l(f,a,u,"day"):a>=n?l(f,a,n,"hour"):a>=t?l(f,a,t,"minute"):a>=e?l(f,a,e,"second"):f+" ms"}function l(f,a,c,d){var p=a>=c*1.5;return Math.round(f/c)+" "+d+(p?"s":"")}return Et}var yt,sn;function Dn(){if(sn)return yt;sn=1;function e(t){u.debug=u,u.default=u,u.coerce=l,u.disable=s,u.enable=o,u.enabled=i,u.humanize=hi(),u.destroy=f,Object.keys(t).forEach(a=>{u[a]=t[a]}),u.names=[],u.skips=[],u.formatters={};function n(a){let c=0;for(let d=0;d<a.length;d++)c=(c<<5)-c+a.charCodeAt(d),c|=0;return u.colors[Math.abs(c)%u.colors.length]}u.selectColor=n;function u(a){let c,d=null,p,m;function h(...F){if(!h.enabled)return;const B=h,T=Number(new Date),ae=T-(c||T);B.diff=ae,B.prev=c,B.curr=T,c=T,F[0]=u.coerce(F[0]),typeof F[0]!="string"&&F.unshift("%O");let R=0;F[0]=F[0].replace(/%([a-zA-Z%])/g,(U,yn)=>{if(U==="%%")return"%";R++;const St=u.formatters[yn];if(typeof St=="function"){const bn=F[R];U=St.call(B,bn),F.splice(R,1),R--}return U}),u.formatArgs.call(B,F),(B.log||u.log).apply(B,F)}return h.namespace=a,h.useColors=u.useColors(),h.color=u.selectColor(a),h.extend=r,h.destroy=u.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(p!==u.namespaces&&(p=u.namespaces,m=u.enabled(a)),m),set:F=>{d=F}}),typeof u.init=="function"&&u.init(h),h}function r(a,c){const d=u(this.namespace+(typeof c>"u"?":":c)+a);return d.log=this.log,d}function o(a){u.save(a),u.namespaces=a,u.names=[],u.skips=[];let c;const d=(typeof a=="string"?a:"").split(/[\s,]+/),p=d.length;for(c=0;c<p;c++)d[c]&&(a=d[c].replace(/\*/g,".*?"),a[0]==="-"?u.skips.push(new RegExp("^"+a.slice(1)+"$")):u.names.push(new RegExp("^"+a+"$")))}function s(){const a=[...u.names.map(D),...u.skips.map(D).map(c=>"-"+c)].join(",");return u.enable(""),a}function i(a){if(a[a.length-1]==="*")return!0;let c,d;for(c=0,d=u.skips.length;c<d;c++)if(u.skips[c].test(a))return!1;for(c=0,d=u.names.length;c<d;c++)if(u.names[c].test(a))return!0;return!1}function D(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}function l(a){return a instanceof Error?a.stack||a.message:a}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return u.enable(u.load()),u}return yt=e,yt}var an;function Fi(){return an||(an=1,function(e,t){t.formatArgs=u,t.save=r,t.load=o,t.useColors=n,t.storage=s(),t.destroy=(()=>{let D=!1;return()=>{D||(D=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function u(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;D.splice(1,0,l,"color: inherit");let f=0,a=0;D[0].replace(/%[a-zA-Z%]/g,c=>{c!=="%%"&&(f++,c==="%c"&&(a=f))}),D.splice(a,0,l)}t.log=console.debug||console.log||(()=>{});function r(D){try{D?t.storage.setItem("debug",D):t.storage.removeItem("debug")}catch{}}function o(){let D;try{D=t.storage.getItem("debug")}catch{}return!D&&typeof process<"u"&&"env"in process&&(D=process.env.DEBUG),D}function s(){try{return localStorage}catch{}}e.exports=Dn()(t);const{formatters:i}=e.exports;i.j=function(D){try{return JSON.stringify(D)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}(mi,re)),re}var oe={},gi={get exports(){return oe},set exports(e){oe=e}},bt,cn;function Ei(){return cn||(cn=1,bt=(e,t=process.argv)=>{const n=e.startsWith("-")?"":e.length===1?"-":"--",u=t.indexOf(n+e),r=t.indexOf("--");return u!==-1&&(r===-1||u<r)}),bt}var wt,ln;function yi(){if(ln)return wt;ln=1;const e=jt,t=ce,n=Ei(),{env:u}=process;let r;n("no-color")||n("no-colors")||n("color=false")||n("color=never")?r=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(r=1),"FORCE_COLOR"in u&&(u.FORCE_COLOR==="true"?r=1:u.FORCE_COLOR==="false"?r=0:r=u.FORCE_COLOR.length===0?1:Math.min(parseInt(u.FORCE_COLOR,10),3));function o(D){return D===0?!1:{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function s(D,l){if(r===0)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(D&&!l&&r===void 0)return 0;const f=r||0;if(u.TERM==="dumb")return f;if(process.platform==="win32"){const a=e.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in u)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(a=>a in u)||u.CI_NAME==="codeship"?1:f;if("TEAMCITY_VERSION"in u)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0;if(u.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in u){const a=parseInt((u.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(u.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(u.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(u.TERM)||"COLORTERM"in u?1:f}function i(D){const l=s(D,D&&D.isTTY);return o(l)}return wt={supportsColor:i,stdout:o(s(!0,t.isatty(1))),stderr:o(s(!0,t.isatty(2)))},wt}var fn;function bi(){return fn||(fn=1,function(e,t){const n=ce,u=kt;t.init=f,t.log=i,t.formatArgs=o,t.save=D,t.load=l,t.useColors=r,t.destroy=u.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const c=yi();c&&(c.stderr||c).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(c=>/^debug_/i.test(c)).reduce((c,d)=>{const p=d.substring(6).toLowerCase().replace(/_([a-z])/g,(h,F)=>F.toUpperCase());let m=process.env[d];return/^(yes|on|true|enabled)$/i.test(m)?m=!0:/^(no|off|false|disabled)$/i.test(m)?m=!1:m==="null"?m=null:m=Number(m),c[p]=m,c},{});function r(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)}function o(c){const{namespace:d,useColors:p}=this;if(p){const m=this.color,h="\x1B[3"+(m<8?m:"8;5;"+m),F=` ${h};1m${d} \x1B[0m`;c[0]=F+c[0].split(`
62
+ `).join(`
63
+ `+F),c.push(h+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else c[0]=s()+d+" "+c[0]}function s(){return t.inspectOpts.hideDate?"":new Date().toISOString()+" "}function i(...c){return process.stderr.write(u.format(...c)+`
64
+ `)}function D(c){c?process.env.DEBUG=c:delete process.env.DEBUG}function l(){return process.env.DEBUG}function f(c){c.inspectOpts={};const d=Object.keys(t.inspectOpts);for(let p=0;p<d.length;p++)c.inspectOpts[d[p]]=t.inspectOpts[d[p]]}e.exports=Dn()(t);const{formatters:a}=e.exports;a.o=function(c){return this.inspectOpts.colors=this.useColors,u.inspect(c,this.inspectOpts).split(`
65
+ `).map(d=>d.trim()).join(" ")},a.O=function(c){return this.inspectOpts.colors=this.useColors,u.inspect(c,this.inspectOpts)}}(gi,oe)),oe}(function(e){typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?e.exports=Fi():e.exports=bi()})(Ci);var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});function wi(e){return function(t,n){return new Promise((u,r)=>{e.call(this,t,n,(o,s)=>{o?r(o):u(s)})})}}Bt.default=wi;var dn=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const Bi=Rt,$i=dn(ne),vi=dn(Bt),se=$i.default("agent-base");function Ai(e){return Boolean(e)&&typeof e.addRequest=="function"}function $t(){const{stack:e}=new Error;return typeof e!="string"?!1:e.split(`
66
+ `).some(t=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function Oe(e,t){return new Oe.Agent(e,t)}(function(e){class t extends Bi.EventEmitter{constructor(u,r){super();let o=r;typeof u=="function"?this.callback=u:u&&(o=u),this.timeout=null,o&&typeof o.timeout=="number"&&(this.timeout=o.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:$t()?443:80}set defaultPort(u){this.explicitDefaultPort=u}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:$t()?"https:":"http:"}set protocol(u){this.explicitProtocol=u}callback(u,r,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(u,r){const o=Object.assign({},r);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=$t()),o.host==null&&(o.host="localhost"),o.port==null&&(o.port=o.secureEndpoint?443:80),o.protocol==null&&(o.protocol=o.secureEndpoint?"https:":"http:"),o.host&&o.path&&delete o.path,delete o.agent,delete o.hostname,delete o._defaultAgent,delete o.defaultPort,delete o.createConnection,u._last=!0,u.shouldKeepAlive=!1;let s=!1,i=null;const D=o.timeout||this.timeout,l=d=>{u._hadError||(u.emit("error",d),u._hadError=!0)},f=()=>{i=null,s=!0;const d=new Error(`A "socket" was not created for HTTP request before ${D}ms`);d.code="ETIMEOUT",l(d)},a=d=>{s||(i!==null&&(clearTimeout(i),i=null),l(d))},c=d=>{if(s)return;if(i!=null&&(clearTimeout(i),i=null),Ai(d)){se("Callback returned another Agent instance %o",d.constructor.name),d.addRequest(u,o);return}if(d){d.once("free",()=>{this.freeSocket(d,o)}),u.onSocket(d);return}const p=new Error(`no Duplex stream was returned to agent-base for \`${u.method} ${u.path}\``);l(p)};if(typeof this.callback!="function"){l(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(se("Converting legacy callback function to promise"),this.promisifiedCallback=vi.default(this.callback)):this.promisifiedCallback=this.callback),typeof D=="number"&&D>0&&(i=setTimeout(f,D)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{se("Resolving socket for %o request: %o",o.protocol,`${u.method} ${u.path}`),Promise.resolve(this.promisifiedCallback(u,o)).then(c,a)}catch(d){Promise.reject(d).catch(a)}}freeSocket(u,r){se("Freeing socket %o %o",u.constructor.name,r),u.destroy()}destroy(){se("Destroying agent %o",this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype})(Oe||(Oe={}));var xi=Oe,vt={},Si=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vt,"__esModule",{value:!0});const Oi=Si(ne),ie=Oi.default("https-proxy-agent:parse-proxy-response");function Ii(e){return new Promise((t,n)=>{let u=0;const r=[];function o(){const a=e.read();a?f(a):e.once("readable",o)}function s(){e.removeListener("end",D),e.removeListener("error",l),e.removeListener("close",i),e.removeListener("readable",o)}function i(a){ie("onclose had error %o",a)}function D(){ie("onend")}function l(a){s(),ie("onerror %o",a),n(a)}function f(a){r.push(a),u+=a.length;const c=Buffer.concat(r,u);if(c.indexOf(`\r
67
+ \r
68
+ `)===-1){ie("have not received end of HTTP headers yet..."),o();return}const p=c.toString("ascii",0,c.indexOf(`\r
69
+ `)),m=+p.split(" ")[1];ie("got proxy server response: %o",p),t({statusCode:m,buffered:c})}e.on("error",l),e.on("close",i),e.on("end",D),o()})}vt.default=Ii;var Ti=w&&w.__awaiter||function(e,t,n,u){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function i(f){try{l(u.next(f))}catch(a){s(a)}}function D(f){try{l(u.throw(f))}catch(a){s(a)}}function l(f){f.done?o(f.value):r(f.value).then(i,D)}l((u=u.apply(e,t||[])).next())})},J=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gt,"__esModule",{value:!0});const pn=J(In),Cn=J(Tn),Pi=J(Pn),_i=J(_t),Ri=J(ne),ki=xi,Mi=J(vt),De=Ri.default("https-proxy-agent:agent");class ji extends ki.Agent{constructor(t){let n;if(typeof t=="string"?n=Pi.default.parse(t):n=t,!n)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");De("creating new HttpsProxyAgent instance: %o",n),super(n);const u=Object.assign({},n);this.secureProxy=n.secureProxy||Gi(u.protocol),u.host=u.hostname||u.host,typeof u.port=="string"&&(u.port=parseInt(u.port,10)),!u.port&&u.host&&(u.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in u)&&(u.ALPNProtocols=["http 1.1"]),u.host&&u.path&&(delete u.path,delete u.pathname),this.proxy=u}callback(t,n){return Ti(this,void 0,void 0,function*(){const{proxy:u,secureProxy:r}=this;let o;r?(De("Creating `tls.Socket`: %o",u),o=Cn.default.connect(u)):(De("Creating `net.Socket`: %o",u),o=pn.default.connect(u));const s=Object.assign({},u.headers);let D=`CONNECT ${`${n.host}:${n.port}`} HTTP/1.1\r
70
+ `;u.auth&&(s["Proxy-Authorization"]=`Basic ${Buffer.from(u.auth).toString("base64")}`);let{host:l,port:f,secureEndpoint:a}=n;Ni(f,a)||(l+=`:${f}`),s.Host=l,s.Connection="close";for(const h of Object.keys(s))D+=`${h}: ${s[h]}\r
71
+ `;const c=Mi.default(o);o.write(`${D}\r
72
+ `);const{statusCode:d,buffered:p}=yield c;if(d===200){if(t.once("socket",Li),n.secureEndpoint){De("Upgrading socket connection to TLS");const h=n.servername||n.host;return Cn.default.connect(Object.assign(Object.assign({},Ui(n,"host","hostname","path","port")),{socket:o,servername:h}))}return o}o.destroy();const m=new pn.default.Socket({writable:!1});return m.readable=!0,t.once("socket",h=>{De("replaying proxy buffer for failed request"),_i.default(h.listenerCount("data")>0),h.push(p),h.push(null)}),m})}}gt.default=ji;function Li(e){e.resume()}function Ni(e,t){return Boolean(!t&&e===80||t&&e===443)}function Gi(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function Ui(e,...t){const n={};let u;for(u in e)t.includes(u)||(n[u]=e[u]);return n}var Wi=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const At=Wi(gt);function xt(e){return new At.default(e)}(function(e){e.HttpsProxyAgent=At.default,e.prototype=At.default.prototype})(xt||(xt={}));var qi=xt;const Hi=async(e,t,n,u,r)=>new Promise((o,s)=>{const i=JSON.stringify(u),D=Sn.request({port:443,hostname:e,path:t,method:"POST",headers:{...n,"Content-Type":"application/json","Content-Length":Buffer.byteLength(i)},timeout:1e4,agent:r?qi(r):void 0},l=>{const f=[];l.on("data",a=>f.push(a)),l.on("end",()=>{o({request:D,response:l,data:Buffer.concat(f).toString()})})});D.on("error",s),D.on("timeout",()=>{D.destroy(),s(new x("Request timed out"))}),D.write(i),D.end()}),zi=async(e,t,n)=>{const{response:u,data:r}=await Hi("api.openai.com","/v1/chat/completions",{Authorization:`Bearer ${e}`},t,n);if(!u.statusCode||u.statusCode<200||u.statusCode>299){let o=`OpenAI API Error: ${u.statusCode} - ${u.statusMessage}`;throw r&&(o+=`
62
73
 
63
- ${n}`),t.statusCode===500&&(D+=`
74
+ ${r}`),u.statusCode===500&&(o+=`
64
75
 
65
- Check the API status: https://status.openai.com`),new $(D)}return JSON.parse(n)},ki=e=>e.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1"),Ri=e=>Array.from(new Set(e)),_i=(e,u)=>`Write an insightful but concise Git commit message in a complete sentence in present tense for the following diff without prefacing it with anything, the response must be in the language ${e}:
66
- ${u}`,ji="gpt-3.5-turbo",Ni=Jt("text-davinci-003"),Rt=async(e,u,t,n)=>{const D=_i(u,t);if(Ni.encode(D).length>4e3)throw new $("The diff is too large for the OpenAI API. Try reducing the number of staged changes, or write your own commit message.");try{const r=await Pi(e,{model:ji,messages:[{role:"user",content:D}],temperature:.7,top_p:1,frequency_penalty:0,presence_penalty:0,max_tokens:200,stream:!1,n});return Ri(r.choices.filter(i=>i.message?.content).map(i=>ki(i.message.content)))}catch(r){const i=r;throw i.code==="ENOTFOUND"?new $(`Error connecting to ${i.hostname} (${i.syscall}). Are you connected to the internet?`):i}};var Li=async(e,u)=>(async()=>{yt(Ft(pt(" aicommits "))),await $t();const t=eu();t.start("Detecting staged files");const n=await vt();if(!n)throw new $("No staged changes found. Make sure to stage your changes with `git add`.");t.stop(`${Si(n.files)}:
67
- ${n.files.map(s=>` ${s}`).join(`
68
- `)}`);const D=await ru({OPENAI_KEY:process.env.OPENAI_KEY??process.env.OPENAI_API_KEY,generate:e?.toString()}),r=eu();r.start("The AI is analyzing your changes");const i=await Rt(D.OPENAI_KEY,D.locale,n.diff,D.generate);if(r.stop("Changes analyzed"),i.length===0)throw new $("No commit messages were generated. Try again.");let o;if(i.length===1){[o]=i;const s=await vi({message:`Use this commit message?
76
+ Check the API status: https://status.openai.com`),new x(o)}return JSON.parse(r)},Ki=e=>e.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1"),Vi=e=>Array.from(new Set(e)),Yi=(e,t)=>`Write an insightful but concise Git commit message in a complete sentence in present tense for the following diff without prefacing it with anything, the response must be in the language ${e}:
77
+ ${t}`,mn="gpt-3.5-turbo",hn=async(e,t,n,u,r)=>{const o=Yi(t,n);if(On(mn).encode(o).length>4e3)throw new x("The diff is too large for the OpenAI API. Try reducing the number of staged changes, or write your own commit message.");try{const s=await zi(e,{model:mn,messages:[{role:"user",content:o}],temperature:.7,top_p:1,frequency_penalty:0,presence_penalty:0,max_tokens:200,stream:!1,n:u},r);return Vi(s.choices.filter(i=>i.message?.content).map(i=>Ki(i.message.content)))}catch(s){const i=s;throw i.code==="ENOTFOUND"?new x(`Error connecting to ${i.hostname} (${i.syscall}). Are you connected to the internet?`):i}};var Ji=async(e,t,n)=>(async()=>{Ku(ju(Mu(" aicommits "))),await Vu();const u=dt();u.start("Detecting staged files");const r=await Xu(t);if(!r)throw u.stop("Detecting staged files"),new x("No staged changes found. Make sure to stage your changes with `git add`.");u.stop(`${fi(r.files)}:
78
+ ${r.files.map(f=>` ${f}`).join(`
79
+ `)}`);const{env:o}=process,s=await Ft({OPENAI_KEY:o.OPENAI_KEY||o.OPENAI_API_KEY,proxy:o.https_proxy||o.HTTPS_PROXY||o.http_proxy||o.HTTP_PROXY,generate:e?.toString()}),i=dt();i.start("The AI is analyzing your changes");let D;try{D=await hn(s.OPENAI_KEY,s.locale,r.diff,s.generate,s.proxy)}finally{i.stop("Changes analyzed")}if(D.length===0)throw new x("No commit messages were generated. Try again.");let l;if(D.length===1){[l]=D;const f=await ci({message:`Use this commit message?
69
80
 
70
- ${o}
71
- `});if(!s||Et(s)){K("Commit cancelled");return}}else{const s=await xi({message:`Pick a commit message to use: ${ze("(Ctrl+c to exit)")}`,options:i.map(a=>({label:a,value:a}))});if(Et(s)){K("Commit cancelled");return}o=s}await le("git",["commit","-m",o,...u]),K(`${de("\u2714")} Successfully committed!`)})().catch(t=>{K(`${fe("\u2716")} ${t.message}`),Fe(t),process.exit(1)});const[_t,Mi]=process.argv.slice(2);var Gi=()=>(async()=>{if(!_t)throw new $('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(Mi)return;const e=await vt();if(!e)return;yt(Ft(pt(" aicommits ")));const u=await ru(),t=eu();t.start("The AI is analyzing your changes");const n=await Rt(u.OPENAI_KEY,u.locale,e.diff,u.generate);t.stop("Changes analyzed");const D=n.length>1;let r=`# \u{1F916} AI generated commit${D?"s":""}
72
- `;D?(r+=`# Select one of the following messages by uncommeting:
73
- `,r+=`
74
- ${n.map(i=>`# ${i}`).join(`
75
- `)}`):(r+=`# Edit the message below and commit:
76
- `,r+=`
77
- ${n[0]}
78
- `),await v.appendFile(_t,r),K(`${de("\u2714")} Saved commit message!`)})().catch(e=>{K(`${fe("\u2716")} ${e.message}`),Fe(e),process.exit(1)}),Ui=_u({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:u,keyValue:t}=e._;if(u==="get"){const n=await ru();for(const D of t)Pt(n,D)&&console.log(`${D}=${n[D]}`);return}if(u==="set"){await Ii(t.map(n=>n.split("=")));return}throw new $(`Invalid mode: ${u}`)})().catch(u=>{console.error(`${fe("\u2716")} ${u.message}`),Fe(u),process.exit(1)})});const jt="prepare-commit-msg",T=`.git/hooks/${jt}`,Wi=process.argv[1].endsWith(`/${T}`);var Ki=_u({name:"hook",parameters:["<install/uninstall>"]},e=>{const u=Xt(new URL("cli.mjs",import.meta.url));(async()=>{await $t();const{installUninstall:t}=e._,n=await Tt(T);if(t==="install"){if(n){if(await v.realpath(T).catch(()=>{})===u){console.warn("The hook is already installed");return}throw new $(`A different ${jt} hook seems to be installed. Please remove it before installing aicommits.`)}await v.mkdir(V.dirname(T),{recursive:!0}),await v.symlink(u,T,"file"),await v.chmod(T,493),console.log(`${de("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!n){console.warn("Hook is not installed");return}if(await v.realpath(T)!==u){console.warn("Hook is not installed");return}await v.rm(T),console.log(`${de("\u2714")} Hook uninstalled`);return}throw new $(`Invalid mode: ${t}`)})().catch(t=>{console.error(`${fe("\u2716")} ${t.message}`),Fe(t),process.exit(1)})});const Nt=process.argv.slice(2);CD({name:"aicommits",version:ju,flags:{generate:{type:Number,description:"Number of messages to generate. (Warning: generating multiple costs more) (default: 1)",alias:"g"}},commands:[Ui,Ki],help:{description:hD},ignoreArgv:e=>e==="unknown-flag"||e==="argument"},e=>{Wi?Gi():Li(e.flags.generate,Nt)},Nt);
81
+ ${l}
82
+ `});if(!f||Uu(f)){V("Commit cancelled");return}}else{const f=await li({message:`Pick a commit message to use: ${ot("(Ctrl+c to exit)")}`,options:D.map(a=>({label:a,value:a}))});if(Uu(f)){V("Commit cancelled");return}l=f}await be("git",["commit","-m",l,...n]),V(`${Be("\u2714")} Successfully committed!`)})().catch(u=>{V(`${we("\u2716")} ${u.message}`),ve(u),process.exit(1)});const[Fn,Xi]=process.argv.slice(2);var Zi=()=>(async()=>{if(!Fn)throw new x('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(Xi)return;const e=await Xu();if(!e)return;Ku(ju(Mu(" aicommits ")));const{env:t}=process,n=await Ft({proxy:t.https_proxy||t.HTTPS_PROXY||t.http_proxy||t.HTTP_PROXY}),u=dt();u.start("The AI is analyzing your changes");let r;try{r=await hn(n.OPENAI_KEY,n.locale,e.diff,n.generate,n.proxy)}finally{u.stop("Changes analyzed")}const o=r.length>1;let s=`# \u{1F916} AI generated commit${o?"s":""}
83
+ `;o?(s+=`# Select one of the following messages by uncommeting:
84
+ `,s+=`
85
+ ${r.map(i=>`# ${i}`).join(`
86
+ `)}`):(s+=`# Edit the message below and commit:
87
+ `,s+=`
88
+ ${r[0]}
89
+ `),await O.appendFile(Fn,s),V(`${Be("\u2714")} Saved commit message!`)})().catch(e=>{V(`${we("\u2716")} ${e.message}`),ve(e),process.exit(1)}),Qi=ou({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:t,keyValue:n}=e._;if(t==="get"){const u=await Ft();for(const r of n)nn(u,r)&&console.log(`${r}=${u[r]}`);return}if(t==="set"){await pi(n.map(u=>u.split("=")));return}throw new x(`Invalid mode: ${t}`)})().catch(t=>{console.error(`${we("\u2716")} ${t.message}`),ve(t),process.exit(1)})});const gn="prepare-commit-msg",_=`.git/hooks/${gn}`,eD=process.argv[1].endsWith(`/${_}`);var tD=ou({name:"hook",parameters:["<install/uninstall>"]},e=>{const t=_n(new URL("cli.mjs",import.meta.url));(async()=>{await Vu();const{installUninstall:n}=e._,u=await un(_);if(n==="install"){if(u){if(await O.realpath(_).catch(()=>{})===t){console.warn("The hook is already installed");return}throw new x(`A different ${gn} hook seems to be installed. Please remove it before installing aicommits.`)}await O.mkdir(X.dirname(_),{recursive:!0}),await O.symlink(t,_,"file"),await O.chmod(_,493),console.log(`${Be("\u2714")} Hook installed`);return}if(n==="uninstall"){if(!u){console.warn("Hook is not installed");return}if(await O.realpath(_)!==t){console.warn("Hook is not installed");return}await O.rm(_),console.log(`${Be("\u2714")} Hook uninstalled`);return}throw new x(`Invalid mode: ${n}`)})().catch(n=>{console.error(`${we("\u2716")} ${n.message}`),ve(n),process.exit(1)})});const En=process.argv.slice(2);Qr({name:"aicommits",version:su,flags:{generate:{type:Number,description:"Number of messages to generate (Warning: generating multiple costs more) (default: 1)",alias:"g"},exclude:{type:[String],description:"Files to exclude from AI analysis",alias:"x"}},commands:[Qi,tD],help:{description:eo},ignoreArgv:e=>e==="unknown-flag"||e==="argument"},e=>{eD?Zi():Ji(e.flags.generate,e.flags.exclude,En)},En);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aicommits",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Writes your git commit messages for you with AI",
5
5
  "keywords": [
6
6
  "ai",
@@ -19,6 +19,6 @@
19
19
  "aic": "./dist/cli.mjs"
20
20
  },
21
21
  "dependencies": {
22
- "@dqbd/tiktoken": "^0.4.0"
22
+ "@dqbd/tiktoken": "^1.0.2"
23
23
  }
24
24
  }