aicommits 1.8.0 → 1.8.2
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.
- package/README.md +3 -0
- package/dist/cli.mjs +67 -64
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -186,6 +186,9 @@ Default: `gpt-3.5-turbo`
|
|
|
186
186
|
|
|
187
187
|
The Chat Completions (`/v1/chat/completions`) model to use. Consult the list of models available in the [OpenAI Documentation](https://platform.openai.com/docs/models/model-endpoint-compatibility).
|
|
188
188
|
|
|
189
|
+
> Tip: If you have access, try upgrading to [`gpt-4`](https://platform.openai.com/docs/models/gpt-4) for next-level code analysis. It can handle double the input size, but comes at a higher cost. Check out OpenAI's website to learn more.
|
|
190
|
+
|
|
191
|
+
|
|
189
192
|
## How it works
|
|
190
193
|
|
|
191
194
|
This CLI tool runs `git diff` to grab all your latest code changes, sends them to OpenAI's GPT-3, then returns the AI generated commit message.
|
package/dist/cli.mjs
CHANGED
|
@@ -1,89 +1,92 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import le from"tty";import{Buffer as bn}from"node:buffer";import W from"node:path";import It from"node:child_process";import b,{stdin as Tt,stdout as Pt}from"node:process";import wn from"child_process";import X from"path";import Te from"fs";import Bn from"node:url";import $n,{constants as _t}from"node:os";import Rt from"assert";import kt from"events";import vn from"buffer";import Pe from"stream";import Mt from"util";import*as fe from"node:readline";import jt from"node:readline";import{WriteStream as An}from"node:tty";import O from"fs/promises";import Lt from"os";import xn from"https";import{encoding_for_model as Sn}from"@dqbd/tiktoken";import On from"net";import In from"tls";import Tn,{fileURLToPath as Pn}from"url";const _n="known-flag",Rn="unknown-flag",kn="argument",{stringify:Z}=JSON,Mn=/\B([A-Z])/g,jn=e=>e.replace(Mn,"-$1").toLowerCase(),{hasOwnProperty:Ln}=Object.prototype,Q=(e,t)=>Ln.call(e,t),Nn=e=>Array.isArray(e),Nt=e=>typeof e=="function"?[e,!1]:Nn(e)?[e[0],!0]:Nt(e.type),Gn=(e,t)=>e===Boolean?t!=="false":t,Un=(e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),Wn=/[\s.:=]/,qn=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(Wn);if(n)throw new Error(`${t} cannot contain ${Z(n?.[0])}`)},Hn=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;qn(u);const r=e[u],o=[[],...Nt(r),r];n(u,o);const s=jn(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},zn=(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},de="--",Kn=/[.:=]/,Vn=/^-{1,2}\w/,Yn=e=>{if(!Vn.test(e))return;const t=!e.startsWith(de);let n=e.slice(t?1:2),u;const r=n.match(Kn);if(r){const{index:o}=r;u=n.slice(o+1),n=n.slice(0,o)}return[n,u,t]},Jn=(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===de){r();const D=e.slice(o+1);n?.(D,[o],!0);break}const i=Yn(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()},Xn=(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)}},Zn=(e,t=process.argv.slice(2),{ignore:n}={})=>{const u=[],r=Hn(e),o={},s=[];return s[de]=[],Jn(t,{onFlag(i,D,l){const f=Q(r,i);if(!n?.(f?_n:Rn,i,D)){if(f){const[a,c]=r[i],d=Gn(c,D),p=(m,h)=>{u.push(l),h&&u.push(h),a.push(Un(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?.(kn,t[D[0]])||(s.push(...i),l?(s[de]=i,t.splice(D[0])):u.push(D))}}),Xn(t,u),{flags:zn(e,r),unknownFlags:o,_:s}};var Qn=Object.create,pe=Object.defineProperty,er=Object.defineProperties,tr=Object.getOwnPropertyDescriptor,ur=Object.getOwnPropertyDescriptors,nr=Object.getOwnPropertyNames,Gt=Object.getOwnPropertySymbols,rr=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty,or=Object.prototype.propertyIsEnumerable,Wt=(e,t,n)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ce=(e,t)=>{for(var n in t||(t={}))Ut.call(t,n)&&Wt(e,n,t[n]);if(Gt)for(var n of Gt(t))or.call(t,n)&&Wt(e,n,t[n]);return e},_e=(e,t)=>er(e,ur(t)),sr=e=>pe(e,"__esModule",{value:!0}),ir=(e,t)=>()=>(e&&(t=e(e=0)),t),Dr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ar=(e,t,n,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of nr(t))!Ut.call(e,r)&&(n||r!=="default")&&pe(e,r,{get:()=>t[r],enumerable:!(u=tr(t,r))||u.enumerable});return e},cr=(e,t)=>ar(sr(pe(e!=null?Qn(rr(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),A=ir(()=>{}),lr=Dr((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 fr=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 dr({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 qt(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(dr(),"")}A();function pr(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 Cr=cr(lr(),1);function k(e){if(typeof e!="string"||e.length===0||(e=qt(e),e.length===0))return 0;e=e.replace((0,Cr.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+=pr(u)?2:1)}return t}var Ht=e=>Math.max(...e.split(`
|
|
3
|
-
`).map(k)),
|
|
4
|
-
`)];for(let[l,f]of
|
|
5
|
-
`?(o&&(u+=
|
|
6
|
-
`&&(r&&a&&(u+=
|
|
2
|
+
import le from"tty";import{Buffer as $n}from"node:buffer";import W from"node:path";import Pt from"node:child_process";import b,{stdin as _t,stdout as Rt}from"node:process";import vn from"child_process";import X from"path";import Pe from"fs";import An from"node:url";import xn,{constants as kt}from"node:os";import Mt from"assert";import jt from"events";import Sn from"buffer";import _e from"stream";import Lt from"util";import*as fe from"node:readline";import Nt from"node:readline";import{WriteStream as On}from"node:tty";import O from"fs/promises";import Gt from"os";import In from"https";import Tn from"net";import Pn from"tls";import _n,{fileURLToPath as Rn,pathToFileURL as kn}from"url";const Mn="known-flag",jn="unknown-flag",Ln="argument",{stringify:Z}=JSON,Nn=/\B([A-Z])/g,Gn=e=>e.replace(Nn,"-$1").toLowerCase(),{hasOwnProperty:Un}=Object.prototype,Q=(e,t)=>Un.call(e,t),Wn=e=>Array.isArray(e),Ut=e=>typeof e=="function"?[e,!1]:Wn(e)?[e[0],!0]:Ut(e.type),Hn=(e,t)=>e===Boolean?t!=="false":t,qn=(e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),zn=/[\s.:=]/,Kn=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(zn);if(n)throw new Error(`${t} cannot contain ${Z(n?.[0])}`)},Vn=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;Kn(u);const r=e[u],o=[[],...Ut(r),r];n(u,o);const s=Gn(u);if(u!==s&&n(s,o),"alias"in r&&typeof r.alias=="string"){const{alias:D}=r,i=`Flag alias ${Z(D)} for flag ${Z(u)}`;if(D.length===0)throw new Error(`${i} cannot be empty`);if(D.length>1)throw new Error(`${i} must be a single character`);n(D,o)}}return t},Yn=(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:D}=s;typeof D=="function"&&(D=D()),n[u]=D}else n[u]=o?r:r.pop()}return n},de="--",Jn=/[.:=]/,Xn=/^-{1,2}\w/,Zn=e=>{if(!Xn.test(e))return;const t=!e.startsWith(de);let n=e.slice(t?1:2),u;const r=n.match(Jn);if(r){const{index:o}=r;u=n.slice(o+1),n=n.slice(0,o)}return[n,u,t]},Qn=(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===de){r();const i=e.slice(o+1);n?.(i,[o],!0);break}const D=Zn(s);if(D){if(r(),!t)continue;const[i,l,f]=D;if(f)for(let a=0;a<i.length;a+=1){r();const c=a===i.length-1;u=t(i[a],c?l:void 0,[o,a+1,c])}else u=t(i,l,[o])}else r(s,[o])&&n?.([s],[o])}r()},er=(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)}},tr=(e,t=process.argv.slice(2),{ignore:n}={})=>{const u=[],r=Vn(e),o={},s=[];return s[de]=[],Qn(t,{onFlag(D,i,l){const f=Q(r,D);if(!n?.(f?Mn:jn,D,i)){if(f){const[a,c]=r[D],d=Hn(c,i),p=(m,h)=>{u.push(l),h&&u.push(h),a.push(qn(c,m||""))};return d===void 0?p:p(d)}Q(o,D)||(o[D]=[]),o[D].push(i===void 0?!0:i),u.push(l)}},onArgument(D,i,l){n?.(Ln,t[i[0]])||(s.push(...D),l?(s[de]=D,t.splice(i[0])):u.push(i))}}),er(t,u),{flags:Yn(e,r),unknownFlags:o,_:s}};var ur=Object.create,pe=Object.defineProperty,nr=Object.defineProperties,rr=Object.getOwnPropertyDescriptor,or=Object.getOwnPropertyDescriptors,sr=Object.getOwnPropertyNames,Wt=Object.getOwnPropertySymbols,ir=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty,Dr=Object.prototype.propertyIsEnumerable,qt=(e,t,n)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ce=(e,t)=>{for(var n in t||(t={}))Ht.call(t,n)&&qt(e,n,t[n]);if(Wt)for(var n of Wt(t))Dr.call(t,n)&&qt(e,n,t[n]);return e},Re=(e,t)=>nr(e,or(t)),ar=e=>pe(e,"__esModule",{value:!0}),cr=(e,t)=>()=>(e&&(t=e(e=0)),t),lr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fr=(e,t,n,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of sr(t))!Ht.call(e,r)&&(n||r!=="default")&&pe(e,r,{get:()=>t[r],enumerable:!(u=rr(t,r))||u.enumerable});return e},dr=(e,t)=>fr(ar(pe(e!=null?ur(ir(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),A=cr(()=>{}),pr=lr((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 Cr=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 mr({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 zt(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(mr(),"")}A();function hr(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 Fr=dr(pr(),1);function k(e){if(typeof e!="string"||e.length===0||(e=zt(e),e.length===0))return 0;e=e.replace((0,Fr.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+=hr(u)?2:1)}return t}var Kt=e=>Math.max(...e.split(`
|
|
3
|
+
`).map(k)),gr=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=Kt(n[o]);s>t[o]&&(t[o]=s)}}return t};A();var Vt=/^\d+%$/,Yt={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Er=(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"&&Vt.test(o)){u.push(Re(Ce({},Yt),{width:o,contentWidth:e[r]}));continue}if(o&&typeof o=="object"){let s=Re(Ce(Ce({},Yt),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 yr(e,t){for(let n of e){let{width:u}=n;if(u==="content-width"&&(n.width=n.contentWidth),u==="auto"){let i=Math.min(20,n.contentWidth);n.width=i,n.autoOverflow=n.contentWidth-i}if(typeof u=="string"&&Vt.test(u)){let i=Number.parseFloat(u.slice(0,-1))/100;n.width=Math.floor(t*i)-(n.paddingLeft+n.paddingRight)}let{horizontalPadding:r}=n,o=1,s=o+r;if(s>=t){let i=s-t,l=Math.ceil(n.paddingLeft/r*i),f=i-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 D=t-n.horizontalPadding;n.width=Math.max(Math.min(n.width,D),o)}}var Jt=()=>Object.assign([],{columns:0});function br(e,t){let n=[Jt()],[u]=n;for(let r of e){let o=r.width+r.horizontalPadding;u.columns+o>t&&(u=Jt(),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 D=r.filter(c=>"autoOverflow"in c),i=D.filter(c=>c.autoOverflow>0),l=i.reduce((c,d)=>c+d.autoOverflow,0),f=Math.min(l,s);for(let c of i){let d=Math.floor(c.autoOverflow/l*f);c.width+=d,s-=d}let a=Math.floor(s/D.length);for(let c=0;c<D.length;c+=1){let d=D[c];c===D.length-1?d.width+=s:d.width+=a,s-=a}}return n}function wr(e,t,n){let u=Er(n,t);return yr(u,e),br(u,e)}A(),A(),A();var ke=10,Xt=(e=0)=>t=>`\x1B[${t+e}m`,Zt=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Qt=(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=Xt(),t.color.ansi256=Zt(),t.color.ansi16m=Qt(),t.bgColor.ansi=Xt(ke),t.bgColor.ansi256=Zt(ke),t.bgColor.ansi16m=Qt(ke),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 i=n%36;u=Math.floor(n/36)/5,r=Math.floor(i/6)/5,o=i%6/5}let s=Math.max(u,r,o)*2;if(s===0)return 30;let D=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(u));return s===2&&(D+=60),D},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 $r=Br(),vr=$r,me=new Set(["\x1B","\x9B"]),Ar=39,Me="\x07",eu="[",xr="]",tu="m",je=`${xr}8;;`,uu=e=>`${me.values().next().value}${eu}${e}${tu}`,nu=e=>`${me.values().next().value}${je}${e}${Me}`,Sr=e=>e.split(" ").map(t=>k(t)),Le=(e,t,n)=>{let u=[...t],r=!1,o=!1,s=k(zt(e[e.length-1]));for(let[D,i]of u.entries()){let l=k(i);if(s+l<=n?e[e.length-1]+=i:(e.push(i),s=0),me.has(i)&&(r=!0,o=u.slice(D+1).join("").startsWith(je)),r){o?i===Me&&(r=!1,o=!1):i===tu&&(r=!1);continue}s+=l,s===n&&D<u.length-1&&(e.push(""),s=0)}!s&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Or=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("")},Ir=(e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let u="",r,o,s=Sr(e),D=[""];for(let[l,f]of e.split(" ").entries()){n.trim!==!1&&(D[D.length-1]=D[D.length-1].trimStart());let a=k(D[D.length-1]);if(l!==0&&(a>=t&&(n.wordWrap===!1||n.trim===!1)&&(D.push(""),a=0),(a>0||n.trim===!1)&&(D[D.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&&D.push(""),Le(D,f,t);continue}if(a+s[l]>t&&a>0&&s[l]>0){if(n.wordWrap===!1&&a<t){Le(D,f,t);continue}D.push("")}if(a+s[l]>t&&n.wordWrap===!1){Le(D,f,t);continue}D[D.length-1]+=f}n.trim!==!1&&(D=D.map(l=>Or(l)));let i=[...D.join(`
|
|
4
|
+
`)];for(let[l,f]of i.entries()){if(u+=f,me.has(f)){let{groups:c}=new RegExp(`(?:\\${eu}(?<code>\\d+)m|\\${je}(?<uri>.*)${Me})`).exec(i.slice(l).join(""))||{groups:{}};if(c.code!==void 0){let d=Number.parseFloat(c.code);r=d===Ar?void 0:d}else c.uri!==void 0&&(o=c.uri.length===0?void 0:c.uri)}let a=vr.codes.get(Number(r));i[l+1]===`
|
|
5
|
+
`?(o&&(u+=nu("")),r&&a&&(u+=uu(a))):f===`
|
|
6
|
+
`&&(r&&a&&(u+=uu(r)),o&&(u+=nu(o)))}return u};function Tr(e,t,n){return String(e).normalize().replace(/\r\n/g,`
|
|
7
7
|
`).split(`
|
|
8
|
-
`).map(u=>
|
|
9
|
-
`)}var
|
|
10
|
-
`);if(
|
|
8
|
+
`).map(u=>Ir(u,t,n)).join(`
|
|
9
|
+
`)}var ru=e=>Array.from({length:e}).fill("");function Pr(e,t){let n=[],u=0;for(let r of e){let o=0,s=r.map(i=>{var l;let f=(l=t[u])!=null?l:"";u+=1,i.preprocess&&(f=i.preprocess(f)),Kt(f)>i.width&&(f=Tr(f,i.width,{hard:!0}));let a=f.split(`
|
|
10
|
+
`);if(i.postprocess){let{postprocess:c}=i;a=a.map((d,p)=>c.call(i,d,p))}return i.paddingTop&&a.unshift(...ru(i.paddingTop)),i.paddingBottom&&a.push(...ru(i.paddingBottom)),a.length>o&&(o=a.length),Re(Ce({},i),{lines:a})}),D=[];for(let i=0;i<o;i+=1){let l=s.map(f=>{var a;let c=(a=f.lines[i])!=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("");D.push(l)}n.push(D.join(`
|
|
11
11
|
`))}return n.join(`
|
|
12
|
-
`)}function
|
|
13
|
-
`)}A();var
|
|
14
|
-
`}}function
|
|
15
|
-
`}}function
|
|
16
|
-
`):t.usage}}:void 0;if(e.name){const n=[],u=[
|
|
17
|
-
`)}}}}function
|
|
18
|
-
`)),n)return{id:"examples",type:"section",data:{title:"Examples:",body:n}}}function
|
|
12
|
+
`)}function _r(e,t){if(!e||e.length===0)return"";let n=gr(e),u=n.length;if(u===0)return"";let{stdoutColumns:r,columns:o}=Cr(t);if(o.length>u)throw new Error(`${o.length} columns defined, but only ${u} columns found`);let s=wr(r,o,n);return e.map(D=>Pr(s,D)).join(`
|
|
13
|
+
`)}A();var Rr=["<",">","=",">=","<="];function kr(e){if(!Rr.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function Mr(e){let t=Object.keys(e).map(n=>{let[u,r]=n.split(" ");kr(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 jr=e=>e.replace(/[\W_]([a-z\d])?/gi,(t,n)=>n?n.toUpperCase():""),Lr=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),Nr={"> 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 Gr(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:`--${Lr(n)}`,aliasesEnabled:t,aliasFormatted:r?`-${u.alias}`:void 0}}).map(n=>(n.aliasesEnabled=t,[{type:"flagName",data:n},{type:"flagDescription",data:n}])),tableBreakpoints:Nr}}}const ou=e=>!e||(e.version??(e.help?e.help.version:void 0)),su=e=>{const t="parent"in e&&e.parent?.name;return(t?`${t} `:"")+e.name};function Ur(e){const t=[];e.name&&t.push(su(e));const n=ou(e)??("parent"in e&&ou(e.parent));if(n&&t.push(`v${n}`),t.length!==0)return{id:"name",type:"text",data:`${t.join(" ")}
|
|
14
|
+
`}}function Wr(e){const{help:t}=e;if(!(!t||!t.description))return{id:"description",type:"text",data:`${t.description}
|
|
15
|
+
`}}function Hr(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=[su(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(D=>D.startsWith("<"));u.push(r.map(D=>D!=="--"?D: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 qr(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 zr(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:Gr(e.flags),indentBody:0}}}function Kr(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 Vr(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 Yr=e=>[Ur,Wr,Hr,qr,zr,Kr,Vr].map(t=>t(e)).filter(Boolean),Jr=le.WriteStream.prototype.hasColors();class Xr{text(t){return t}bold(t){return Jr?`\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
19
|
`:"")+(n?this.indentText({text:this.render(n),spaces:u}):"")}
|
|
20
|
-
`}table({tableData:t,tableOptions:n,tableBreakpoints:u}){return
|
|
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
|
|
22
|
-
`),u(),process.exit(1);e[
|
|
20
|
+
`}table({tableData:t,tableOptions:n,tableBreakpoints:u}){return _r(t.map(r=>r.map(o=>this.render(o))),u?Mr(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 D=this.flagParameter("type"in n?n.type:n);D&&(s+=`${this.flagOperator(t)}${D}`)}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 Ne=/^[\w.-]+$/,{stringify:I}=JSON,Zr=/[|\\{}()[\]^$+*?.]/;function Ge(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 D;if(o==="<"&&s===">"&&(D=!0,n))throw new Error(`Invalid parameter: Required parameter ${I(r)} cannot come after optional parameter ${I(n)}`);if(o==="["&&s==="]"&&(D=!1,n=r),D===void 0)throw new Error(`Invalid parameter: ${I(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let i=r.slice(1,-1);const l=i.slice(-3)==="...";l&&(u=r,i=i.slice(0,-3));const f=i.match(Zr);if(f)throw new Error(`Invalid parameter: ${I(r)}. Invalid character found ${I(f[0])}`);t.push({name:i,required:D,spread:l})}return t}function Ue(e,t,n,u){for(let r=0;r<t.length;r+=1){const{name:o,required:s,spread:D}=t[r],i=jr(o);if(i in e)throw new Error(`Invalid parameter: ${I(o)} is used more than once.`);const l=D?n.slice(r):n[r];if(D&&(r=t.length),s&&(!l||D&&l.length===0))return console.error(`Error: Missing required parameter ${I(o)}
|
|
22
|
+
`),u(),process.exit(1);e[i]=l}}function Qr(e){return e===void 0||e!==!1}function iu(e,t,n,u){const r={...t.flags},o=t.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:s}=t,D=Qr(s);D&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const i=tr(r,u,{ignore:t.ignoreArgv}),l=()=>{console.log(t.version)};if(o&&i.flags.version===!0)return l(),process.exit(0);const f=new Xr,a=D&&s?.render?s.render:p=>f.render(p),c=p=>{const m=Yr({...t,...p?{help:p}:{},flags:r});console.log(a(m,f))};if(D&&i.flags.help===!0)return c(),process.exit(0);if(t.parameters){let{parameters:p}=t,m=i._;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 P=i._["--"];m=m.slice(0,-P.length||void 0),Ue(B,Ge(p),m,c),Ue(B,Ge(F),P,c)}else Ue(B,Ge(p),m,c);Object.assign(i._,B)}const d={...i,showVersion:l,showHelp:c};return typeof n=="function"&&n(d),{command:e,...d}}function eo(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 to(e,t,n=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Ne.test(e.name)))throw new Error(`Invalid script name: ${I(e.name)}`);const u=n[0];if(e.commands&&Ne.test(u)){const r=eo(u,e.commands);if(r)return iu(r.options.name,{...r.options,parent:e},r.callback,n.slice(1))}return iu(void 0,e,t,n)}function Du(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(!Ne.test(n))throw new Error(`Invalid command name ${JSON.stringify(n)}. Command names must be one word.`);return{options:e,callback:t}}var au="1.8.2",uo="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={},no={get exports(){return M},set exports(e){M=e}},We,cu;function ro(){if(cu)return We;cu=1,We=u,u.sync=r;var e=Pe;function t(o,s){var D=s.pathExt!==void 0?s.pathExt:process.env.PATHEXT;if(!D||(D=D.split(";"),D.indexOf("")!==-1))return!0;for(var i=0;i<D.length;i++){var l=D[i].toLowerCase();if(l&&o.substr(-l.length).toLowerCase()===l)return!0}return!1}function n(o,s,D){return!o.isSymbolicLink()&&!o.isFile()?!1:t(s,D)}function u(o,s,D){e.stat(o,function(i,l){D(i,i?!1:n(l,o,s))})}function r(o,s){return n(e.statSync(o),o,s)}return We}var He,lu;function oo(){if(lu)return He;lu=1,He=t,t.sync=n;var e=Pe;function t(o,s,D){e.stat(o,function(i,l){D(i,i?!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 D=o.mode,i=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=D&p||D&d&&l===a||D&c&&i===f||D&m&&f===0;return h}return He}var he;process.platform==="win32"||w.TESTING_WINDOWS?he=ro():he=oo();var so=qe;qe.sync=io;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)})})}he(e,t||{},function(u,r){u&&(u.code==="EACCES"||t&&t.ignoreErrors)&&(u=null,r=!1),n(u,r)})}function io(e,t){try{return he.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const H=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",fu=X,Do=H?";":":",du=so,pu=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Cu=(e,t)=>{const n=t.colon||Do,u=e.match(/\//)||H&&e.match(/\\/)?[""]:[...H?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],r=H?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=H?r.split(n):[""];return H&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:u,pathExt:o,pathExtExe:r}},mu=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:u,pathExt:r,pathExtExe:o}=Cu(e,t),s=[],D=l=>new Promise((f,a)=>{if(l===u.length)return t.all&&s.length?f(s):a(pu(e));const c=u[l],d=/^".*"$/.test(c)?c.slice(1,-1):c,p=fu.join(d,e),m=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;f(i(m,l,0))}),i=(l,f,a)=>new Promise((c,d)=>{if(a===r.length)return c(D(f+1));const p=r[a];du(l+p,{pathExt:o},(m,h)=>{if(!m&&h)if(t.all)s.push(l+p);else return c(l+p);return c(i(l,f,a+1))})});return n?D(0).then(l=>n(null,l),n):D(0)},ao=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:u,pathExtExe:r}=Cu(e,t),o=[];for(let s=0;s<n.length;s++){const D=n[s],i=/^".*"$/.test(D)?D.slice(1,-1):D,l=fu.join(i,e),f=!i&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let a=0;a<u.length;a++){const c=f+u[a];try{if(du.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 pu(e)};var co=mu;mu.sync=ao;var Fe={},lo={get exports(){return Fe},set exports(e){Fe=e}};const hu=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(u=>u.toUpperCase()==="PATH")||"Path"};lo.exports=hu,Fe.default=hu;const Fu=X,fo=co,po=Fe;function gu(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=fo.sync(e.command,{path:n[po({env:n})],pathExt:t?Fu.delimiter:void 0})}catch{}finally{o&&process.chdir(u)}return s&&(s=Fu.resolve(r?e.options.cwd:"",s)),s}function Co(e){return gu(e)||gu(e,!0)}var mo=Co,ze={};const Ke=/([()\][%!^"`<>&|;, *?])/g;function ho(e){return e=e.replace(Ke,"^$1"),e}function Fo(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Ke,"^$1"),t&&(e=e.replace(Ke,"^$1")),e}ze.command=ho,ze.argument=Fo;var go=/^#!(.*)/;const Eo=go;var yo=(e="")=>{const t=e.match(Eo);if(!t)return null;const[n,u]=t[0].replace(/#! ?/,"").split(" "),r=n.split("/").pop();return r==="env"?u:u?`${r} ${u}`:r};const Ve=Pe,bo=yo;function wo(e){const n=Buffer.alloc(150);let u;try{u=Ve.openSync(e,"r"),Ve.readSync(u,n,0,150,0),Ve.closeSync(u)}catch{}return bo(n.toString())}var Bo=wo;const $o=X,Eu=mo,yu=ze,vo=Bo,Ao=process.platform==="win32",xo=/\.(?:com|exe)$/i,So=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Oo(e){e.file=Eu(e);const t=e.file&&vo(e.file);return t?(e.args.unshift(e.file),e.command=t,Eu(e)):e.file}function Io(e){if(!Ao)return e;const t=Oo(e),n=!xo.test(t);if(e.options.forceShell||n){const u=So.test(t);e.command=$o.normalize(e.command),e.command=yu.command(e.command),e.args=e.args.map(o=>yu.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 To(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:Io(u)}var Po=To;const Ye=process.platform==="win32";function Je(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 _o(e,t){if(!Ye)return;const n=e.emit;e.emit=function(u,r){if(u==="exit"){const o=bu(r,t);if(o)return n.call(e,"error",o)}return n.apply(e,arguments)}}function bu(e,t){return Ye&&e===1&&!t.file?Je(t.original,"spawn"):null}function Ro(e,t){return Ye&&e===1&&!t.file?Je(t.original,"spawnSync"):null}var ko={hookChildProcess:_o,verifyENOENT:bu,verifyENOENTSync:Ro,notFoundError:Je};const wu=vn,Xe=Po,Ze=ko;function Bu(e,t,n){const u=Xe(e,t,n),r=wu.spawn(u.command,u.args,u.options);return Ze.hookChildProcess(r,u),r}function Mo(e,t,n){const u=Xe(e,t,n),r=wu.spawnSync(u.command,u.args,u.options);return r.error=r.error||Ze.verifyENOENTSync(r.status,u),r}no.exports=Bu,M.spawn=Bu,M.sync=Mo,M._parse=Xe,M._enoent=Ze;function jo(e){const t=typeof e=="string"?`
|
|
23
23
|
`:`
|
|
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
|
|
25
|
-
${t}`,
|
|
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 $u(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 Lo(e={}){const{cwd:t=b.cwd(),path:n=b.env[$u()],execPath:u=b.execPath}=e;let r;const o=t instanceof URL?An.fileURLToPath(t):t;let s=W.resolve(o);const D=[];for(;r!==s;)D.push(W.join(s,"node_modules/.bin")),r=s,s=W.resolve(s,"..");return D.push(W.resolve(o,u,"..")),[...D,n].join(W.delimiter)}function No({env:e=b.env,...t}={}){e={...e};const n=$u({env:e});return t.path=e[n],e[n]=Lo(t),e}const Go=(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);!Uo(r,o)&&u||Object.defineProperty(e,n,o)},Uo=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)},Wo=(e,t)=>{const n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Ho=(e,t)=>`/* Wrapped ${e}*/
|
|
25
|
+
${t}`,qo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),zo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ko=(e,t,n)=>{const u=n===""?"":`with ${n.trim()}() `,r=Ho.bind(null,u,t.toString());Object.defineProperty(r,"name",zo),Object.defineProperty(e,"toString",{...qo,value:r})};function Vo(e,t,{ignoreNonConfigurable:n=!1}={}){const{name:u}=e;for(const r of Reflect.ownKeys(t))Go(e,t,r,n);return Wo(e,t),Ko(e,t,u),e}const ge=new WeakMap,vu=(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(ge.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 Vo(o,e),ge.set(o,u),o};vu.callCount=e=>{if(!ge.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return ge.get(e)};const Yo=function(){const e=xu-Au+1;return Array.from({length:e},Jo)},Jo=function(e,t){return{name:`SIGRT${t+1}`,number:Au+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},Au=34,xu=64,Xo=[{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"}],Su=function(){const e=Yo();return[...Xo,...e].map(Zo)},Zo=function({name:e,number:t,description:n,action:u,forced:r=!1,standard:o}){const{signals:{[e]:s}}=kt,D=s!==void 0;return{name:e,number:D?s:t,description:n,supported:D,action:u,forced:r,standard:o}},Qo=function(){const e=Su();return Object.fromEntries(e.map(es))},es=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}]},ts=Qo(),us=function(){const e=Su(),t=xu+1,n=Array.from({length:t},(u,r)=>ns(r,e));return Object.assign({},...n)},ns=function(e,t){const n=rs(e,t);if(n===void 0)return{};const{name:u,description:r,supported:o,action:s,forced:D,standard:i}=n;return{[e]:{name:u,number:e,description:r,supported:o,action:s,forced:D,standard:i}}},rs=function(e,t){const n=t.find(({name:u})=>kt.signals[u]===e);return n!==void 0?n:t.find(u=>u.number===e)};us();const os=({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",Ou=({stdout:e,stderr:t,all:n,error:u,signal:r,exitCode:o,command:s,escapedCommand:D,timedOut:i,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:ts[r].description,d=u&&u.code,m=`Command ${os({timedOut:i,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
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},Ee=["stdin","stdout","stderr"],ns=e=>Ee.some(t=>e[t]!==void 0),rs=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return Ee.map(u=>e[u]);if(ns(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Ee.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,Ee.length);return Array.from({length:n},(u,r)=>t[r])};var H={},Su={get exports(){return H},set exports(e){H=e}},ye={},os={get exports(){return ye},set exports(e){ye=e}},Ou;function ss(){return Ou||(Ou=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")}(os)),ye}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))Su.exports=function(){return function(){}};else{var is=Rt,ee=ss(),Ds=/^win/i.test(g.platform),be=kt;typeof be!="function"&&(be=be.EventEmitter);var $;g.__signal_exit_emitter__?$=g.__signal_exit_emitter__:($=g.__signal_exit_emitter__=new be,$.count=0,$.emitted={}),$.infinite||($.setMaxListeners(1/0),$.infinite=!0),Su.exports=function(e,t){if(!j(w.process))return function(){};is.equal(typeof e,"function","a callback must be provided for exit handler"),te===!1&&Iu();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=Tu,$.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),Ds&&e==="SIGHUP"&&(e="SIGINT"),g.kill(g.pid,e))}}}),H.signals=function(){return ee};var te=!1,Iu=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=cs,g.reallyExit=as)};H.load=Iu;var Tu=g.reallyExit,as=function(t){j(w.process)&&(g.exitCode=t||0,z("exit",g.exitCode,null),z("afterexit",g.exitCode,null),Tu.call(g,g.exitCode))},et=g.emit,cs=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 ls=1e3*5,fs=(e,t="SIGTERM",n={})=>{const u=e(t);return ds(e,t,n,u),u},ds=(e,t,n,u)=>{if(!ps(t,n,u))return;const r=ms(n),o=setTimeout(()=>{e("SIGKILL")},r);o.unref&&o.unref()},ps=(e,{forceKillAfterTimeout:t},n)=>Cs(e)&&t!==!1&&n,Cs=e=>e===$n.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",ms=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return ls;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},hs=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Fs=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},gs=(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(()=>{Fs(e,n,D)},t)}),s=u.finally(()=>{clearTimeout(r)});return Promise.race([o,s])},Es=({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})`)},ys=async(e,{cleanup:t,detached:n},u)=>{if(!t||n)return u;const r=H(()=>{e.kill()});return u.finally(()=>{r()})};function bs(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}var L={},ws={get exports(){return L},set exports(e){L=e}};const{PassThrough:Bs}=Pe;var $s=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 Bs({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:vs}=vn,As=Pe,{promisify:xs}=Mt,Ss=$s,Os=xs(As.pipeline);class Pu 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=Ss(t);return await new Promise((r,o)=>{const s=i=>{i&&u.getBufferedLength()<=vs.MAX_LENGTH&&(i.bufferedData=u.getBufferedValue()),o(i)};(async()=>{try{await Os(e,u),r()}catch(i){s(i)}})(),u.on("data",()=>{u.getBufferedLength()>n&&s(new Pu)})}),u.getBufferedValue()}ws.exports=tt,L.buffer=(e,t)=>tt(e,{...t,encoding:"buffer"}),L.array=(e,t)=>tt(e,{...t,array:!0}),L.MaxBufferError=Pu;const{PassThrough:Is}=Pe;var Ts=function(){var e=[],t=new Is({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 Ps=(e,t)=>{t!==void 0&&(bs(t)?t.pipe(e.stdin):e.stdin.end(t))},_s=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const n=Ts();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})},Rs=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)])}},ks=(async()=>{})().constructor.prototype,Ms=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(ks,e)]),_u=(e,t)=>{for(const[n,u]of Ms){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},js=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)})}),Ru=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Ls=/^[\w.-]+$/,Ns=/"/g,Gs=e=>typeof e!="string"||Ls.test(e)?e:`"${e.replace(Ns,'\\"')}"`,Us=(e,t)=>Ru(e,t).join(" "),Ws=(e,t)=>Ru(e,t).map(n=>Gs(n)).join(" "),qs=1e3*1e3*100,Hs=({env:e,extendEnv:t,preferLocal:n,localDir:u,execPath:r})=>{const o=t?{...b.env,...e}:e;return n?Mo({env:o,cwd:u,execPath:r}):o},zs=(e,t,n={})=>{const u=M._parse(e,t,n);return e=u.command,t=u.args,n=u.options,n={maxBuffer:qs,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=Hs(n),n.stdio=rs(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"&&!bn.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?Ro(t):t;function ue(e,t,n){const u=zs(e,t,n),r=Us(e,t),o=Ws(e,t);Es(u.options);let s;try{s=It.spawn(u.file,u.args,u.options)}catch(d){const p=new It.ChildProcess,m=Promise.reject(xu({error:d,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:u,timedOut:!1,isCanceled:!1,killed:!1}));return _u(p,m)}const i=js(s),D=gs(s,u.options,i),l=ys(s,u.options,D),f={isCanceled:!1};s.kill=fs.bind(null,s.kill.bind(s)),s.cancel=hs.bind(null,s,f);const c=Bu(async()=>{const[{error:d,exitCode:p,signal:m,timedOut:h},F,B,T]=await Rs(s,u.options,l),ce=rt(u.options,F),R=rt(u.options,B),Ie=rt(u.options,T);if(d||p!==0||m!==null){const U=xu({error:d,exitCode:p,signal:m,stdout:ce,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:ce,stderr:R,all:Ie,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Ps(s,u.options.input),s.all=_s(s,u.options),_u(s,c)}let N=!0;const K=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let ku=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&&(ku=u&&u.endsWith("-256color")?2:1)}let Mu={enabled:N,supportLevel:ku};function ne(e,t,n=1){const u=`\x1B[${e}m`,r=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return s=>Mu.enabled&&Mu.supportLevel>=n?u+(""+s).replace(o,u)+r:""+s}const ot=ne(2,22),ju=ne(30,39),we=ne(31,39),Be=ne(32,39),Lu=ne(46,49),st="\x1B",y=`${st}[`,Ks="\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`},Vs={up:(e=1)=>`${y}S`.repeat(e),down:(e=1)=>`${y}T`.repeat(e)},Ys={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:Vs,erase:Ys,beep:Ks},C={},Js={get exports(){return C},set exports(e){C=e}};let Xs=le,Zs=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Xs.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+Nu(r,t,n,o)+t:e+r+t},Nu=(e,t,n,u)=>{let r=e.substring(0,u)+n,o=e.substring(u+t.length),s=o.indexOf(t);return~s?r+Nu(o,t,n,s):r+o},Gu=(e=Zs)=>({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});Js.exports=Gu(),C.createColors=Gu;function Qs(e,t){if(e===t)return;const n=e.split(`
|
|
27
|
+
`);return h?(u.originalMessage=u.message,u.message=B):u=new Error(B),u.shortMessage=F,u.command=s,u.escapedCommand=D,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(i),u.isCanceled=l,u.killed=f&&!i,u},Ee=["stdin","stdout","stderr"],ss=e=>Ee.some(t=>e[t]!==void 0),is=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return Ee.map(u=>e[u]);if(ss(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Ee.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,Ee.length);return Array.from({length:n},(u,r)=>t[r])};var q={},Iu={get exports(){return q},set exports(e){q=e}},ye={},Ds={get exports(){return ye},set exports(e){ye=e}},Tu;function as(){return Tu||(Tu=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")}(Ds)),ye}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))Iu.exports=function(){return function(){}};else{var cs=Mt,ee=as(),ls=/^win/i.test(g.platform),be=jt;typeof be!="function"&&(be=be.EventEmitter);var $;g.__signal_exit_emitter__?$=g.__signal_exit_emitter__:($=g.__signal_exit_emitter__=new be,$.count=0,$.emitted={}),$.infinite||($.setMaxListeners(1/0),$.infinite=!0),Iu.exports=function(e,t){if(!j(w.process))return function(){};cs.equal(typeof e,"function","a callback must be provided for exit handler"),te===!1&&Pu();var n="exit";t&&t.alwaysLast&&(n="afterexit");var u=function(){$.removeListener(n,e),$.listeners("exit").length===0&&$.listeners("afterexit").length===0&&Qe()};return $.on(n,e),u};var Qe=function(){!te||!j(w.process)||(te=!1,ee.forEach(function(t){try{g.removeListener(t,et[t])}catch{}}),g.emit=tt,g.reallyExit=_u,$.count-=1)};q.unload=Qe;var z=function(t,n,u){$.emitted[t]||($.emitted[t]=!0,$.emit(t,n,u))},et={};ee.forEach(function(e){et[e]=function(){if(j(w.process)){var n=g.listeners(e);n.length===$.count&&(Qe(),z("exit",null,e),z("afterexit",null,e),ls&&e==="SIGHUP"&&(e="SIGINT"),g.kill(g.pid,e))}}}),q.signals=function(){return ee};var te=!1,Pu=function(){te||!j(w.process)||(te=!0,$.count+=1,ee=ee.filter(function(t){try{return g.on(t,et[t]),!0}catch{return!1}}),g.emit=ds,g.reallyExit=fs)};q.load=Pu;var _u=g.reallyExit,fs=function(t){j(w.process)&&(g.exitCode=t||0,z("exit",g.exitCode,null),z("afterexit",g.exitCode,null),_u.call(g,g.exitCode))},tt=g.emit,ds=function(t,n){if(t==="exit"&&j(w.process)){n!==void 0&&(g.exitCode=n);var u=tt.apply(this,arguments);return z("exit",g.exitCode,null),z("afterexit",g.exitCode,null),u}else return tt.apply(this,arguments)}}const ps=1e3*5,Cs=(e,t="SIGTERM",n={})=>{const u=e(t);return ms(e,t,n,u),u},ms=(e,t,n,u)=>{if(!hs(t,n,u))return;const r=gs(n),o=setTimeout(()=>{e("SIGKILL")},r);o.unref&&o.unref()},hs=(e,{forceKillAfterTimeout:t},n)=>Fs(e)&&t!==!1&&n,Fs=e=>e===xn.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",gs=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return ps;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},Es=(e,t)=>{e.kill()&&(t.isCanceled=!0)},ys=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},bs=(e,{timeout:t,killSignal:n="SIGTERM"},u)=>{if(t===0||t===void 0)return u;let r;const o=new Promise((D,i)=>{r=setTimeout(()=>{ys(e,n,i)},t)}),s=u.finally(()=>{clearTimeout(r)});return Promise.race([o,s])},ws=({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=q(()=>{e.kill()});return u.finally(()=>{r()})};function $s(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}var L={},vs={get exports(){return L},set exports(e){L=e}};const{PassThrough:As}=_e;var xs=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 As({objectMode:r});n&&o.setEncoding(n);let s=0;const D=[];return o.on("data",i=>{D.push(i),r?s=D.length:s+=i.length}),o.getBufferedValue=()=>t?D:u?Buffer.concat(D,s):D.join(""),o.getBufferedLength=()=>s,o};const{constants:Ss}=Sn,Os=_e,{promisify:Is}=Lt,Ts=xs,Ps=Is(Os.pipeline);class Ru extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function ut(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:n}=t,u=Ts(t);return await new Promise((r,o)=>{const s=D=>{D&&u.getBufferedLength()<=Ss.MAX_LENGTH&&(D.bufferedData=u.getBufferedValue()),o(D)};(async()=>{try{await Ps(e,u),r()}catch(D){s(D)}})(),u.on("data",()=>{u.getBufferedLength()>n&&s(new Ru)})}),u.getBufferedValue()}vs.exports=ut,L.buffer=(e,t)=>ut(e,{...t,encoding:"buffer"}),L.array=(e,t)=>ut(e,{...t,array:!0}),L.MaxBufferError=Ru;const{PassThrough:_s}=_e;var Rs=function(){var e=[],t=new _s({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 ks=(e,t)=>{t!==void 0&&($s(t)?t.pipe(e.stdin):e.stdin.end(t))},Ms=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const n=Rs();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},nt=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(n){return n.bufferedData}}},rt=(e,{encoding:t,buffer:n,maxBuffer:u})=>{if(!(!e||!n))return t?L(e,{encoding:t,maxBuffer:u}):L.buffer(e,{maxBuffer:u})},js=async({stdout:e,stderr:t,all:n},{encoding:u,buffer:r,maxBuffer:o},s)=>{const D=rt(e,{encoding:u,buffer:r,maxBuffer:o}),i=rt(t,{encoding:u,buffer:r,maxBuffer:o}),l=rt(n,{encoding:u,buffer:r,maxBuffer:o*2});try{return await Promise.all([s,D,i,l])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},nt(e,D),nt(t,i),nt(n,l)])}},Ls=(async()=>{})().constructor.prototype,Ns=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Ls,e)]),ku=(e,t)=>{for(const[n,u]of Ns){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},Gs=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)})}),Mu=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Us=/^[\w.-]+$/,Ws=/"/g,Hs=e=>typeof e!="string"||Us.test(e)?e:`"${e.replace(Ws,'\\"')}"`,qs=(e,t)=>Mu(e,t).join(" "),zs=(e,t)=>Mu(e,t).map(n=>Hs(n)).join(" "),Ks=1e3*1e3*100,Vs=({env:e,extendEnv:t,preferLocal:n,localDir:u,execPath:r})=>{const o=t?{...b.env,...e}:e;return n?No({env:o,cwd:u,execPath:r}):o},Ys=(e,t,n={})=>{const u=M._parse(e,t,n);return e=u.command,t=u.args,n=u.options,n={maxBuffer:Ks,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=Vs(n),n.stdio=is(n),b.platform==="win32"&&W.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:u}},ot=(e,t,n)=>typeof t!="string"&&!$n.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?jo(t):t;function ue(e,t,n){const u=Ys(e,t,n),r=qs(e,t),o=zs(e,t);ws(u.options);let s;try{s=Pt.spawn(u.file,u.args,u.options)}catch(d){const p=new Pt.ChildProcess,m=Promise.reject(Ou({error:d,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:u,timedOut:!1,isCanceled:!1,killed:!1}));return ku(p,m)}const D=Gs(s),i=bs(s,u.options,D),l=Bs(s,u.options,i),f={isCanceled:!1};s.kill=Cs.bind(null,s.kill.bind(s)),s.cancel=Es.bind(null,s,f);const c=vu(async()=>{const[{error:d,exitCode:p,signal:m,timedOut:h},F,B,P]=await js(s,u.options,l),ce=ot(u.options,F),R=ot(u.options,B),Te=ot(u.options,P);if(d||p!==0||m!==null){const U=Ou({error:d,exitCode:p,signal:m,stdout:ce,stderr:R,all:Te,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:ce,stderr:R,all:Te,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return ks(s,u.options.input),s.all=Ms(s,u.options),ku(s,c)}let N=!0;const K=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let ju=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&&(ju=u&&u.endsWith("-256color")?2:1)}let Lu={enabled:N,supportLevel:ju};function ne(e,t,n=1){const u=`\x1B[${e}m`,r=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return s=>Lu.enabled&&Lu.supportLevel>=n?u+(""+s).replace(o,u)+r:""+s}const st=ne(2,22),Nu=ne(30,39),we=ne(31,39),Be=ne(32,39),Gu=ne(46,49),it="\x1B",y=`${it}[`,Js="\x07",Dt={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:`${it}7`,restore:`${it}8`},Xs={up:(e=1)=>`${y}S`.repeat(e),down:(e=1)=>`${y}T`.repeat(e)},Zs={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?Dt.up():"");return e&&(t+=Dt.left),t}};var v={cursor:Dt,scroll:Xs,erase:Zs,beep:Js},C={},Qs={get exports(){return C},set exports(e){C=e}};let ei=le,ti=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||ei.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+Uu(r,t,n,o)+t:e+r+t},Uu=(e,t,n,u)=>{let r=e.substring(0,u)+n,o=e.substring(u+t.length),s=o.indexOf(t);return~s?r+Uu(o,t,n,s):r+o},Wu=(e=ti)=>({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});Qs.exports=Wu(),C.createColors=Wu;function ui(e,t){if(e===t)return;const n=e.split(`
|
|
28
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
|
|
29
|
+
`),r=[];for(let o=0;o<Math.max(n.length,u.length);o++)n[o]!==u[o]&&r.push(o);return r}const Hu=Symbol("clack:cancel");function qu(e){return e===Hu}function $e(e,t){e.isTTY&&e.setRawMode(t)}const zu=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),ni=new Set(["up","down","left","right","space","enter"]);class Ku{constructor({render:t,input:n=_t,output:u=Rt,...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 On(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=Nt.createInterface({input:this.input,output:t,tabSize:2,prompt:"",escapeCodeTimeout:50}),Nt.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(Hu)})})}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&&zu.has(n.name)&&this.emit("cursor",zu.get(n.name)),n?.name&&ni.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
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=
|
|
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=ui(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
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
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
|
|
35
|
-
${
|
|
36
|
-
`,r=this.value?t:n;switch(this.state){case"submit":return`${u}${C.gray(
|
|
37
|
-
${C.gray(
|
|
38
|
-
${C.cyan(
|
|
39
|
-
`}}}).prompt()},
|
|
40
|
-
${
|
|
41
|
-
`;switch(this.state){case"submit":return`${n}${C.gray(
|
|
42
|
-
${C.gray(
|
|
43
|
-
${C.cyan(
|
|
44
|
-
${C.cyan(
|
|
45
|
-
`}}}).prompt()},
|
|
46
|
-
`)},V=(e="")=>{process.stdout.write(`${C.gray(
|
|
47
|
-
${C.gray(
|
|
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 ri extends Ku{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 oi extends Ku{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 si({input:e=_t,output:t=Rt,overwrite:n=!0,hideCursor:u=!0}={}){const r=fe.createInterface({input:e,output:t,prompt:"",tabSize:1});fe.emitKeypressEvents(e,r),e.isTTY&&e.setRawMode(!0);const o=(s,{name:D})=>{if(String(s)===""&&process.exit(0),!n)return;let i=D==="return"?0:-1,l=D==="return"?-1:0;fe.moveCursor(t,i,l,()=>{fe.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 ii(){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 at=ii(),_=(e,t)=>at?e:t,Di=_("\u25C6","*"),ai=_("\u25A0","x"),ci=_("\u25B2","x"),Vu=_("\u25C7","o"),li=_("\u250C","T"),x=_("\u2502","|"),ct=_("\u2514","\u2014"),lt=_("\u25CF",">"),ft=_("\u25CB"," "),Yu=e=>{switch(e){case"initial":case"active":return C.cyan(Di);case"cancel":return C.red(ai);case"error":return C.yellow(ci);case"submit":return C.green(Vu)}},fi=e=>{const t=e.active??"Yes",n=e.inactive??"No";return new ri({active:t,inactive:n,initialValue:e.initialValue??!0,render(){const u=`${C.gray(x)}
|
|
35
|
+
${Yu(this.state)} ${e.message}
|
|
36
|
+
`,r=this.value?t:n;switch(this.state){case"submit":return`${u}${C.gray(x)} ${C.dim(r)}`;case"cancel":return`${u}${C.gray(x)} ${C.strikethrough(C.dim(r))}
|
|
37
|
+
${C.gray(x)}`;default:return`${u}${C.cyan(x)} ${this.value?`${C.green(lt)} ${t}`:`${C.dim(ft)} ${C.dim(t)}`} ${C.dim("/")} ${this.value?`${C.dim(ft)} ${C.dim(n)}`:`${C.green(lt)} ${n}`}
|
|
38
|
+
${C.cyan(ct)}
|
|
39
|
+
`}}}).prompt()},di=e=>{const t=(n,u)=>{const r=n.label??String(n.value);return u==="active"?`${C.green(lt)} ${r} ${n.hint?C.dim(`(${n.hint})`):""}`:u==="selected"?`${C.dim(r)}`:u==="cancelled"?`${C.strikethrough(C.dim(r))}`:`${C.dim(ft)} ${C.dim(r)}`};return new oi({options:e.options,initialValue:e.initialValue,render(){const n=`${C.gray(x)}
|
|
40
|
+
${Yu(this.state)} ${e.message}
|
|
41
|
+
`;switch(this.state){case"submit":return`${n}${C.gray(x)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${n}${C.gray(x)} ${t(this.options[this.cursor],"cancelled")}
|
|
42
|
+
${C.gray(x)}`;default:return`${n}${C.cyan(x)} ${this.options.map((u,r)=>t(u,r===this.cursor?"active":"inactive")).join(`
|
|
43
|
+
${C.cyan(x)} `)}
|
|
44
|
+
${C.cyan(ct)}
|
|
45
|
+
`}}}).prompt()},Ju=(e="")=>{process.stdout.write(`${C.gray(li)} ${e}
|
|
46
|
+
`)},V=(e="")=>{process.stdout.write(`${C.gray(x)}
|
|
47
|
+
${C.gray(ct)} ${e}
|
|
48
48
|
|
|
49
|
-
`)},
|
|
49
|
+
`)},dt=at?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],pt=()=>{let e,t;const n=at?80:120;return{start(u=""){u=u.replace(/\.?\.?\.$/,""),e=si(),process.stdout.write(`${C.gray(x)}
|
|
50
50
|
${C.magenta("\u25CB")} ${u}
|
|
51
|
-
`);let r=0,o=0;t=setInterval(()=>{let s=
|
|
52
|
-
`),r=r===
|
|
53
|
-
${C.green(
|
|
54
|
-
`),e()}}};class
|
|
51
|
+
`);let r=0,o=0;t=setInterval(()=>{let s=dt[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===dt.length-1?0:r+1,o=o===dt.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(x)}
|
|
53
|
+
${C.green(Vu)} ${u}
|
|
54
|
+
`),e()}}};class S extends Error{}const Ct=" ",ve=e=>{e instanceof Error&&!(e instanceof S)&&(e.stack&&console.error(st(e.stack.split(`
|
|
55
55
|
`).slice(1).join(`
|
|
56
56
|
`))),console.error(`
|
|
57
|
-
${
|
|
58
|
-
${
|
|
59
|
-
`),diff:u}},
|
|
57
|
+
${Ct}${st(`aicommits v${au}`)}`),console.error(`
|
|
58
|
+
${Ct}Please open a Bug report with the information above:`),console.error(`${Ct}https://github.com/Nutlope/aicommits/issues/new/choose`))},Xu=async()=>{const{stdout:e}=await ue("git",["rev-parse","--is-inside-work-tree"],{reject:!1});if(e!=="true")throw new S("The current directory must be a Git repository!")},mt=e=>`:(exclude)${e}`,Zu=["package-lock.json","pnpm-lock.yaml","*.lock"].map(mt),Qu=async e=>{const t=["diff","--cached","--diff-algorithm=minimal"],{stdout:n}=await ue("git",[...t,"--name-only",...Zu,...e?e.map(mt):[]]);if(!n)return;const{stdout:u}=await ue("git",[...t,...Zu,...e?e.map(mt):[]]);return{files:n.split(`
|
|
59
|
+
`),diff:u}},pi=e=>`Detected ${e.length.toLocaleString()} staged file${e.length>1?"s":""}`,{hasOwnProperty:ht}=Object.prototype,Ae=typeof process<"u"&&process.platform==="win32"?`\r
|
|
60
60
|
`:`
|
|
61
|
-
`,ht=(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=ht(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&&(mt.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(!mt.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__"&&((!mt.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:ht,encode:ht,safe:Y,unsafe:xe};const un=e=>O.lstat(e).then(()=>!0,()=>!1),{hasOwnProperty:fi}=Object.prototype,nn=(e,t)=>fi.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},model(e){return!e||e.length===0?"gpt-3.5-turbo":e}},Ft=X.join(Lt.homedir(),".aicommits"),rn=async()=>{if(!await un(Ft))return Object.create(null);const t=await O.readFile(Ft,"utf8");return tn.parse(t)},gt=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},di=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(Ft,tn.stringify(t),"utf8")};var Et={},re={},pi={get exports(){return re},set exports(e){re=e}},oe={},Ci={get exports(){return oe},set exports(e){oe=e}},yt,on;function mi(){if(on)return yt;on=1;var e=1e3,t=e*60,n=t*60,u=n*24,r=u*7,o=u*365.25;yt=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 yt}var bt,sn;function Dn(){if(sn)return bt;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=mi(),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),ce=T-(c||T);B.diff=ce,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,En)=>{if(U==="%%")return"%";R++;const Ot=u.formatters[En];if(typeof Ot=="function"){const yn=F[R];U=Ot.call(B,yn),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 bt=e,bt}var an;function hi(){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}}}(Ci,oe)),oe}var se={},Fi={get exports(){return se},set exports(e){se=e}},wt,cn;function gi(){return cn||(cn=1,wt=(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)}),wt}var Bt,ln;function Ei(){if(ln)return Bt;ln=1;const e=Lt,t=le,n=gi(),{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 Bt={supportsColor:i,stdout:o(s(!0,t.isatty(1))),stderr:o(s(!0,t.isatty(2)))},Bt}var fn;function yi(){return fn||(fn=1,function(e,t){const n=le,u=Mt;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=Ei();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(`
|
|
61
|
+
`,Ft=(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 D of s)u+=Y(o+"[]")+r+Y(D)+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=en(o).join("\\."),D=(t.section?t.section+".":"")+s,{whitespace:i}=t,l=Ft(e[o],{section:D,whitespace:i});u.length&&l.length&&(u+=Ae),u+=l}return u},en=e=>e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(t=>t.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")),tn=e=>{const t=Object.create(null);let n=t,u=null;const r=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=e.split(/[\r\n]+/g);for(const D of o){if(!D||D.match(/^\s*[;#]/))continue;const i=D.match(r);if(!i)continue;if(i[1]!==void 0){if(u=xe(i[1]),u==="__proto__"){n=Object.create(null);continue}n=t[u]=t[u]||Object.create(null);continue}const l=xe(i[2]),f=l.length>2&&l.slice(-2)==="[]",a=f?l.slice(0,-2):l;if(a==="__proto__")continue;const c=i[3]?xe(i[4]):!0,d=c==="true"||c==="false"||c==="null"?JSON.parse(c):c;f&&(ht.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 D of Object.keys(t)){if(!ht.call(t,D)||typeof t[D]!="object"||Array.isArray(t[D]))continue;const i=en(D);n=t;const l=i.pop(),f=l.replace(/\\\./g,".");for(const a of i)a!=="__proto__"&&((!ht.call(n,a)||typeof n[a]!="object")&&(n[a]=Object.create(null)),n=n[a]);n===t&&f===l||(n[f]=t[D],s.push(D))}for(const D of s)delete t[D];return t},un=e=>e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"),Y=e=>typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&un(e)||e!==e.trim()?JSON.stringify(e):e.split(";").join("\\;").split("#").join("\\#"),xe=(e,t)=>{if(e=(e||"").trim(),un(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 nn={parse:tn,decode:tn,stringify:Ft,encode:Ft,safe:Y,unsafe:xe};const rn=e=>O.lstat(e).then(()=>!0,()=>!1),{hasOwnProperty:Ci}=Object.prototype,on=(e,t)=>Ci.call(e,t),G=(e,t,n)=>{if(!t)throw new S(`Invalid config property ${e}: ${n}`)},Se={OPENAI_KEY(e){if(!e)throw new S("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},model(e){return!e||e.length===0?"gpt-3.5-turbo":e}},gt=X.join(Gt.homedir(),".aicommits"),sn=async()=>{if(!await rn(gt))return Object.create(null);const t=await O.readFile(gt,"utf8");return nn.parse(t)},Et=async e=>{const t=await sn(),n={};for(const u of Object.keys(Se)){const r=Se[u],o=e?.[u]??t[u];n[u]=r(o)}return n},mi=async e=>{const t=await sn();for(const[n,u]of e){if(!on(Se,n))throw new S(`Invalid config property: ${n}`);const r=Se[n](u);t[n]=r}await O.writeFile(gt,nn.stringify(t),"utf8")};var yt={},re={},hi={get exports(){return re},set exports(e){re=e}},oe={},Fi={get exports(){return oe},set exports(e){oe=e}},bt,Dn;function gi(){if(Dn)return bt;Dn=1;var e=1e3,t=e*60,n=t*60,u=n*24,r=u*7,o=u*365.25;bt=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?i(f):D(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 D(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 i(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 bt}var wt,an;function cn(){if(an)return wt;an=1;function e(t){u.debug=u,u.default=u,u.coerce=l,u.disable=s,u.enable=o,u.enabled=D,u.humanize=gi(),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,P=Number(new Date),ce=P-(c||P);B.diff=ce,B.prev=c,B.curr=P,c=P,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,wn)=>{if(U==="%%")return"%";R++;const Tt=u.formatters[wn];if(typeof Tt=="function"){const Bn=F[R];U=Tt.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(i),...u.skips.map(i).map(c=>"-"+c)].join(",");return u.enable(""),a}function D(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 i(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 wt=e,wt}var ln;function Ei(){return ln||(ln=1,function(e,t){t.formatArgs=u,t.save=r,t.load=o,t.useColors=n,t.storage=s(),t.destroy=(()=>{let i=!1;return()=>{i||(i=!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(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;i.splice(1,0,l,"color: inherit");let f=0,a=0;i[0].replace(/%[a-zA-Z%]/g,c=>{c!=="%%"&&(f++,c==="%c"&&(a=f))}),i.splice(a,0,l)}t.log=console.debug||console.log||(()=>{});function r(i){try{i?t.storage.setItem("debug",i):t.storage.removeItem("debug")}catch{}}function o(){let i;try{i=t.storage.getItem("debug")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function s(){try{return localStorage}catch{}}e.exports=cn()(t);const{formatters:D}=e.exports;D.j=function(i){try{return JSON.stringify(i)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}(Fi,oe)),oe}var se={},yi={get exports(){return se},set exports(e){se=e}},Bt,fn;function bi(){return fn||(fn=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 $t,dn;function wi(){if(dn)return $t;dn=1;const e=Gt,t=le,n=bi(),{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(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function s(i,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(i&&!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 D(i){const l=s(i,i&&i.isTTY);return o(l)}return $t={supportsColor:D,stdout:o(s(!0,t.isatty(1))),stderr:o(s(!0,t.isatty(2)))},$t}var pn;function Bi(){return pn||(pn=1,function(e,t){const n=le,u=Lt;t.init=f,t.log=D,t.formatArgs=o,t.save=i,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=wi();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
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
|
|
64
|
-
`)}function
|
|
65
|
-
`).map(d=>d.trim()).join(" ")},a.O=function(c){return this.inspectOpts.colors=this.useColors,u.inspect(c,this.inspectOpts)}}(
|
|
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
|
|
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 D(...c){return process.stderr.write(u.format(...c)+`
|
|
64
|
+
`)}function i(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=cn()(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)}}(yi,se)),se}(function(e){typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?e.exports=Ei():e.exports=Bi()})(hi);var vt={};Object.defineProperty(vt,"__esModule",{value:!0});function $i(e){return function(t,n){return new Promise((u,r)=>{e.call(this,t,n,(o,s)=>{o?r(o):u(s)})})}}vt.default=$i;var Cn=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const vi=jt,Ai=Cn(re),xi=Cn(vt),ie=Ai.default("agent-base");function Si(e){return Boolean(e)&&typeof e.addRequest=="function"}function At(){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 vi.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:At()?443:80}set defaultPort(u){this.explicitDefaultPort=u}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:At()?"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=At()),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,D=null;const i=o.timeout||this.timeout,l=d=>{u._hadError||(u.emit("error",d),u._hadError=!0)},f=()=>{D=null,s=!0;const d=new Error(`A "socket" was not created for HTTP request before ${i}ms`);d.code="ETIMEOUT",l(d)},a=d=>{s||(D!==null&&(clearTimeout(D),D=null),l(d))},c=d=>{if(s)return;if(D!=null&&(clearTimeout(D),D=null),Si(d)){ie("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?(ie("Converting legacy callback function to promise"),this.promisifiedCallback=xi.default(this.callback)):this.promisifiedCallback=this.callback),typeof i=="number"&&i>0&&(D=setTimeout(f,i)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{ie("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){ie("Freeing socket %o %o",u.constructor.name,r),u.destroy()}destroy(){ie("Destroying agent %o",this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype})(Oe||(Oe={}));var Oi=Oe,xt={},Ii=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xt,"__esModule",{value:!0});const Ti=Ii(re),De=Ti.default("https-proxy-agent:parse-proxy-response");function Pi(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",i),e.removeListener("error",l),e.removeListener("close",D),e.removeListener("readable",o)}function D(a){De("onclose had error %o",a)}function i(){De("onend")}function l(a){s(),De("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
67
|
\r
|
|
68
68
|
`)===-1){De("have not received end of HTTP headers yet..."),o();return}const p=c.toString("ascii",0,c.indexOf(`\r
|
|
69
|
-
`)),m=+p.split(" ")[1];De("got proxy server response: %o",p),t({statusCode:m,buffered:c})}e.on("error",l),e.on("close",
|
|
70
|
-
`;u.auth&&(s["Proxy-Authorization"]=`Basic ${Buffer.from(u.auth).toString("base64")}`);let{host:l,port:f,secureEndpoint:a}=n;
|
|
71
|
-
`;const c=
|
|
72
|
-
`);const{statusCode:d,buffered:p}=yield c;if(d===200){if(t.once("socket",
|
|
69
|
+
`)),m=+p.split(" ")[1];De("got proxy server response: %o",p),t({statusCode:m,buffered:c})}e.on("error",l),e.on("close",D),e.on("end",i),o()})}xt.default=Pi;var _i=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 D(f){try{l(u.next(f))}catch(a){s(a)}}function i(f){try{l(u.throw(f))}catch(a){s(a)}}function l(f){f.done?o(f.value):r(f.value).then(D,i)}l((u=u.apply(e,t||[])).next())})},J=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yt,"__esModule",{value:!0});const mn=J(Tn),hn=J(Pn),Ri=J(_n),ki=J(Mt),Mi=J(re),ji=Oi,Li=J(xt),ae=Mi.default("https-proxy-agent:agent");class Ni extends ji.Agent{constructor(t){let n;if(typeof t=="string"?n=Ri.default.parse(t):n=t,!n)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");ae("creating new HttpsProxyAgent instance: %o",n),super(n);const u=Object.assign({},n);this.secureProxy=n.secureProxy||Wi(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 _i(this,void 0,void 0,function*(){const{proxy:u,secureProxy:r}=this;let o;r?(ae("Creating `tls.Socket`: %o",u),o=hn.default.connect(u)):(ae("Creating `net.Socket`: %o",u),o=mn.default.connect(u));const s=Object.assign({},u.headers);let i=`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;Ui(f,a)||(l+=`:${f}`),s.Host=l,s.Connection="close";for(const h of Object.keys(s))i+=`${h}: ${s[h]}\r
|
|
71
|
+
`;const c=Li.default(o);o.write(`${i}\r
|
|
72
|
+
`);const{statusCode:d,buffered:p}=yield c;if(d===200){if(t.once("socket",Gi),n.secureEndpoint){ae("Upgrading socket connection to TLS");const h=n.servername||n.host;return hn.default.connect(Object.assign(Object.assign({},Hi(n,"host","hostname","path","port")),{socket:o,servername:h}))}return o}o.destroy();const m=new mn.default.Socket({writable:!1});return m.readable=!0,t.once("socket",h=>{ae("replaying proxy buffer for failed request"),ki.default(h.listenerCount("data")>0),h.push(p),h.push(null)}),m})}}yt.default=Ni;function Gi(e){e.resume()}function Ui(e,t){return Boolean(!t&&e===80||t&&e===443)}function Wi(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function Hi(e,...t){const n={};let u;for(u in e)t.includes(u)||(n[u]=e[u]);return n}var qi=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const St=qi(yt);function Ot(e){return new St.default(e)}(function(e){e.HttpsProxyAgent=St.default,e.prototype=St.default.prototype})(Ot||(Ot={}));var zi=Ot;const Ki=async(e,t,n,u,r)=>new Promise((o,s)=>{const D=JSON.stringify(u),i=In.request({port:443,hostname:e,path:t,method:"POST",headers:{...n,"Content-Type":"application/json","Content-Length":Buffer.byteLength(D)},timeout:1e4,agent:r?zi(r):void 0},l=>{const f=[];l.on("data",a=>f.push(a)),l.on("end",()=>{o({request:i,response:l,data:Buffer.concat(f).toString()})})});i.on("error",s),i.on("timeout",()=>{i.destroy(),s(new S("Request timed out"))}),i.write(D),i.end()}),Vi=async(e,t,n)=>{const{response:u,data:r}=await Ki("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+=`
|
|
73
73
|
|
|
74
74
|
${r}`),u.statusCode===500&&(o+=`
|
|
75
75
|
|
|
76
|
-
Check the API status: https://status.openai.com`),new
|
|
77
|
-
${t}`,
|
|
76
|
+
Check the API status: https://status.openai.com`),new S(o)}return JSON.parse(r)},Yi=e=>e.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1"),Ji=e=>Array.from(new Set(e)),Xi=(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}`,Fn=async(e,t,n,u,r,o)=>{const s=Xi(n,u);try{const D=await Vi(e,{model:t,messages:[{role:"user",content:s}],temperature:.7,top_p:1,frequency_penalty:0,presence_penalty:0,max_tokens:200,stream:!1,n:r},o);return Ji(D.choices.filter(i=>i.message?.content).map(i=>Yi(i.message.content)))}catch(D){const i=D;throw i.code==="ENOTFOUND"?new S(`Error connecting to ${i.hostname} (${i.syscall}). Are you connected to the internet?`):i}};var Zi=async(e,t,n,u)=>(async()=>{Ju(Gu(Nu(" aicommits "))),await Xu();const r=pt();n&&await ue("git",["add","--all"]),r.start("Detecting staged files");const o=await Qu(t);if(!o)throw r.stop("Detecting staged files"),new S("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");r.stop(`${pi(o.files)}:
|
|
78
78
|
${o.files.map(a=>` ${a}`).join(`
|
|
79
|
-
`)}`);const{env:s}=process,
|
|
79
|
+
`)}`);const{env:s}=process,D=await Et({OPENAI_KEY:s.OPENAI_KEY||s.OPENAI_API_KEY,proxy:s.https_proxy||s.HTTPS_PROXY||s.http_proxy||s.HTTP_PROXY,generate:e?.toString()}),i=pt();i.start("The AI is analyzing your changes");let l;try{l=await Fn(D.OPENAI_KEY,D.model,D.locale,o.diff,D.generate,D.proxy)}finally{i.stop("Changes analyzed")}if(l.length===0)throw new S("No commit messages were generated. Try again.");let f;if(l.length===1){[f]=l;const a=await fi({message:`Use this commit message?
|
|
80
80
|
|
|
81
81
|
${f}
|
|
82
|
-
`});if(!a||
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
${r.map(
|
|
86
|
-
`)}`):(s+=`# Edit the message below and commit:
|
|
87
|
-
|
|
82
|
+
`});if(!a||qu(a)){V("Commit cancelled");return}}else{const a=await di({message:`Pick a commit message to use: ${st("(Ctrl+c to exit)")}`,options:l.map(c=>({label:c,value:c}))});if(qu(a)){V("Commit cancelled");return}f=a}await ue("git",["commit","-m",f,...u]),V(`${Be("\u2714")} Successfully committed!`)})().catch(r=>{V(`${we("\u2716")} ${r.message}`),ve(r),process.exit(1)});const[It,Qi]=process.argv.slice(2);var eD=()=>(async()=>{if(!It)throw new S('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(Qi)return;const e=await Qu();if(!e)return;Ju(Gu(Nu(" aicommits ")));const{env:t}=process,n=await Et({proxy:t.https_proxy||t.HTTPS_PROXY||t.http_proxy||t.HTTP_PROXY}),u=pt();u.start("The AI is analyzing your changes");let r;try{r=await Fn(n.OPENAI_KEY,n.model,n.locale,e.diff,n.generate,n.proxy)}finally{u.stop("Changes analyzed")}const s=await O.readFile(It,"utf8")!=="",D=r.length>1;let i="";s&&(i=`# \u{1F916} AI generated commit${D?"s":""}
|
|
83
|
+
`),D?(s&&(i+=`# Select one of the following messages by uncommeting:
|
|
84
|
+
`),i+=`
|
|
85
|
+
${r.map(l=>`# ${l}`).join(`
|
|
86
|
+
`)}`):(s&&(i+=`# Edit the message below and commit:
|
|
87
|
+
`),i+=`
|
|
88
88
|
${r[0]}
|
|
89
|
-
`),await O.appendFile(
|
|
89
|
+
`),await O.appendFile(It,i),V(`${Be("\u2714")} Saved commit message!`)})().catch(e=>{V(`${we("\u2716")} ${e.message}`),ve(e),process.exit(1)}),tD=Du({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:t,keyValue:n}=e._;if(t==="get"){const u=await Et();for(const r of n)on(u,r)&&console.log(`${r}=${u[r]}`);return}if(t==="set"){await mi(n.map(u=>u.split("=")));return}throw new S(`Invalid mode: ${t}`)})().catch(t=>{console.error(`${we("\u2716")} ${t.message}`),ve(t),process.exit(1)})});const gn="prepare-commit-msg",T=`.git/hooks/${gn}`,Ie=Rn(new URL("cli.mjs",import.meta.url)),uD=process.argv[1].replace(/\\/g,"/").endsWith(`/${T}`),En=process.platform==="win32",yn=`
|
|
90
|
+
#!/usr/bin/env node
|
|
91
|
+
import(${JSON.stringify(kn(Ie))})
|
|
92
|
+
`.trim();var nD=Du({name:"hook",parameters:["<install/uninstall>"]},e=>{(async()=>{await Xu();const{installUninstall:t}=e._,n=await rn(T);if(t==="install"){if(n){if(await O.realpath(T).catch(()=>{})===Ie){console.warn("The hook is already installed");return}throw new S(`A different ${gn} hook seems to be installed. Please remove it before installing aicommits.`)}await O.mkdir(X.dirname(T),{recursive:!0}),En?await O.writeFile(T,yn):(await O.symlink(Ie,T,"file"),await O.chmod(T,493)),console.log(`${Be("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!n){console.warn("Hook is not installed");return}if(En){if(await O.readFile(T,"utf8")!==yn){console.warn("Hook is not installed");return}}else if(await O.realpath(T)!==Ie){console.warn("Hook is not installed");return}await O.rm(T),console.log(`${Be("\u2714")} Hook uninstalled`);return}throw new S(`Invalid mode: ${t}`)})().catch(t=>{console.error(`${we("\u2716")} ${t.message}`),ve(t),process.exit(1)})});const bn=process.argv.slice(2);to({name:"aicommits",version:au,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"},all:{type:Boolean,description:"Automatically stage changes in tracked files for the commit",alias:"a",default:!1}},commands:[tD,nD],help:{description:uo},ignoreArgv:e=>e==="unknown-flag"||e==="argument"},e=>{uD?eD():Zi(e.flags.generate,e.flags.exclude,e.flags.all,bn)},bn);
|