@sugarmo/aicommits 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +387 -0
- package/dist/cli-2IldWz4f.mjs +217 -0
- package/dist/cli-B4CzHGlw.mjs +217 -0
- package/dist/cli-BLeSI0RG.mjs +217 -0
- package/dist/cli-BxYoCO_t.mjs +217 -0
- package/dist/cli-BxoTG54R.mjs +217 -0
- package/dist/cli-D5LKS_gV.mjs +214 -0
- package/dist/cli-DOlOxITZ.mjs +217 -0
- package/dist/cli-Dghc1HXo.mjs +217 -0
- package/dist/cli-DhEhfPVj.mjs +217 -0
- package/dist/cli-DoRxvV2c.mjs +214 -0
- package/dist/cli-VKXKWT-J.mjs +217 -0
- package/dist/cli-ZGc9mt4a.mjs +217 -0
- package/dist/cli.mjs +126 -0
- package/dist/token-BGl6xBJo.mjs +1 -0
- package/dist/token-BHAr8BGF.mjs +1 -0
- package/dist/token-BNKPepq2.mjs +1 -0
- package/dist/token-BU4WbpuT.mjs +1 -0
- package/dist/token-BgWUvNvl.mjs +1 -0
- package/dist/token-Bitulk9b.mjs +1 -0
- package/dist/token-C-_ybS1T.mjs +1 -0
- package/dist/token-D9tzl7Yz.mjs +1 -0
- package/dist/token-DSxWyl39.mjs +1 -0
- package/dist/token-Dqj85-rE.mjs +1 -0
- package/dist/token-pFVbzMqR.mjs +1 -0
- package/dist/token-util-12Sgwcw5.mjs +1 -0
- package/dist/token-util-BK5iblfw.mjs +1 -0
- package/dist/token-util-BNtjmkiu.mjs +1 -0
- package/dist/token-util-Bezp8Ra7.mjs +1 -0
- package/dist/token-util-BthbkaNP.mjs +1 -0
- package/dist/token-util-C-S1NtRU.mjs +1 -0
- package/dist/token-util-C08UmjgT.mjs +1 -0
- package/dist/token-util-C9k-Ose8.mjs +1 -0
- package/dist/token-util-CIaGUPau.mjs +1 -0
- package/dist/token-util-CghlsVgF.mjs +1 -0
- package/dist/token-util-Cm6RjjS1.mjs +1 -0
- package/dist/token-util-CnZZ1AJv.mjs +1 -0
- package/dist/token-util-CtBubgF8.mjs +1 -0
- package/dist/token-util-CzaKG7us.mjs +1 -0
- package/dist/token-util-D4W-wT_B.mjs +1 -0
- package/dist/token-util-DYebtoan.mjs +1 -0
- package/dist/token-util-Db6xqzh1.mjs +1 -0
- package/dist/token-util-Dg8-JbHb.mjs +1 -0
- package/dist/token-util-DtOpdBbh.mjs +1 -0
- package/dist/token-util-Hi0Y_OJ1.mjs +1 -0
- package/dist/token-util-Z9AnE2k6.mjs +1 -0
- package/dist/token-util-daVwaNP6.mjs +1 -0
- package/dist/token-util-r02UdbTi.mjs +1 -0
- package/dist/token-util-yhghfNwd.mjs +1 -0
- package/dist/token-xhtueDQA.mjs +1 -0
- package/package.json +87 -0
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import Ue from"tty";import{Buffer as ln}from"node:buffer";import X from"node:path";import Zu,{ChildProcess as fn}from"node:child_process";import T,{stdin as Fn,stdout as Cn}from"node:process";import dn from"child_process";import W from"path";import We from"fs";import{fileURLToPath as Xu}from"node:url";import pn,{constants as Qu}from"node:os";import et from"assert";import ut from"events";import{createWriteStream as mn,createReadStream as hn}from"node:fs";import En from"buffer";import qe from"stream";import tt from"util";import{debuglog as gn}from"node:util";import Dt from"node:readline";import{WriteStream as yn}from"node:tty";import j from"fs/promises";import we from"os";import Bn from"https";import bn from"net";import wn from"tls";import An,{fileURLToPath as vn,pathToFileURL as $n}from"url";const xn="known-flag",Sn="unknown-flag",Tn="argument",{stringify:se}=JSON,On=/\B([A-Z])/g,Pn=e=>e.replace(On,"-$1").toLowerCase(),{hasOwnProperty:In}=Object.prototype,ie=(e,u)=>In.call(e,u),kn=e=>Array.isArray(e),nt=e=>typeof e=="function"?[e,!1]:kn(e)?[e[0],!0]:nt(e.type),Mn=(e,u)=>e===Boolean?u!=="false":u,Rn=(e,u)=>typeof u=="boolean"?u:e===Number&&u===""?Number.NaN:e(u),jn=/[\s.:=]/,_n=e=>{const u=`Flag name ${se(e)}`;if(e.length===0)throw new Error(`${u} cannot be empty`);if(e.length===1)throw new Error(`${u} must be longer than a character`);const t=e.match(jn);if(t)throw new Error(`${u} cannot contain ${se(t?.[0])}`)},Ln=e=>{const u={},t=(D,r)=>{if(ie(u,D))throw new Error(`Duplicate flags named ${se(D)}`);u[D]=r};for(const D in e){if(!ie(e,D))continue;_n(D);const r=e[D],o=[[],...nt(r),r];t(D,o);const n=Pn(D);if(D!==n&&t(n,o),"alias"in r&&typeof r.alias=="string"){const{alias:s}=r,i=`Flag alias ${se(s)} for flag ${se(D)}`;if(s.length===0)throw new Error(`${i} cannot be empty`);if(s.length>1)throw new Error(`${i} must be a single character`);t(s,o)}}return u},Nn=(e,u)=>{const t={};for(const D in e){if(!ie(e,D))continue;const[r,,o,n]=u[D];if(r.length===0&&"default"in n){let{default:s}=n;typeof s=="function"&&(s=s()),t[D]=s}else t[D]=o?r:r.pop()}return t},Ae="--",Gn=/[.:=]/,zn=/^-{1,2}\w/,Un=e=>{if(!zn.test(e))return;const u=!e.startsWith(Ae);let t=e.slice(u?1:2),D;const r=t.match(Gn);if(r){const{index:o}=r;D=t.slice(o+1),t=t.slice(0,o)}return[t,D,u]},Wn=(e,{onFlag:u,onArgument:t})=>{let D;const r=(o,n)=>{if(typeof D!="function")return!0;D(o,n),D=void 0};for(let o=0;o<e.length;o+=1){const n=e[o];if(n===Ae){r();const i=e.slice(o+1);t?.(i,[o],!0);break}const s=Un(n);if(s){if(r(),!u)continue;const[i,a,f]=s;if(f)for(let c=0;c<i.length;c+=1){r();const l=c===i.length-1;D=u(i[c],l?a:void 0,[o,c+1,l])}else D=u(i,a,[o])}else r(n,[o])&&t?.([n],[o])}r()},qn=(e,u)=>{for(const[t,D,r]of u.reverse()){if(D){const o=e[t];let n=o.slice(0,D);if(r||(n+=o.slice(D+1)),n!=="-"){e[t]=n;continue}}e.splice(t,1)}},Hn=(e,u=process.argv.slice(2),{ignore:t}={})=>{const D=[],r=Ln(e),o={},n=[];return n[Ae]=[],Wn(u,{onFlag(s,i,a){const f=ie(r,s);if(!t?.(f?xn:Sn,s,i)){if(f){const[c,l]=r[s],F=Mn(l,i),C=(d,p)=>{D.push(a),p&&D.push(p),c.push(Rn(l,d||""))};return F===void 0?C:C(F)}ie(o,s)||(o[s]=[]),o[s].push(i===void 0?!0:i),D.push(a)}},onArgument(s,i,a){t?.(Tn,u[i[0]])||(n.push(...s),a?(n[Ae]=s,u.splice(i[0])):D.push(i))}}),qn(u,D),{flags:Nn(e,r),unknownFlags:o,_:n}};var Vn=Object.create,ve=Object.defineProperty,Kn=Object.defineProperties,Jn=Object.getOwnPropertyDescriptor,Yn=Object.getOwnPropertyDescriptors,Zn=Object.getOwnPropertyNames,rt=Object.getOwnPropertySymbols,Xn=Object.getPrototypeOf,ot=Object.prototype.hasOwnProperty,Qn=Object.prototype.propertyIsEnumerable,st=(e,u,t)=>u in e?ve(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,$e=(e,u)=>{for(var t in u||(u={}))ot.call(u,t)&&st(e,t,u[t]);if(rt)for(var t of rt(u))Qn.call(u,t)&&st(e,t,u[t]);return e},He=(e,u)=>Kn(e,Yn(u)),er=e=>ve(e,"__esModule",{value:!0}),ur=(e,u)=>()=>(e&&(u=e(e=0)),u),tr=(e,u)=>()=>(u||e((u={exports:{}}).exports,u),u.exports),Dr=(e,u,t,D)=>{if(u&&typeof u=="object"||typeof u=="function")for(let r of Zn(u))!ot.call(e,r)&&(t||r!=="default")&&ve(e,r,{get:()=>u[r],enumerable:!(D=Jn(u,r))||D.enumerable});return e},nr=(e,u)=>Dr(er(ve(e!=null?Vn(Xn(e)):{},"default",!u&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),R=ur(()=>{}),rr=tr((e,u)=>{R(),u.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});R(),R(),R();var or=e=>{var u,t,D;let r=(u=process.stdout.columns)!=null?u:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(r)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:r}:{columns:(t=e.columns)!=null?t:[],stdoutColumns:(D=e.stdoutColumns)!=null?D:r}};R(),R(),R(),R(),R();function sr({onlyFirst:e=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,e?void 0:"g")}function it(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(sr(),"")}R();function ir(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 ar=nr(rr(),1);function V(e){if(typeof e!="string"||e.length===0||(e=it(e),e.length===0))return 0;e=e.replace((0,ar.default)()," ");let u=0;for(let t=0;t<e.length;t++){let D=e.codePointAt(t);D<=31||D>=127&&D<=159||D>=768&&D<=879||(D>65535&&t++,u+=ir(D)?2:1)}return u}var at=e=>Math.max(...e.split(`
|
|
3
|
+
`).map(V)),cr=e=>{let u=[];for(let t of e){let{length:D}=t,r=D-u.length;for(let o=0;o<r;o+=1)u.push(0);for(let o=0;o<D;o+=1){let n=at(t[o]);n>u[o]&&(u[o]=n)}}return u};R();var ct=/^\d+%$/,lt={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},lr=(e,u)=>{var t;let D=[];for(let r=0;r<e.length;r+=1){let o=(t=u[r])!=null?t:"auto";if(typeof o=="number"||o==="auto"||o==="content-width"||typeof o=="string"&&ct.test(o)){D.push(He($e({},lt),{width:o,contentWidth:e[r]}));continue}if(o&&typeof o=="object"){let n=He($e($e({},lt),o),{contentWidth:e[r]});n.horizontalPadding=n.paddingLeft+n.paddingRight,D.push(n);continue}throw new Error(`Invalid column width: ${JSON.stringify(o)}`)}return D};function fr(e,u){for(let t of e){let{width:D}=t;if(D==="content-width"&&(t.width=t.contentWidth),D==="auto"){let i=Math.min(20,t.contentWidth);t.width=i,t.autoOverflow=t.contentWidth-i}if(typeof D=="string"&&ct.test(D)){let i=Number.parseFloat(D.slice(0,-1))/100;t.width=Math.floor(u*i)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:r}=t,o=1,n=o+r;if(n>=u){let i=n-u,a=Math.ceil(t.paddingLeft/r*i),f=i-a;t.paddingLeft-=a,t.paddingRight-=f,t.horizontalPadding=t.paddingLeft+t.paddingRight}t.paddingLeftString=t.paddingLeft?" ".repeat(t.paddingLeft):"",t.paddingRightString=t.paddingRight?" ".repeat(t.paddingRight):"";let s=u-t.horizontalPadding;t.width=Math.max(Math.min(t.width,s),o)}}var ft=()=>Object.assign([],{columns:0});function Fr(e,u){let t=[ft()],[D]=t;for(let r of e){let o=r.width+r.horizontalPadding;D.columns+o>u&&(D=ft(),t.push(D)),D.push(r),D.columns+=o}for(let r of t){let o=r.reduce((l,F)=>l+F.width+F.horizontalPadding,0),n=u-o;if(n===0)continue;let s=r.filter(l=>"autoOverflow"in l),i=s.filter(l=>l.autoOverflow>0),a=i.reduce((l,F)=>l+F.autoOverflow,0),f=Math.min(a,n);for(let l of i){let F=Math.floor(l.autoOverflow/a*f);l.width+=F,n-=F}let c=Math.floor(n/s.length);for(let l=0;l<s.length;l+=1){let F=s[l];l===s.length-1?F.width+=n:F.width+=c,n-=c}}return t}function Cr(e,u,t){let D=lr(t,u);return fr(D,e),Fr(D,e)}R(),R(),R();var Ve=10,Ft=(e=0)=>u=>`\x1B[${u+e}m`,Ct=(e=0)=>u=>`\x1B[${38+e};5;${u}m`,dt=(e=0)=>(u,t,D)=>`\x1B[${38+e};2;${u};${t};${D}m`;function dr(){let e=new Map,u={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(let[t,D]of Object.entries(u)){for(let[r,o]of Object.entries(D))u[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},D[r]=u[r],e.set(o[0],o[1]);Object.defineProperty(u,t,{value:D,enumerable:!1})}return Object.defineProperty(u,"codes",{value:e,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi=Ft(),u.color.ansi256=Ct(),u.color.ansi16m=dt(),u.bgColor.ansi=Ft(Ve),u.bgColor.ansi256=Ct(Ve),u.bgColor.ansi16m=dt(Ve),Object.defineProperties(u,{rgbToAnsi256:{value:(t,D,r)=>t===D&&D===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(D/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{let D=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!D)return[0,0,0];let{colorString:r}=D.groups;r.length===3&&(r=r.split("").map(n=>n+n).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>u.rgbToAnsi256(...u.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let D,r,o;if(t>=232)D=((t-232)*10+8)/255,r=D,o=D;else{t-=16;let i=t%36;D=Math.floor(t/36)/5,r=Math.floor(i/6)/5,o=i%6/5}let n=Math.max(D,r,o)*2;if(n===0)return 30;let s=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(D));return n===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,D,r)=>u.ansi256ToAnsi(u.rgbToAnsi256(t,D,r)),enumerable:!1},hexToAnsi:{value:t=>u.ansi256ToAnsi(u.hexToAnsi256(t)),enumerable:!1}}),u}var pr=dr(),mr=pr,xe=new Set(["\x1B","\x9B"]),hr=39,Ke="\x07",pt="[",Er="]",mt="m",Je=`${Er}8;;`,ht=e=>`${xe.values().next().value}${pt}${e}${mt}`,Et=e=>`${xe.values().next().value}${Je}${e}${Ke}`,gr=e=>e.split(" ").map(u=>V(u)),Ye=(e,u,t)=>{let D=[...u],r=!1,o=!1,n=V(it(e[e.length-1]));for(let[s,i]of D.entries()){let a=V(i);if(n+a<=t?e[e.length-1]+=i:(e.push(i),n=0),xe.has(i)&&(r=!0,o=D.slice(s+1).join("").startsWith(Je)),r){o?i===Ke&&(r=!1,o=!1):i===mt&&(r=!1);continue}n+=a,n===t&&s<D.length-1&&(e.push(""),n=0)}!n&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},yr=e=>{let u=e.split(" "),t=u.length;for(;t>0&&!(V(u[t-1])>0);)t--;return t===u.length?e:u.slice(0,t).join(" ")+u.slice(t).join("")},Br=(e,u,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let D="",r,o,n=gr(e),s=[""];for(let[a,f]of e.split(" ").entries()){t.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let c=V(s[s.length-1]);if(a!==0&&(c>=u&&(t.wordWrap===!1||t.trim===!1)&&(s.push(""),c=0),(c>0||t.trim===!1)&&(s[s.length-1]+=" ",c++)),t.hard&&n[a]>u){let l=u-c,F=1+Math.floor((n[a]-l-1)/u);Math.floor((n[a]-1)/u)<F&&s.push(""),Ye(s,f,u);continue}if(c+n[a]>u&&c>0&&n[a]>0){if(t.wordWrap===!1&&c<u){Ye(s,f,u);continue}s.push("")}if(c+n[a]>u&&t.wordWrap===!1){Ye(s,f,u);continue}s[s.length-1]+=f}t.trim!==!1&&(s=s.map(a=>yr(a)));let i=[...s.join(`
|
|
4
|
+
`)];for(let[a,f]of i.entries()){if(D+=f,xe.has(f)){let{groups:l}=new RegExp(`(?:\\${pt}(?<code>\\d+)m|\\${Je}(?<uri>.*)${Ke})`).exec(i.slice(a).join(""))||{groups:{}};if(l.code!==void 0){let F=Number.parseFloat(l.code);r=F===hr?void 0:F}else l.uri!==void 0&&(o=l.uri.length===0?void 0:l.uri)}let c=mr.codes.get(Number(r));i[a+1]===`
|
|
5
|
+
`?(o&&(D+=Et("")),r&&c&&(D+=ht(c))):f===`
|
|
6
|
+
`&&(r&&c&&(D+=ht(r)),o&&(D+=Et(o)))}return D};function br(e,u,t){return String(e).normalize().replace(/\r\n/g,`
|
|
7
|
+
`).split(`
|
|
8
|
+
`).map(D=>Br(D,u,t)).join(`
|
|
9
|
+
`)}var gt=e=>Array.from({length:e}).fill("");function wr(e,u){let t=[],D=0;for(let r of e){let o=0,n=r.map(i=>{var a;let f=(a=u[D])!=null?a:"";D+=1,i.preprocess&&(f=i.preprocess(f)),at(f)>i.width&&(f=br(f,i.width,{hard:!0}));let c=f.split(`
|
|
10
|
+
`);if(i.postprocess){let{postprocess:l}=i;c=c.map((F,C)=>l.call(i,F,C))}return i.paddingTop&&c.unshift(...gt(i.paddingTop)),i.paddingBottom&&c.push(...gt(i.paddingBottom)),c.length>o&&(o=c.length),He($e({},i),{lines:c})}),s=[];for(let i=0;i<o;i+=1){let a=n.map(f=>{var c;let l=(c=f.lines[i])!=null?c:"",F=Number.isFinite(f.width)?" ".repeat(f.width-V(l)):"",C=f.paddingLeftString;return f.align==="right"&&(C+=F),C+=l,f.align==="left"&&(C+=F),C+f.paddingRightString}).join("");s.push(a)}t.push(s.join(`
|
|
11
|
+
`))}return t.join(`
|
|
12
|
+
`)}function Ar(e,u){if(!e||e.length===0)return"";let t=cr(e),D=t.length;if(D===0)return"";let{stdoutColumns:r,columns:o}=or(u);if(o.length>D)throw new Error(`${o.length} columns defined, but only ${D} columns found`);let n=Cr(r,o,t);return e.map(s=>wr(n,s)).join(`
|
|
13
|
+
`)}R();var vr=["<",">","=",">=","<="];function $r(e){if(!vr.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function xr(e){let u=Object.keys(e).map(t=>{let[D,r]=t.split(" ");$r(D);let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new TypeError(`Invalid breakpoint value: ${r}`);let n=e[t];return{operator:D,breakpoint:o,value:n}}).sort((t,D)=>D.breakpoint-t.breakpoint);return t=>{var D;return(D=u.find(({operator:r,breakpoint:o})=>r==="="&&t===o||r===">"&&t>o||r==="<"&&t<o||r===">="&&t>=o||r==="<="&&t<=o))==null?void 0:D.value}}const Sr=e=>e.replace(/[\W_]([a-z\d])?/gi,(u,t)=>t?t.toUpperCase():""),Tr=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),Or={"> 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 Pr(e){let u=!1;return{type:"table",data:{tableData:Object.keys(e).sort((t,D)=>t.localeCompare(D)).map(t=>{const D=e[t],r="alias"in D;return r&&(u=!0),{name:t,flag:D,flagFormatted:`--${Tr(t)}`,aliasesEnabled:u,aliasFormatted:r?`-${D.alias}`:void 0}}).map(t=>(t.aliasesEnabled=u,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:Or}}}const yt=e=>!e||(e.version??(e.help?e.help.version:void 0)),Bt=e=>{const u="parent"in e&&e.parent?.name;return(u?`${u} `:"")+e.name};function Ir(e){const u=[];e.name&&u.push(Bt(e));const t=yt(e)??("parent"in e&&yt(e.parent));if(t&&u.push(`v${t}`),u.length!==0)return{id:"name",type:"text",data:`${u.join(" ")}
|
|
14
|
+
`}}function kr(e){const{help:u}=e;if(!(!u||!u.description))return{id:"description",type:"text",data:`${u.description}
|
|
15
|
+
`}}function Mr(e){const u=e.help||{};if("usage"in u)return u.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(u.usage)?u.usage.join(`
|
|
16
|
+
`):u.usage}}:void 0;if(e.name){const t=[],D=[Bt(e)];if(e.flags&&Object.keys(e.flags).length>0&&D.push("[flags...]"),e.parameters&&e.parameters.length>0){const{parameters:r}=e,o=r.indexOf("--"),n=o>-1&&r.slice(o+1).some(s=>s.startsWith("<"));D.push(r.map(s=>s!=="--"?s:n?"--":"[--]").join(" "))}if(D.length>1&&t.push(D.join(" ")),"commands"in e&&e.commands?.length&&t.push(`${e.name} <command>`),t.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:t.join(`
|
|
17
|
+
`)}}}}function Rr(e){return!("commands"in e)||!e.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:e.commands.map(u=>[u.options.name,u.options.help?u.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function jr(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:Pr(e.flags),indentBody:0}}}function _r(e){const{help:u}=e;if(!u||!u.examples||u.examples.length===0)return;let{examples:t}=u;if(Array.isArray(t)&&(t=t.join(`
|
|
18
|
+
`)),t)return{id:"examples",type:"section",data:{title:"Examples:",body:t}}}function Lr(e){if(!("alias"in e)||!e.alias)return;const{alias:u}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(u)?u.join(", "):u}}}const Nr=e=>[Ir,kr,Mr,Rr,jr,_r,Lr].map(u=>u(e)).filter(Boolean),Gr=Ue.WriteStream.prototype.hasColors();class zr{text(u){return u}bold(u){return Gr?`\x1B[1m${u}\x1B[22m`:u.toLocaleUpperCase()}indentText({text:u,spaces:t}){return u.replace(/^/gm," ".repeat(t))}heading(u){return this.bold(u)}section({title:u,body:t,indentBody:D=2}){return`${(u?`${this.heading(u)}
|
|
19
|
+
`:"")+(t?this.indentText({text:this.render(t),spaces:D}):"")}
|
|
20
|
+
`}table({tableData:u,tableOptions:t,tableBreakpoints:D}){return Ar(u.map(r=>r.map(o=>this.render(o))),D?xr(D):t)}flagParameter(u){return u===Boolean?"":u===String?"<string>":u===Number?"<number>":Array.isArray(u)?this.flagParameter(u[0]):"<value>"}flagOperator(u){return" "}flagName(u){const{flag:t,flagFormatted:D,aliasesEnabled:r,aliasFormatted:o}=u;let n="";if(o?n+=`${o}, `:r&&(n+=" "),n+=D,"placeholder"in t&&typeof t.placeholder=="string")n+=`${this.flagOperator(u)}${t.placeholder}`;else{const s=this.flagParameter("type"in t?t.type:t);s&&(n+=`${this.flagOperator(u)}${s}`)}return n}flagDefault(u){return JSON.stringify(u)}flagDescription({flag:u}){let t="description"in u?u.description??"":"";if("default"in u){let{default:D}=u;typeof D=="function"&&(D=D()),D&&(t+=` (default: ${this.flagDefault(D)})`)}return t}render(u){if(typeof u=="string")return u;if(Array.isArray(u))return u.map(t=>this.render(t)).join(`
|
|
21
|
+
`);if("type"in u&&this[u.type]){const t=this[u.type];if(typeof t=="function")return t.call(this,u.data)}throw new Error(`Invalid node type: ${JSON.stringify(u)}`)}}const Ze=e=>e.length>0&&!e.includes(" "),{stringify:U}=JSON,Ur=/[|\\{}()[\]^$+*?.]/;function Xe(e){const u=[];let t,D;for(const r of e){if(D)throw new Error(`Invalid parameter: Spread parameter ${U(D)} must be last`);const o=r[0],n=r[r.length-1];let s;if(o==="<"&&n===">"&&(s=!0,t))throw new Error(`Invalid parameter: Required parameter ${U(r)} cannot come after optional parameter ${U(t)}`);if(o==="["&&n==="]"&&(s=!1,t=r),s===void 0)throw new Error(`Invalid parameter: ${U(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let i=r.slice(1,-1);const a=i.slice(-3)==="...";a&&(D=r,i=i.slice(0,-3));const f=i.match(Ur);if(f)throw new Error(`Invalid parameter: ${U(r)}. Invalid character found ${U(f[0])}`);u.push({name:i,required:s,spread:a})}return u}function Qe(e,u,t,D){for(let r=0;r<u.length;r+=1){const{name:o,required:n,spread:s}=u[r],i=Sr(o);if(i in e)throw new Error(`Invalid parameter: ${U(o)} is used more than once.`);const a=s?t.slice(r):t[r];if(s&&(r=u.length),n&&(!a||s&&a.length===0))return console.error(`Error: Missing required parameter ${U(o)}
|
|
22
|
+
`),D(),process.exit(1);e[i]=a}}function Wr(e){return e===void 0||e!==!1}function bt(e,u,t,D){const r={...u.flags},o=u.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:n}=u,s=Wr(n);s&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const i=Hn(r,D,{ignore:u.ignoreArgv}),a=()=>{console.log(u.version)};if(o&&i.flags.version===!0)return a(),process.exit(0);const f=new zr,c=s&&n?.render?n.render:C=>f.render(C),l=C=>{const d=Nr({...u,...C?{help:C}:{},flags:r});console.log(c(d,f))};if(s&&i.flags.help===!0)return l(),process.exit(0);if(u.parameters){let{parameters:C}=u,d=i._;const p=C.indexOf("--"),h=C.slice(p+1),y=Object.create(null);if(p>-1&&h.length>0){C=C.slice(0,p);const m=i._["--"];d=d.slice(0,-m.length||void 0),Qe(y,Xe(C),d,l),Qe(y,Xe(h),m,l)}else Qe(y,Xe(C),d,l);Object.assign(i._,y)}const F={...i,showVersion:a,showHelp:l};return typeof t=="function"&&t(F),{command:e,...F}}function qr(e,u){const t=new Map;for(const D of u){const r=[D.options.name],{alias:o}=D.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const n of r){if(t.has(n))throw new Error(`Duplicate command name found: ${U(n)}`);t.set(n,D)}}return t.get(e)}function Hr(e,u,t=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Ze(e.name)))throw new Error(`Invalid script name: ${U(e.name)}`);const D=t[0];if(e.commands&&D&&Ze(D)){const r=qr(D,e.commands);if(r)return bt(r.options.name,{...r.options,parent:e},r.callback,t.slice(1))}return bt(void 0,e,u,t)}function wt(e,u){if(!e)throw new Error("Command options are required");const{name:t}=e;if(t===void 0)throw new Error("Command name is required");if(!Ze(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:e,callback:u}}var Vr="1.12.0",Kr="Writes your git commit messages for you with AI",k=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ee={exports:{}},eu,At;function Jr(){if(At)return eu;At=1,eu=D,D.sync=r;var e=We;function u(o,n){var s=n.pathExt!==void 0?n.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return!0;for(var i=0;i<s.length;i++){var a=s[i].toLowerCase();if(a&&o.substr(-a.length).toLowerCase()===a)return!0}return!1}function t(o,n,s){return!o.isSymbolicLink()&&!o.isFile()?!1:u(n,s)}function D(o,n,s){e.stat(o,function(i,a){s(i,i?!1:t(a,o,n))})}function r(o,n){return t(e.statSync(o),o,n)}return eu}var uu,vt;function Yr(){if(vt)return uu;vt=1,uu=u,u.sync=t;var e=We;function u(o,n,s){e.stat(o,function(i,a){s(i,i?!1:D(a,n))})}function t(o,n){return D(e.statSync(o),n)}function D(o,n){return o.isFile()&&r(o,n)}function r(o,n){var s=o.mode,i=o.uid,a=o.gid,f=n.uid!==void 0?n.uid:process.getuid&&process.getuid(),c=n.gid!==void 0?n.gid:process.getgid&&process.getgid(),l=parseInt("100",8),F=parseInt("010",8),C=parseInt("001",8),d=l|F,p=s&C||s&F&&a===c||s&l&&i===f||s&d&&f===0;return p}return uu}var Se;process.platform==="win32"||k.TESTING_WINDOWS?Se=Jr():Se=Yr();var Zr=tu;tu.sync=Xr;function tu(e,u,t){if(typeof u=="function"&&(t=u,u={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(D,r){tu(e,u||{},function(o,n){o?r(o):D(n)})})}Se(e,u||{},function(D,r){D&&(D.code==="EACCES"||u&&u.ignoreErrors)&&(D=null,r=!1),t(D,r)})}function Xr(e,u){try{return Se.sync(e,u||{})}catch(t){if(u&&u.ignoreErrors||t.code==="EACCES")return!1;throw t}}const ue=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",$t=W,Qr=ue?";":":",xt=Zr,St=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Tt=(e,u)=>{const t=u.colon||Qr,D=e.match(/\//)||ue&&e.match(/\\/)?[""]:[...ue?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(t)],r=ue?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=ue?r.split(t):[""];return ue&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:D,pathExt:o,pathExtExe:r}},Ot=(e,u,t)=>{typeof u=="function"&&(t=u,u={}),u||(u={});const{pathEnv:D,pathExt:r,pathExtExe:o}=Tt(e,u),n=[],s=a=>new Promise((f,c)=>{if(a===D.length)return u.all&&n.length?f(n):c(St(e));const l=D[a],F=/^".*"$/.test(l)?l.slice(1,-1):l,C=$t.join(F,e),d=!F&&/^\.[\\\/]/.test(e)?e.slice(0,2)+C:C;f(i(d,a,0))}),i=(a,f,c)=>new Promise((l,F)=>{if(c===r.length)return l(s(f+1));const C=r[c];xt(a+C,{pathExt:o},(d,p)=>{if(!d&&p)if(u.all)n.push(a+C);else return l(a+C);return l(i(a,f,c+1))})});return t?s(0).then(a=>t(null,a),t):s(0)},eo=(e,u)=>{u=u||{};const{pathEnv:t,pathExt:D,pathExtExe:r}=Tt(e,u),o=[];for(let n=0;n<t.length;n++){const s=t[n],i=/^".*"$/.test(s)?s.slice(1,-1):s,a=$t.join(i,e),f=!i&&/^\.[\\\/]/.test(e)?e.slice(0,2)+a:a;for(let c=0;c<D.length;c++){const l=f+D[c];try{if(xt.sync(l,{pathExt:r}))if(u.all)o.push(l);else return l}catch{}}}if(u.all&&o.length)return o;if(u.nothrow)return null;throw St(e)};var uo=Ot;Ot.sync=eo;var Du={exports:{}};const Pt=(e={})=>{const u=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(u).reverse().find(D=>D.toUpperCase()==="PATH")||"Path"};Du.exports=Pt,Du.exports.default=Pt;var to=Du.exports;const It=W,Do=uo,no=to;function kt(e,u){const t=e.options.env||process.env,D=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 n;try{n=Do.sync(e.command,{path:t[no({env:t})],pathExt:u?It.delimiter:void 0})}catch{}finally{o&&process.chdir(D)}return n&&(n=It.resolve(r?e.options.cwd:"",n)),n}function ro(e){return kt(e)||kt(e,!0)}var oo=ro,nu={};const ru=/([()\][%!^"`<>&|;, *?])/g;function so(e){return e=e.replace(ru,"^$1"),e}function io(e,u){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ru,"^$1"),u&&(e=e.replace(ru,"^$1")),e}nu.command=so,nu.argument=io;var ao=/^#!(.*)/;const co=ao;var lo=(e="")=>{const u=e.match(co);if(!u)return null;const[t,D]=u[0].replace(/#! ?/,"").split(" "),r=t.split("/").pop();return r==="env"?D:D?`${r} ${D}`:r};const ou=We,fo=lo;function Fo(e){const t=Buffer.alloc(150);let D;try{D=ou.openSync(e,"r"),ou.readSync(D,t,0,150,0),ou.closeSync(D)}catch{}return fo(t.toString())}var Co=Fo;const po=W,Mt=oo,Rt=nu,mo=Co,ho=process.platform==="win32",Eo=/\.(?:com|exe)$/i,go=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function yo(e){e.file=Mt(e);const u=e.file&&mo(e.file);return u?(e.args.unshift(e.file),e.command=u,Mt(e)):e.file}function Bo(e){if(!ho)return e;const u=yo(e),t=!Eo.test(u);if(e.options.forceShell||t){const D=go.test(u);e.command=po.normalize(e.command),e.command=Rt.command(e.command),e.args=e.args.map(o=>Rt.argument(o,D));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 bo(e,u,t){u&&!Array.isArray(u)&&(t=u,u=null),u=u?u.slice(0):[],t=Object.assign({},t);const D={command:e,args:u,options:t,file:void 0,original:{command:e,args:u}};return t.shell?D:Bo(D)}var wo=bo;const su=process.platform==="win32";function iu(e,u){return Object.assign(new Error(`${u} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${u} ${e.command}`,path:e.command,spawnargs:e.args})}function Ao(e,u){if(!su)return;const t=e.emit;e.emit=function(D,r){if(D==="exit"){const o=jt(r,u);if(o)return t.call(e,"error",o)}return t.apply(e,arguments)}}function jt(e,u){return su&&e===1&&!u.file?iu(u.original,"spawn"):null}function vo(e,u){return su&&e===1&&!u.file?iu(u.original,"spawnSync"):null}var $o={hookChildProcess:Ao,verifyENOENT:jt,verifyENOENTSync:vo,notFoundError:iu};const _t=dn,au=wo,cu=$o;function Lt(e,u,t){const D=au(e,u,t),r=_t.spawn(D.command,D.args,D.options);return cu.hookChildProcess(r,D),r}function xo(e,u,t){const D=au(e,u,t),r=_t.spawnSync(D.command,D.args,D.options);return r.error=r.error||cu.verifyENOENTSync(r.status,D),r}ee.exports=Lt,ee.exports.spawn=Lt,ee.exports.sync=xo,ee.exports._parse=au,ee.exports._enoent=cu;var So=ee.exports,To=Q(So);function Oo(e){const u=typeof e=="string"?`
|
|
23
|
+
`:`
|
|
24
|
+
`.charCodeAt(),t=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===u&&(e=e.slice(0,-1)),e[e.length-1]===t&&(e=e.slice(0,-1)),e}function Nt(e={}){const{env:u=process.env,platform:t=process.platform}=e;return t!=="win32"?"PATH":Object.keys(u).reverse().find(D=>D.toUpperCase()==="PATH")||"Path"}const Po=({cwd:e=T.cwd(),path:u=T.env[Nt()],preferLocal:t=!0,execPath:D=T.execPath,addExecPath:r=!0}={})=>{const o=e instanceof URL?Xu(e):e,n=X.resolve(o),s=[];return t&&Io(s,n),r&&ko(s,D,n),[...s,u].join(X.delimiter)},Io=(e,u)=>{let t;for(;t!==u;)e.push(X.join(u,"node_modules/.bin")),t=u,u=X.resolve(u,"..")},ko=(e,u,t)=>{const D=u instanceof URL?Xu(u):u;e.push(X.resolve(t,D,".."))},Mo=({env:e=T.env,...u}={})=>{e={...e};const t=Nt({env:e});return u.path=e[t],e[t]=Po(u),e},Ro=(e,u,t,D)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const r=Object.getOwnPropertyDescriptor(e,t),o=Object.getOwnPropertyDescriptor(u,t);!jo(r,o)&&D||Object.defineProperty(e,t,o)},jo=function(e,u){return e===void 0||e.configurable||e.writable===u.writable&&e.enumerable===u.enumerable&&e.configurable===u.configurable&&(e.writable||e.value===u.value)},_o=(e,u)=>{const t=Object.getPrototypeOf(u);t!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,t)},Lo=(e,u)=>`/* Wrapped ${e}*/
|
|
25
|
+
${u}`,No=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Go=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),zo=(e,u,t)=>{const D=t===""?"":`with ${t.trim()}() `,r=Lo.bind(null,D,u.toString());Object.defineProperty(r,"name",Go),Object.defineProperty(e,"toString",{...No,value:r})};function Uo(e,u,{ignoreNonConfigurable:t=!1}={}){const{name:D}=e;for(const r of Reflect.ownKeys(u))Ro(e,u,r,t);return _o(e,u),zo(e,u,D),e}const Te=new WeakMap,Gt=(e,u={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let t,D=0;const r=e.displayName||e.name||"<anonymous>",o=function(...n){if(Te.set(o,++D),D===1)t=e.apply(this,n),e=null;else if(u.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return t};return Uo(o,e),Te.set(o,D),o};Gt.callCount=e=>{if(!Te.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Te.get(e)};const Wo=()=>{const e=Ut-zt+1;return Array.from({length:e},qo)},qo=(e,u)=>({name:`SIGRT${u+1}`,number:zt+u,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),zt=34,Ut=64,Ho=[{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"}],Wt=()=>{const e=Wo();return[...Ho,...e].map(Vo)},Vo=({name:e,number:u,description:t,action:D,forced:r=!1,standard:o})=>{const{signals:{[e]:n}}=Qu,s=n!==void 0;return{name:e,number:s?n:u,description:t,supported:s,action:D,forced:r,standard:o}},Ko=()=>{const e=Wt();return Object.fromEntries(e.map(Jo))},Jo=({name:e,number:u,description:t,supported:D,action:r,forced:o,standard:n})=>[e,{name:e,number:u,description:t,supported:D,action:r,forced:o,standard:n}],Yo=Ko(),Zo=()=>{const e=Wt(),u=Ut+1,t=Array.from({length:u},(D,r)=>Xo(r,e));return Object.assign({},...t)},Xo=(e,u)=>{const t=Qo(e,u);if(t===void 0)return{};const{name:D,description:r,supported:o,action:n,forced:s,standard:i}=t;return{[e]:{name:D,number:e,description:r,supported:o,action:n,forced:s,standard:i}}},Qo=(e,u)=>{const t=u.find(({name:D})=>Qu.signals[D]===e);return t!==void 0?t:u.find(D=>D.number===e)};Zo();const es=({timedOut:e,timeout:u,errorCode:t,signal:D,signalDescription:r,exitCode:o,isCanceled:n})=>e?`timed out after ${u} milliseconds`:n?"was canceled":t!==void 0?`failed with ${t}`:D!==void 0?`was killed with ${D} (${r})`:o!==void 0?`failed with exit code ${o}`:"failed",qt=({stdout:e,stderr:u,all:t,error:D,signal:r,exitCode:o,command:n,escapedCommand:s,timedOut:i,isCanceled:a,killed:f,parsed:{options:{timeout:c,cwd:l=T.cwd()}}})=>{o=o===null?void 0:o,r=r===null?void 0:r;const F=r===void 0?void 0:Yo[r].description,C=D&&D.code,p=`Command ${es({timedOut:i,timeout:c,errorCode:C,signal:r,signalDescription:F,exitCode:o,isCanceled:a})}: ${n}`,h=Object.prototype.toString.call(D)==="[object Error]",y=h?`${p}
|
|
26
|
+
${D.message}`:p,m=[y,u,e].filter(Boolean).join(`
|
|
27
|
+
`);return h?(D.originalMessage=D.message,D.message=m):D=new Error(m),D.shortMessage=y,D.command=n,D.escapedCommand=s,D.exitCode=o,D.signal=r,D.signalDescription=F,D.stdout=e,D.stderr=u,D.cwd=l,t!==void 0&&(D.all=t),"bufferedData"in D&&delete D.bufferedData,D.failed=!0,D.timedOut=!!i,D.isCanceled=a,D.killed=f&&!i,D},Oe=["stdin","stdout","stderr"],us=e=>Oe.some(u=>e[u]!==void 0),ts=e=>{if(!e)return;const{stdio:u}=e;if(u===void 0)return Oe.map(D=>e[D]);if(us(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Oe.map(D=>`\`${D}\``).join(", ")}`);if(typeof u=="string")return u;if(!Array.isArray(u))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof u}\``);const t=Math.max(u.length,Oe.length);return Array.from({length:t},(D,r)=>u[r])};var te={exports:{}},Pe={exports:{}};Pe.exports;var Ht;function Ds(){return Ht||(Ht=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")}(Pe)),Pe.exports}var v=k.process;const K=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(!K(v))te.exports=function(){return function(){}};else{var ns=et,ae=Ds(),rs=/^win/i.test(v.platform),Ie=ut;typeof Ie!="function"&&(Ie=Ie.EventEmitter);var M;v.__signal_exit_emitter__?M=v.__signal_exit_emitter__:(M=v.__signal_exit_emitter__=new Ie,M.count=0,M.emitted={}),M.infinite||(M.setMaxListeners(1/0),M.infinite=!0),te.exports=function(e,u){if(!K(k.process))return function(){};ns.equal(typeof e,"function","a callback must be provided for exit handler"),ce===!1&&Vt();var t="exit";u&&u.alwaysLast&&(t="afterexit");var D=function(){M.removeListener(t,e),M.listeners("exit").length===0&&M.listeners("afterexit").length===0&&lu()};return M.on(t,e),D};var lu=function(){!ce||!K(k.process)||(ce=!1,ae.forEach(function(u){try{v.removeListener(u,fu[u])}catch{}}),v.emit=Fu,v.reallyExit=Kt,M.count-=1)};te.exports.unload=lu;var De=function(u,t,D){M.emitted[u]||(M.emitted[u]=!0,M.emit(u,t,D))},fu={};ae.forEach(function(e){fu[e]=function(){if(K(k.process)){var t=v.listeners(e);t.length===M.count&&(lu(),De("exit",null,e),De("afterexit",null,e),rs&&e==="SIGHUP"&&(e="SIGINT"),v.kill(v.pid,e))}}}),te.exports.signals=function(){return ae};var ce=!1,Vt=function(){ce||!K(k.process)||(ce=!0,M.count+=1,ae=ae.filter(function(u){try{return v.on(u,fu[u]),!0}catch{return!1}}),v.emit=ss,v.reallyExit=os)};te.exports.load=Vt;var Kt=v.reallyExit,os=function(u){K(k.process)&&(v.exitCode=u||0,De("exit",v.exitCode,null),De("afterexit",v.exitCode,null),Kt.call(v,v.exitCode))},Fu=v.emit,ss=function(u,t){if(u==="exit"&&K(k.process)){t!==void 0&&(v.exitCode=t);var D=Fu.apply(this,arguments);return De("exit",v.exitCode,null),De("afterexit",v.exitCode,null),D}else return Fu.apply(this,arguments)}}var is=te.exports,as=Q(is);const cs=1e3*5,ls=(e,u="SIGTERM",t={})=>{const D=e(u);return fs(e,u,t,D),D},fs=(e,u,t,D)=>{if(!Fs(u,t,D))return;const r=ds(t),o=setTimeout(()=>{e("SIGKILL")},r);o.unref&&o.unref()},Fs=(e,{forceKillAfterTimeout:u},t)=>Cs(e)&&u!==!1&&t,Cs=e=>e===pn.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",ds=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return cs;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},ps=(e,u)=>{e.kill()&&(u.isCanceled=!0)},ms=(e,u,t)=>{e.kill(u),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:u}))},hs=(e,{timeout:u,killSignal:t="SIGTERM"},D)=>{if(u===0||u===void 0)return D;let r;const o=new Promise((s,i)=>{r=setTimeout(()=>{ms(e,t,i)},u)}),n=D.finally(()=>{clearTimeout(r)});return Promise.race([o,n])},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})`)},gs=async(e,{cleanup:u,detached:t},D)=>{if(!u||t)return D;const r=as(()=>{e.kill()});return D.finally(()=>{r()})};function Jt(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function Yt(e){return Jt(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}const ys=e=>e instanceof fn&&typeof e.then=="function",Cu=(e,u,t)=>{if(typeof t=="string")return e[u].pipe(mn(t)),e;if(Yt(t))return e[u].pipe(t),e;if(!ys(t))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Yt(t.stdin))throw new TypeError("The target child process's stdin must be available.");return e[u].pipe(t.stdin),t},Bs=e=>{e.stdout!==null&&(e.pipeStdout=Cu.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=Cu.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=Cu.bind(void 0,e,"all"))};var le={exports:{}};const{PassThrough:bs}=qe;var ws=e=>{e={...e};const{array:u}=e;let{encoding:t}=e;const D=t==="buffer";let r=!1;u?r=!(t||D):t=t||"utf8",D&&(t=null);const o=new bs({objectMode:r});t&&o.setEncoding(t);let n=0;const s=[];return o.on("data",i=>{s.push(i),r?n=s.length:n+=i.length}),o.getBufferedValue=()=>u?s:D?Buffer.concat(s,n):s.join(""),o.getBufferedLength=()=>n,o};const{constants:As}=En,vs=qe,{promisify:$s}=tt,xs=ws,Ss=$s(vs.pipeline);class Zt extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function du(e,u){if(!e)throw new Error("Expected a stream");u={maxBuffer:1/0,...u};const{maxBuffer:t}=u,D=xs(u);return await new Promise((r,o)=>{const n=s=>{s&&D.getBufferedLength()<=As.MAX_LENGTH&&(s.bufferedData=D.getBufferedValue()),o(s)};(async()=>{try{await Ss(e,D),r()}catch(s){n(s)}})(),D.on("data",()=>{D.getBufferedLength()>t&&n(new Zt)})}),D.getBufferedValue()}le.exports=du,le.exports.buffer=(e,u)=>du(e,{...u,encoding:"buffer"}),le.exports.array=(e,u)=>du(e,{...u,array:!0}),le.exports.MaxBufferError=Zt;var Ts=le.exports,Xt=Q(Ts);const{PassThrough:Os}=qe;var Ps=function(){var e=[],u=new Os({objectMode:!0});return u.setMaxListeners(0),u.add=t,u.isEmpty=D,u.on("unpipe",r),Array.prototype.slice.call(arguments).forEach(t),u;function t(o){return Array.isArray(o)?(o.forEach(t),this):(e.push(o),o.once("end",r.bind(null,o)),o.once("error",u.emit.bind(u,"error")),o.pipe(u,{end:!1}),this)}function D(){return e.length==0}function r(o){e=e.filter(function(n){return n!==o}),!e.length&&u.readable&&u.end()}},Is=Q(Ps);const ks=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Ms=({input:e,inputFile:u})=>typeof u!="string"?e:(ks(e),hn(u)),Rs=(e,u)=>{const t=Ms(u);t!==void 0&&(Jt(t)?t.pipe(e.stdin):e.stdin.end(t))},js=(e,{all:u})=>{if(!u||!e.stdout&&!e.stderr)return;const t=Is();return e.stdout&&t.add(e.stdout),e.stderr&&t.add(e.stderr),t},pu=async(e,u)=>{if(!(!e||u===void 0)){e.destroy();try{return await u}catch(t){return t.bufferedData}}},mu=(e,{encoding:u,buffer:t,maxBuffer:D})=>{if(!(!e||!t))return u?Xt(e,{encoding:u,maxBuffer:D}):Xt.buffer(e,{maxBuffer:D})},_s=async({stdout:e,stderr:u,all:t},{encoding:D,buffer:r,maxBuffer:o},n)=>{const s=mu(e,{encoding:D,buffer:r,maxBuffer:o}),i=mu(u,{encoding:D,buffer:r,maxBuffer:o}),a=mu(t,{encoding:D,buffer:r,maxBuffer:o*2});try{return await Promise.all([n,s,i,a])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},pu(e,s),pu(u,i),pu(t,a)])}},Ls=(async()=>{})().constructor.prototype,Ns=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Ls,e)]),Qt=(e,u)=>{for(const[t,D]of Ns){const r=typeof u=="function"?(...o)=>Reflect.apply(D.value,u(),o):D.value.bind(u);Reflect.defineProperty(e,t,{...D,value:r})}},Gs=e=>new Promise((u,t)=>{e.on("exit",(D,r)=>{u({exitCode:D,signal:r})}),e.on("error",D=>{t(D)}),e.stdin&&e.stdin.on("error",D=>{t(D)})}),eD=(e,u=[])=>Array.isArray(u)?[e,...u]:[e],zs=/^[\w.-]+$/,Us=/"/g,Ws=e=>typeof e!="string"||zs.test(e)?e:`"${e.replace(Us,'\\"')}"`,qs=(e,u)=>eD(e,u).join(" "),Hs=(e,u)=>eD(e,u).map(t=>Ws(t)).join(" "),Vs=gn("execa").enabled,ke=(e,u)=>String(e).padStart(u,"0"),Ks=()=>{const e=new Date;return`${ke(e.getHours(),2)}:${ke(e.getMinutes(),2)}:${ke(e.getSeconds(),2)}.${ke(e.getMilliseconds(),3)}`},Js=(e,{verbose:u})=>{u&&T.stderr.write(`[${Ks()}] ${e}
|
|
28
|
+
`)},Ys=1e3*1e3*100,Zs=({env:e,extendEnv:u,preferLocal:t,localDir:D,execPath:r})=>{const o=u?{...T.env,...e}:e;return t?Mo({env:o,cwd:D,execPath:r}):o},Xs=(e,u,t={})=>{const D=To._parse(e,u,t);return e=D.command,u=D.args,t=D.options,t={maxBuffer:Ys,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||T.cwd(),execPath:T.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Vs,...t},t.env=Zs(t),t.stdio=ts(t),T.platform==="win32"&&X.basename(e,".exe")==="cmd"&&u.unshift("/q"),{file:e,args:u,options:t,parsed:D}},hu=(e,u,t)=>typeof u!="string"&&!ln.isBuffer(u)?t===void 0?void 0:"":e.stripFinalNewline?Oo(u):u;function ne(e,u,t){const D=Xs(e,u,t),r=qs(e,u),o=Hs(e,u);Js(o,D.options),Es(D.options);let n;try{n=Zu.spawn(D.file,D.args,D.options)}catch(F){const C=new Zu.ChildProcess,d=Promise.reject(qt({error:F,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:D,timedOut:!1,isCanceled:!1,killed:!1}));return Qt(C,d),C}const s=Gs(n),i=hs(n,D.options,s),a=gs(n,D.options,i),f={isCanceled:!1};n.kill=ls.bind(null,n.kill.bind(n)),n.cancel=ps.bind(null,n,f);const l=Gt(async()=>{const[{error:F,exitCode:C,signal:d,timedOut:p},h,y,m]=await _s(n,D.options,a),B=hu(D.options,h),b=hu(D.options,y),I=hu(D.options,m);if(F||C!==0||d!==null){const w=qt({error:F,exitCode:C,signal:d,stdout:B,stderr:b,all:I,command:r,escapedCommand:o,parsed:D,timedOut:p,isCanceled:f.isCanceled||(D.options.signal?D.options.signal.aborted:!1),killed:n.killed});if(!D.options.reject)return w;throw w}return{command:r,escapedCommand:o,exitCode:0,stdout:B,stderr:b,all:I,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Rs(n,D.options),n.all=js(n,D.options),Bs(n),Qt(n,l),n}let J=!0;const re=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let fe=0;if(re.process&&re.process.env&&re.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:u,NO_COLOR:t,TERM:D,COLORTERM:r}=re.process.env;u||t||e==="0"?J=!1:e==="1"||e==="2"||e==="3"?J=!0:D==="dumb"?J=!1:"CI"in re.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in re.process.env)?J=!0:J=process.stdout.isTTY,J&&(process.platform==="win32"||r&&(r==="truecolor"||r==="24bit")?fe=3:D&&(D.endsWith("-256color")||D.endsWith("256"))?fe=2:fe=1)}let uD={enabled:J,supportLevel:fe};function Y(e,u,t=1){const D=`\x1B[${e}m`,r=`\x1B[${u}m`,o=new RegExp(`\\x1b\\[${u}m`,"g");return n=>uD.enabled&&uD.supportLevel>=t?D+(""+n).replace(o,D)+r:""+n}const Fe=Y(2,22),Qs=Y(30,39),Eu=Y(31,39),Me=Y(32,39),ei=Y(35,39),ui=Y(90,39),ti=Y(46,49),gu="\x1B",x=`${gu}[`,Di="\x07",yu={to(e,u){return u?`${x}${u+1};${e+1}H`:`${x}${e+1}G`},move(e,u){let t="";return e<0?t+=`${x}${-e}D`:e>0&&(t+=`${x}${e}C`),u<0?t+=`${x}${-u}A`:u>0&&(t+=`${x}${u}B`),t},up:(e=1)=>`${x}${e}A`,down:(e=1)=>`${x}${e}B`,forward:(e=1)=>`${x}${e}C`,backward:(e=1)=>`${x}${e}D`,nextLine:(e=1)=>`${x}E`.repeat(e),prevLine:(e=1)=>`${x}F`.repeat(e),left:`${x}G`,hide:`${x}?25l`,show:`${x}?25h`,save:`${gu}7`,restore:`${gu}8`},ni={up:(e=1)=>`${x}S`.repeat(e),down:(e=1)=>`${x}T`.repeat(e)},ri={screen:`${x}2J`,up:(e=1)=>`${x}1J`.repeat(e),down:(e=1)=>`${x}J`.repeat(e),line:`${x}2K`,lineEnd:`${x}K`,lineStart:`${x}1K`,lines(e){let u="";for(let t=0;t<e;t++)u+=this.line+(t<e-1?yu.up():"");return e&&(u+=yu.left),u}};var z={cursor:yu,scroll:ni,erase:ri,beep:Di},Bu={exports:{}};let Re=process||{},tD=Re.argv||[],je=Re.env||{},oi=!(je.NO_COLOR||tD.includes("--no-color"))&&(!!je.FORCE_COLOR||tD.includes("--color")||Re.platform==="win32"||(Re.stdout||{}).isTTY&&je.TERM!=="dumb"||!!je.CI),si=(e,u,t=e)=>D=>{let r=""+D,o=r.indexOf(u,e.length);return~o?e+ii(r,u,t,o)+u:e+r+u},ii=(e,u,t,D)=>{let r="",o=0;do r+=e.substring(o,D)+t,o=D+u.length,D=e.indexOf(u,o);while(~D);return r+e.substring(o)},DD=(e=oi)=>{let u=e?si:()=>String;return{isColorSupported:e,reset:u("\x1B[0m","\x1B[0m"),bold:u("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:u("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:u("\x1B[3m","\x1B[23m"),underline:u("\x1B[4m","\x1B[24m"),inverse:u("\x1B[7m","\x1B[27m"),hidden:u("\x1B[8m","\x1B[28m"),strikethrough:u("\x1B[9m","\x1B[29m"),black:u("\x1B[30m","\x1B[39m"),red:u("\x1B[31m","\x1B[39m"),green:u("\x1B[32m","\x1B[39m"),yellow:u("\x1B[33m","\x1B[39m"),blue:u("\x1B[34m","\x1B[39m"),magenta:u("\x1B[35m","\x1B[39m"),cyan:u("\x1B[36m","\x1B[39m"),white:u("\x1B[37m","\x1B[39m"),gray:u("\x1B[90m","\x1B[39m"),bgBlack:u("\x1B[40m","\x1B[49m"),bgRed:u("\x1B[41m","\x1B[49m"),bgGreen:u("\x1B[42m","\x1B[49m"),bgYellow:u("\x1B[43m","\x1B[49m"),bgBlue:u("\x1B[44m","\x1B[49m"),bgMagenta:u("\x1B[45m","\x1B[49m"),bgCyan:u("\x1B[46m","\x1B[49m"),bgWhite:u("\x1B[47m","\x1B[49m"),blackBright:u("\x1B[90m","\x1B[39m"),redBright:u("\x1B[91m","\x1B[39m"),greenBright:u("\x1B[92m","\x1B[39m"),yellowBright:u("\x1B[93m","\x1B[39m"),blueBright:u("\x1B[94m","\x1B[39m"),magentaBright:u("\x1B[95m","\x1B[39m"),cyanBright:u("\x1B[96m","\x1B[39m"),whiteBright:u("\x1B[97m","\x1B[39m"),bgBlackBright:u("\x1B[100m","\x1B[49m"),bgRedBright:u("\x1B[101m","\x1B[49m"),bgGreenBright:u("\x1B[102m","\x1B[49m"),bgYellowBright:u("\x1B[103m","\x1B[49m"),bgBlueBright:u("\x1B[104m","\x1B[49m"),bgMagentaBright:u("\x1B[105m","\x1B[49m"),bgCyanBright:u("\x1B[106m","\x1B[49m"),bgWhiteBright:u("\x1B[107m","\x1B[49m")}};Bu.exports=DD(),Bu.exports.createColors=DD;var ai=Bu.exports,E=Q(ai);function ci({onlyFirst:e=!1}={}){const u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(u,e?void 0:"g")}const li=ci();function nD(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(li,"")}function rD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oD={exports:{}};(function(e){var u={};e.exports=u,u.eastAsianWidth=function(D){var r=D.charCodeAt(0),o=D.length==2?D.charCodeAt(1):0,n=r;return 55296<=r&&r<=56319&&56320<=o&&o<=57343&&(r&=1023,o&=1023,n=r<<10|o,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n==9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n==9711||9733<=n&&n<=9734||n==9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n==9756||n==9758||n==9792||n==9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n==9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n==9955||9960<=n&&n<=9983||n==10045||n==10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n==65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},u.characterLength=function(D){var r=this.eastAsianWidth(D);return r=="F"||r=="W"||r=="A"?2:1};function t(D){return D.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(D){for(var r=t(D),o=0,n=0;n<r.length;n++)o=o+this.characterLength(r[n]);return o},u.slice=function(D,r,o){textLen=u.length(D),r=r||0,o=o||1,r<0&&(r=textLen+r),o<0&&(o=textLen+o);for(var n="",s=0,i=t(D),a=0;a<i.length;a++){var f=i[a],c=u.length(f);if(s>=r-(c==2?1:0))if(s+c<=o)n+=f;else break;s+=c}return n}})(oD);var fi=oD.exports;const Fi=rD(fi);var Ci=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};const di=rD(Ci);function Ce(e,u={}){if(typeof e!="string"||e.length===0||(u={ambiguousIsNarrow:!0,...u},e=nD(e),e.length===0))return 0;e=e.replace(di()," ");const t=u.ambiguousIsNarrow?1:2;let D=0;for(const r of e){const o=r.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(Fi.eastAsianWidth(r)){case"F":case"W":D+=2;break;case"A":D+=t;break;default:D+=1}}return D}const bu=10,sD=(e=0)=>u=>`\x1B[${u+e}m`,iD=(e=0)=>u=>`\x1B[${38+e};5;${u}m`,aD=(e=0)=>(u,t,D)=>`\x1B[${38+e};2;${u};${t};${D}m`,$={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys($.modifier);const pi=Object.keys($.color),mi=Object.keys($.bgColor);[...pi,...mi];function hi(){const e=new Map;for(const[u,t]of Object.entries($)){for(const[D,r]of Object.entries(t))$[D]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},t[D]=$[D],e.set(r[0],r[1]);Object.defineProperty($,u,{value:t,enumerable:!1})}return Object.defineProperty($,"codes",{value:e,enumerable:!1}),$.color.close="\x1B[39m",$.bgColor.close="\x1B[49m",$.color.ansi=sD(),$.color.ansi256=iD(),$.color.ansi16m=aD(),$.bgColor.ansi=sD(bu),$.bgColor.ansi256=iD(bu),$.bgColor.ansi16m=aD(bu),Object.defineProperties($,{rgbToAnsi256:{value:(u,t,D)=>u===t&&t===D?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(t/255*5)+Math.round(D/255*5),enumerable:!1},hexToRgb:{value:u=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!t)return[0,0,0];let[D]=t;D.length===3&&(D=[...D].map(o=>o+o).join(""));const r=Number.parseInt(D,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:u=>$.rgbToAnsi256(...$.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let t,D,r;if(u>=232)t=((u-232)*10+8)/255,D=t,r=t;else{u-=16;const s=u%36;t=Math.floor(u/36)/5,D=Math.floor(s/6)/5,r=s%6/5}const o=Math.max(t,D,r)*2;if(o===0)return 30;let n=30+(Math.round(r)<<2|Math.round(D)<<1|Math.round(t));return o===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(u,t,D)=>$.ansi256ToAnsi($.rgbToAnsi256(u,t,D)),enumerable:!1},hexToAnsi:{value:u=>$.ansi256ToAnsi($.hexToAnsi256(u)),enumerable:!1}}),$}const Ei=hi(),_e=new Set(["\x1B","\x9B"]),gi=39,wu="\x07",cD="[",yi="]",lD="m",Au=`${yi}8;;`,fD=e=>`${_e.values().next().value}${cD}${e}${lD}`,FD=e=>`${_e.values().next().value}${Au}${e}${wu}`,Bi=e=>e.split(" ").map(u=>Ce(u)),vu=(e,u,t)=>{const D=[...u];let r=!1,o=!1,n=Ce(nD(e[e.length-1]));for(const[s,i]of D.entries()){const a=Ce(i);if(n+a<=t?e[e.length-1]+=i:(e.push(i),n=0),_e.has(i)&&(r=!0,o=D.slice(s+1).join("").startsWith(Au)),r){o?i===wu&&(r=!1,o=!1):i===lD&&(r=!1);continue}n+=a,n===t&&s<D.length-1&&(e.push(""),n=0)}!n&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},bi=e=>{const u=e.split(" ");let t=u.length;for(;t>0&&!(Ce(u[t-1])>0);)t--;return t===u.length?e:u.slice(0,t).join(" ")+u.slice(t).join("")},wi=(e,u,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let D="",r,o;const n=Bi(e);let s=[""];for(const[a,f]of e.split(" ").entries()){t.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let c=Ce(s[s.length-1]);if(a!==0&&(c>=u&&(t.wordWrap===!1||t.trim===!1)&&(s.push(""),c=0),(c>0||t.trim===!1)&&(s[s.length-1]+=" ",c++)),t.hard&&n[a]>u){const l=u-c,F=1+Math.floor((n[a]-l-1)/u);Math.floor((n[a]-1)/u)<F&&s.push(""),vu(s,f,u);continue}if(c+n[a]>u&&c>0&&n[a]>0){if(t.wordWrap===!1&&c<u){vu(s,f,u);continue}s.push("")}if(c+n[a]>u&&t.wordWrap===!1){vu(s,f,u);continue}s[s.length-1]+=f}t.trim!==!1&&(s=s.map(a=>bi(a)));const i=[...s.join(`
|
|
29
|
+
`)];for(const[a,f]of i.entries()){if(D+=f,_e.has(f)){const{groups:l}=new RegExp(`(?:\\${cD}(?<code>\\d+)m|\\${Au}(?<uri>.*)${wu})`).exec(i.slice(a).join(""))||{groups:{}};if(l.code!==void 0){const F=Number.parseFloat(l.code);r=F===gi?void 0:F}else l.uri!==void 0&&(o=l.uri.length===0?void 0:l.uri)}const c=Ei.codes.get(Number(r));i[a+1]===`
|
|
30
|
+
`?(o&&(D+=FD("")),r&&c&&(D+=fD(c))):f===`
|
|
31
|
+
`&&(r&&c&&(D+=fD(r)),o&&(D+=FD(o)))}return D};function CD(e,u,t){return String(e).normalize().replace(/\r\n/g,`
|
|
32
|
+
`).split(`
|
|
33
|
+
`).map(D=>wi(D,u,t)).join(`
|
|
34
|
+
`)}var Ai=Object.defineProperty,vi=(e,u,t)=>u in e?Ai(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,N=(e,u,t)=>(vi(e,typeof u!="symbol"?u+"":u,t),t);function $i(e,u){if(e===u)return;const t=e.split(`
|
|
35
|
+
`),D=u.split(`
|
|
36
|
+
`),r=[];for(let o=0;o<Math.max(t.length,D.length);o++)t[o]!==D[o]&&r.push(o);return r}const dD=Symbol("clack:cancel");function pD(e){return e===dD}function Le(e,u){e.isTTY&&e.setRawMode(u)}const mD=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),xi=new Set(["up","down","left","right","space","enter"]);class hD{constructor({render:u,input:t=Fn,output:D=Cn,...r},o=!0){N(this,"input"),N(this,"output"),N(this,"rl"),N(this,"opts"),N(this,"_track",!1),N(this,"_render"),N(this,"_cursor",0),N(this,"state","initial"),N(this,"value"),N(this,"error",""),N(this,"subscribers",new Map),N(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=u.bind(this),this._track=o,this.input=t,this.output=D}prompt(){const u=new yn(0);return u._write=(t,D,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(u),this.rl=Dt.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),Dt.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),Le(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((t,D)=>{this.once("submit",()=>{this.output.write(z.cursor.show),this.output.off("resize",this.render),Le(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(z.cursor.show),this.output.off("resize",this.render),Le(this.input,!1),t(dD)})})}on(u,t){const D=this.subscribers.get(u)??[];D.push({cb:t}),this.subscribers.set(u,D)}once(u,t){const D=this.subscribers.get(u)??[];D.push({cb:t,once:!0}),this.subscribers.set(u,D)}emit(u,...t){const D=this.subscribers.get(u)??[],r=[];for(const o of D)o.cb(...t),o.once&&r.push(()=>D.splice(D.indexOf(o),1));for(const o of r)o()}unsubscribe(){this.subscribers.clear()}onKeypress(u,t){if(this.state==="error"&&(this.state="active"),t?.name&&!this._track&&mD.has(t.name)&&this.emit("cursor",mD.get(t.name)),t?.name&&xi.has(t.name)&&this.emit("cursor",t.name),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),u&&this.emit("key",u.toLowerCase()),t?.name==="return"){if(this.opts.validate){const D=this.opts.validate(this.value);D&&(this.error=D,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}u===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
37
|
+
`),Le(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const u=CD(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
38
|
+
`).length-1;this.output.write(z.cursor.move(-999,u*-1))}render(){const u=CD(this._render(this)??"",process.stdout.columns,{hard:!0});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(z.cursor.hide);else{const t=$i(this._prevFrame,u);if(this.restoreCursor(),t&&t?.length===1){const D=t[0];this.output.write(z.cursor.move(0,D)),this.output.write(z.erase.lines(1));const r=u.split(`
|
|
39
|
+
`);this.output.write(r[D]),this._prevFrame=u,this.output.write(z.cursor.move(0,r.length-D-1));return}else if(t&&t?.length>1){const D=t[0];this.output.write(z.cursor.move(0,D)),this.output.write(z.erase.down());const r=u.split(`
|
|
40
|
+
`).slice(D);this.output.write(r.join(`
|
|
41
|
+
`)),this._prevFrame=u;return}this.output.write(z.erase.down())}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u}}}class Si extends hD{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,!1),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(z.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var Ti=Object.defineProperty,Oi=(e,u,t)=>u in e?Ti(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,ED=(e,u,t)=>(Oi(e,typeof u!="symbol"?u+"":u,t),t);let Pi=class extends hD{constructor(e){super(e,!1),ED(this,"options"),ED(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:u})=>u===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",u=>{switch(u){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}};globalThis.process.platform.startsWith("win");function Ii(){return T.platform!=="win32"?T.env.TERM!=="linux":!!T.env.CI||!!T.env.WT_SESSION||!!T.env.TERMINUS_SUBLIME||T.env.ConEmuTask==="{cmd::Cmder}"||T.env.TERM_PROGRAM==="Terminus-Sublime"||T.env.TERM_PROGRAM==="vscode"||T.env.TERM==="xterm-256color"||T.env.TERM==="alacritty"||T.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const ki=Ii(),q=(e,u)=>ki?e:u,Mi=q("\u25C6","*"),Ri=q("\u25A0","x"),ji=q("\u25B2","x"),_i=q("\u25C7","o"),Li=q("\u250C","T"),G=q("\u2502","|"),$u=q("\u2514","\u2014"),xu=q("\u25CF",">"),Su=q("\u25CB"," "),gD=e=>{switch(e){case"initial":case"active":return E.cyan(Mi);case"cancel":return E.red(Ri);case"error":return E.yellow(ji);case"submit":return E.green(_i)}},Ni=e=>{const u=e.active??"Yes",t=e.inactive??"No";return new Si({active:u,inactive:t,initialValue:e.initialValue??!0,render(){const D=`${E.gray(G)}
|
|
42
|
+
${gD(this.state)} ${e.message}
|
|
43
|
+
`,r=this.value?u:t;switch(this.state){case"submit":return`${D}${E.gray(G)} ${E.dim(r)}`;case"cancel":return`${D}${E.gray(G)} ${E.strikethrough(E.dim(r))}
|
|
44
|
+
${E.gray(G)}`;default:return`${D}${E.cyan(G)} ${this.value?`${E.green(xu)} ${u}`:`${E.dim(Su)} ${E.dim(u)}`} ${E.dim("/")} ${this.value?`${E.dim(Su)} ${E.dim(t)}`:`${E.green(xu)} ${t}`}
|
|
45
|
+
${E.cyan($u)}
|
|
46
|
+
`}}}).prompt()},Gi=e=>{const u=(t,D)=>{const r=t.label??String(t.value);return D==="active"?`${E.green(xu)} ${r} ${t.hint?E.dim(`(${t.hint})`):""}`:D==="selected"?`${E.dim(r)}`:D==="cancelled"?`${E.strikethrough(E.dim(r))}`:`${E.dim(Su)} ${E.dim(r)}`};return new Pi({options:e.options,initialValue:e.initialValue,render(){const t=`${E.gray(G)}
|
|
47
|
+
${gD(this.state)} ${e.message}
|
|
48
|
+
`;switch(this.state){case"submit":return`${t}${E.gray(G)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${t}${E.gray(G)} ${u(this.options[this.cursor],"cancelled")}
|
|
49
|
+
${E.gray(G)}`;default:return`${t}${E.cyan(G)} ${this.options.map((D,r)=>u(D,r===this.cursor?"active":"inactive")).join(`
|
|
50
|
+
${E.cyan(G)} `)}
|
|
51
|
+
${E.cyan($u)}
|
|
52
|
+
`}}}).prompt()},zi=(e="")=>{process.stdout.write(`${E.gray(Li)} ${e}
|
|
53
|
+
`)},Ne=(e="")=>{process.stdout.write(`${E.gray(G)}
|
|
54
|
+
${E.gray($u)} ${e}
|
|
55
|
+
|
|
56
|
+
`)},yD=e=>Vr,Ui=yD();class g extends Error{}const Tu=" ",Ou=e=>{e instanceof Error&&!(e instanceof g)&&(e.stack&&console.error(Fe(e.stack.split(`
|
|
57
|
+
`).slice(1).join(`
|
|
58
|
+
`))),console.error(`
|
|
59
|
+
${Tu}${Fe(`aicommits v${Ui}`)}`),console.error(`
|
|
60
|
+
${Tu}Please open a Bug report with the information above:`),console.error(`${Tu}https://github.com/Nutlope/aicommits/issues/new/choose`))},BD=async()=>{const{stdout:e,failed:u}=await ne("git",["rev-parse","--show-toplevel"],{reject:!1});if(u)throw new g("The current directory must be a Git repository!");return e},Pu=e=>`:(exclude)${e}`,bD=["package-lock.json","pnpm-lock.yaml","*.lock"].map(Pu),wD=async e=>{const u=["diff","--cached","--diff-algorithm=minimal"],{stdout:t}=await ne("git",[...u,"--name-only",...bD,...e?e.map(Pu):[]]);if(!t)return;const{stdout:D}=await ne("git",[...u,...bD,...e?e.map(Pu):[]]);return{files:t.split(`
|
|
61
|
+
`),diff:D}},Wi=e=>`Detected ${e.length.toLocaleString()} staged file${e.length>1?"s":""}`,qi=["","conventional"],{hasOwnProperty:Hi}=Object.prototype,AD=(e,u)=>Hi.call(e,u),S=(e,u,t)=>{if(!u)throw new g(`Invalid config property ${e}: ${t}`)},de=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),H=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:void 0,Vi={cn:"zh-CN","zh-cn":"zh-CN","zh-hans":"zh-CN",zh:"zh-CN","zh-tw":"zh-TW","zh-hant":"zh-TW"},Ki=e=>{const u=e.trim().replace(/_/g,"-");return Vi[u.toLowerCase()]??u},Iu=(e,u,t)=>{if(u==null||u==="")return t;if(typeof u=="boolean")return u;if(typeof u=="number"){if(u===1)return!0;if(u===0)return!1}if(typeof u=="string"){const D=u.trim().toLowerCase();if(["true","1","yes","on"].includes(D))return!0;if(["false","0","no","off"].includes(D))return!1}throw new g(`Invalid config property ${e}: Must be a boolean (true/false)`)},Ji=e=>{let u;try{u=JSON.parse(e)}catch{throw new g("Invalid config property conventional-types: Must be valid JSON")}S("conventional-types",typeof u=="object"&&u!==null&&!Array.isArray(u),'Must be a JSON object with "type":"description" pairs');const t=Object.entries(u).map(([D,r])=>[D.trim(),String(r).trim()]).filter(([D,r])=>D.length>0&&r.length>0);return S("conventional-types",t.length>0,"Must contain at least one type"),JSON.stringify(Object.fromEntries(t))},pe={"api-key"(e){if(!e)throw new g("Please set your API key via `aicommits config set api-key=<your token>`");if(typeof e!="string")throw new g("Invalid config property api-key: Must be a string");const u=e.trim();return S("api-key",u.length>0,"Cannot be empty"),u},"base-url"(e){if(e==null||e==="")throw new g("Please set your API base URL via `aicommits config set base-url=<https://...>`");if(typeof e!="string")throw new g("Invalid config property base-url: Must be a valid URL");const u=e.trim();let t;try{t=new URL(u)}catch{throw new g("Invalid config property base-url: Must be a valid URL")}S("base-url",t.protocol==="https:","Must be an HTTPS URL"),S("base-url",t.hash==="","Must not include URL fragments"),S("base-url",t.search==="","Must not include query parameters");const D=t.pathname.replace(/\/+$/,"");return`${t.origin}${D}`},profile(e){if(e==null)return"";if(typeof e!="string")throw new g("Invalid config property profile: Must be a string");return e.trim()},locale(e){if(!e)return"en";if(typeof e!="string")throw new g("Invalid config property locale: Must be a string");const u=Ki(e);return S("locale",u.length>0,"Cannot be empty"),S("locale",/^[a-z]{2,3}(?:-[a-z0-9]{2,8})*$/i.test(u),"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"),u},generate(e){if(!e)return 1;S("generate",typeof e=="string"||typeof e=="number","Must be an integer");const u=Number(e);return S("generate",Number.isInteger(u),"Must be an integer"),S("generate",u>0,"Must be greater than 0"),S("generate",u<=5,"Must be less or equal to 5"),u},type(e){return e?(S("type",typeof e=="string","Must be a string"),S("type",qi.includes(e),"Invalid commit type"),e):""},proxy(e){if(!(e==null||e==="")){if(typeof e!="string")throw new g("Invalid config property proxy: Must be a valid URL");return S("proxy",/^https?:\/\//.test(e),"Must be a valid URL"),e}},model(e){if(e==null||e==="")return"gpt-3.5-turbo";if(typeof e!="string")throw new g("Invalid config property model: Must be a string");return e},timeout(e){if(!e)return 1e4;S("timeout",typeof e=="string"||typeof e=="number","Must be an integer");const u=Number(e);return S("timeout",Number.isInteger(u),"Must be an integer"),S("timeout",u>=500,"Must be greater than 500ms"),u},"max-length"(e){if(!e)return 50;S("max-length",typeof e=="string"||typeof e=="number","Must be an integer");const u=Number(e);return S("max-length",Number.isInteger(u),"Must be an integer"),S("max-length",u>=20,"Must be greater than 20 characters"),u},details(e){return Iu("details",e,!1)},"show-reasoning"(e){return Iu("show-reasoning",e,!1)},"details-style"(e){if(e==null||e==="")return"paragraph";if(typeof e!="string")throw new g("Invalid config property details-style: Must be a string");const u=e.trim().toLowerCase();return S("details-style",["paragraph","list"].includes(u),"Must be one of: paragraph, list"),u},instructions(e){if(e==null)return"";if(typeof e!="string")throw new g("Invalid config property instructions: Must be a string");return e.trim()},"conventional-format"(e){if(e==null)return"";if(typeof e!="string")throw new g("Invalid config property conventional-format: Must be a string");return e.trim()},"conventional-types"(e){if(!e)return"";if(typeof e!="string")throw new g("Invalid config property conventional-types: Must be valid JSON");return Ji(e)},"conventional-scope"(e){return Iu("conventional-scope",e,!0)}},ku={"api-key":["openai-key","OPENAI_KEY","OPENAI_API_KEY"],"base-url":["openai-base-url","OPENAI_BASE_URL"],model:["OPENAI_MODEL"]},vD=W.join(we.homedir(),".aicommits"),$D=W.join(vD,"config.toml"),Yi=[W.join(we.homedir(),"aicommits.toml"),W.join(we.homedir(),".aicommits")],Zi=e=>{let u=!1,t=!1,D=!1;for(let r=0;r<e.length;r++){const o=e[r];if(o==="\\"&&t&&!D){D=!0;continue}if(o==='"'&&!u&&!D)t=!t;else if(o==="'"&&!t)u=!u;else if(o==="#"&&!u&&!t)return e.slice(0,r);D=!1}return e},xD=e=>{const u=e.trim();return u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1):u},Xi=e=>{const u=e.trim();if(u==="")return"";if(u.startsWith('"')&&u.endsWith('"'))try{return JSON.parse(u)}catch{return u.slice(1,-1)}return u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1):/^(true|false)$/i.test(u)?u.toLowerCase()==="true":/^[+-]?\d+$/.test(u)||/^[+-]?\d+\.\d+$/.test(u)?Number(u):u},Qi=(e,u)=>{let t=e;for(const D of u){const r=t[D];if(!de(r)){const o=Object.create(null);t[D]=o,t=o;continue}t=r}return t},ea=e=>{const u=Object.create(null);let t=u;for(const D of e.split(/\r?\n/)){const r=Zi(D).trim();if(!r)continue;if(r.startsWith("[")&&r.endsWith("]")){const i=r.slice(1,-1).trim();if(!i){t=u;continue}const a=i.split(".").map(xD).map(f=>f.trim()).filter(Boolean);if(a.length===0){t=u;continue}t=Qi(u,a);continue}const o=r.indexOf("=");if(o<=0)continue;const n=xD(r.slice(0,o));if(!n)continue;const s=Xi(r.slice(o+1));t[n]=s}return u},SD=e=>typeof e=="string"?JSON.stringify(e):String(e),ua=e=>{const u=[],t=[],D=(o,n)=>{const s=[],i=[];for(const[a,f]of Object.entries(n)){const c=H(f);if(c!==void 0){s.push(`${a} = ${SD(c)}`);continue}de(f)&&i.push([a,f])}o.length>0&&s.length>0&&(t.push(`[${o.join(".")}]`),t.push(...s),t.push(""));for(const[a,f]of i)D([...o,a],f)};for(const[o,n]of Object.entries(e)){const s=H(n);if(s!==void 0){u.push(`${o} = ${SD(s)}`);continue}de(n)&&D([o],n)}for(;t[t.length-1]==="";)t.pop();return[...u,...u.length>0&&t.length>0?[""]:[],...t].join(`
|
|
62
|
+
`)},TD=async e=>{try{if(!(await j.lstat(e)).isFile())return;const t=await j.readFile(e,"utf8");return ea(t)}catch{return}},OD=async()=>{const e=await TD($D);if(e)return e;for(const u of Yi){const t=await TD(u);if(t)return t}return Object.create(null)},PD=(e,u)=>{const t=ku[e];if(!(!t||t.length===0))for(const D of t){const r=H(u[D]);if(r!==void 0)return r}},ta=e=>{for(const[u,t]of Object.entries(ku)){if(H(e[u])===void 0)for(const D of t){const r=H(e[D]);if(r!==void 0){e[u]=r;break}}for(const D of t)delete e[D]}},Da=(e,u,t)=>{if(!u)return;const D=e.profiles;if(!de(D))return;const r=D[u];if(de(r))return H(r[t])},Mu=async(e,u)=>{const t=await OD(),D={},r=e?.profile??H(t.profile)??PD("profile",t);let o="";try{o=pe.profile(r)}catch{if(!u)throw new g("Invalid config property profile: Must be a string")}for(const n of Object.keys(pe)){const s=pe[n],i=e?.[n]??(n==="profile"?void 0:Da(t,o,n))??H(t[n])??PD(n,t);if(u)try{D[n]=s(i)}catch{}else D[n]=s(i)}return D},na=async e=>{const u=await OD();ta(u);for(const[D,r]of e){if(!AD(pe,D))throw new g(`Invalid config property: ${D}`);const o=D,n=pe[o](r);u[o]=n;const s=ku[o]||[];for(const i of s)delete u[i]}await j.mkdir(vD,{recursive:!0});const t=ua(u);await j.writeFile($D,`${t}
|
|
63
|
+
`,"utf8")};var Ru={},ju={exports:{}},me={exports:{}},_u,ID;function ra(){if(ID)return _u;ID=1;var e=1e3,u=e*60,t=u*60,D=t*24,r=D*7,o=D*365.25;_u=function(f,c){c=c||{};var l=typeof f;if(l==="string"&&f.length>0)return n(f);if(l==="number"&&isFinite(f))return c.long?i(f):s(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function n(f){if(f=String(f),!(f.length>100)){var c=/^(-?(?:\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(c){var l=parseFloat(c[1]),F=(c[2]||"ms").toLowerCase();switch(F){case"years":case"year":case"yrs":case"yr":case"y":return l*o;case"weeks":case"week":case"w":return l*r;case"days":case"day":case"d":return l*D;case"hours":case"hour":case"hrs":case"hr":case"h":return l*t;case"minutes":case"minute":case"mins":case"min":case"m":return l*u;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}function s(f){var c=Math.abs(f);return c>=D?Math.round(f/D)+"d":c>=t?Math.round(f/t)+"h":c>=u?Math.round(f/u)+"m":c>=e?Math.round(f/e)+"s":f+"ms"}function i(f){var c=Math.abs(f);return c>=D?a(f,c,D,"day"):c>=t?a(f,c,t,"hour"):c>=u?a(f,c,u,"minute"):c>=e?a(f,c,e,"second"):f+" ms"}function a(f,c,l,F){var C=c>=l*1.5;return Math.round(f/l)+" "+F+(C?"s":"")}return _u}var Lu,kD;function MD(){if(kD)return Lu;kD=1;function e(u){D.debug=D,D.default=D,D.coerce=a,D.disable=s,D.enable=o,D.enabled=i,D.humanize=ra(),D.destroy=f,Object.keys(u).forEach(c=>{D[c]=u[c]}),D.names=[],D.skips=[],D.formatters={};function t(c){let l=0;for(let F=0;F<c.length;F++)l=(l<<5)-l+c.charCodeAt(F),l|=0;return D.colors[Math.abs(l)%D.colors.length]}D.selectColor=t;function D(c){let l,F=null,C,d;function p(...h){if(!p.enabled)return;const y=p,m=Number(new Date),B=m-(l||m);y.diff=B,y.prev=l,y.curr=m,l=m,h[0]=D.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let b=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(w,O)=>{if(w==="%%")return"%";b++;const _=D.formatters[O];if(typeof _=="function"){const L=h[b];w=_.call(y,L),h.splice(b,1),b--}return w}),D.formatArgs.call(y,h),(y.log||D.log).apply(y,h)}return p.namespace=c,p.useColors=D.useColors(),p.color=D.selectColor(c),p.extend=r,p.destroy=D.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>F!==null?F:(C!==D.namespaces&&(C=D.namespaces,d=D.enabled(c)),d),set:h=>{F=h}}),typeof D.init=="function"&&D.init(p),p}function r(c,l){const F=D(this.namespace+(typeof l>"u"?":":l)+c);return F.log=this.log,F}function o(c){D.save(c),D.namespaces=c,D.names=[],D.skips=[];const l=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const F of l)F[0]==="-"?D.skips.push(F.slice(1)):D.names.push(F)}function n(c,l){let F=0,C=0,d=-1,p=0;for(;F<c.length;)if(C<l.length&&(l[C]===c[F]||l[C]==="*"))l[C]==="*"?(d=C,p=F,C++):(F++,C++);else if(d!==-1)C=d+1,p++,F=p;else return!1;for(;C<l.length&&l[C]==="*";)C++;return C===l.length}function s(){const c=[...D.names,...D.skips.map(l=>"-"+l)].join(",");return D.enable(""),c}function i(c){for(const l of D.skips)if(n(c,l))return!1;for(const l of D.names)if(n(c,l))return!0;return!1}function a(c){return c instanceof Error?c.stack||c.message:c}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 D.enable(D.load()),D}return Lu=e,Lu}me.exports;var RD;function oa(){return RD||(RD=1,function(e,u){u.formatArgs=D,u.save=r,u.load=o,u.useColors=t,u.storage=n(),u.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`."))}})(),u.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 t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let i;return 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&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function D(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 a="color: "+this.color;i.splice(1,0,a,"color: inherit");let f=0,c=0;i[0].replace(/%[a-zA-Z%]/g,l=>{l!=="%%"&&(f++,l==="%c"&&(c=f))}),i.splice(c,0,a)}u.log=console.debug||console.log||(()=>{});function r(i){try{i?u.storage.setItem("debug",i):u.storage.removeItem("debug")}catch{}}function o(){let i;try{i=u.storage.getItem("debug")||u.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function n(){try{return localStorage}catch{}}e.exports=MD()(u);const{formatters:s}=e.exports;s.j=function(i){try{return JSON.stringify(i)}catch(a){return"[UnexpectedJSONParseError]: "+a.message}}}(me,me.exports)),me.exports}var he={exports:{}},Nu,jD;function sa(){return jD||(jD=1,Nu=(e,u=process.argv)=>{const t=e.startsWith("-")?"":e.length===1?"-":"--",D=u.indexOf(t+e),r=u.indexOf("--");return D!==-1&&(r===-1||D<r)}),Nu}var Gu,_D;function ia(){if(_D)return Gu;_D=1;const e=we,u=Ue,t=sa(),{env:D}=process;let r;t("no-color")||t("no-colors")||t("color=false")||t("color=never")?r=0:(t("color")||t("colors")||t("color=true")||t("color=always"))&&(r=1),"FORCE_COLOR"in D&&(D.FORCE_COLOR==="true"?r=1:D.FORCE_COLOR==="false"?r=0:r=D.FORCE_COLOR.length===0?1:Math.min(parseInt(D.FORCE_COLOR,10),3));function o(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function n(i,a){if(r===0)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(i&&!a&&r===void 0)return 0;const f=r||0;if(D.TERM==="dumb")return f;if(process.platform==="win32"){const c=e.release().split(".");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if("CI"in D)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(c=>c in D)||D.CI_NAME==="codeship"?1:f;if("TEAMCITY_VERSION"in D)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(D.TEAMCITY_VERSION)?1:0;if(D.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in D){const c=parseInt((D.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(D.TERM_PROGRAM){case"iTerm.app":return c>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(D.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(D.TERM)||"COLORTERM"in D?1:f}function s(i){const a=n(i,i&&i.isTTY);return o(a)}return Gu={supportsColor:s,stdout:o(n(!0,u.isatty(1))),stderr:o(n(!0,u.isatty(2)))},Gu}he.exports;var LD;function aa(){return LD||(LD=1,function(e,u){const t=Ue,D=tt;u.init=f,u.log=s,u.formatArgs=o,u.save=i,u.load=a,u.useColors=r,u.destroy=D.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),u.colors=[6,2,3,4,5,1];try{const l=ia();l&&(l.stderr||l).level>=2&&(u.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{}u.inspectOpts=Object.keys(process.env).filter(l=>/^debug_/i.test(l)).reduce((l,F)=>{const C=F.substring(6).toLowerCase().replace(/_([a-z])/g,(p,h)=>h.toUpperCase());let d=process.env[F];return/^(yes|on|true|enabled)$/i.test(d)?d=!0:/^(no|off|false|disabled)$/i.test(d)?d=!1:d==="null"?d=null:d=Number(d),l[C]=d,l},{});function r(){return"colors"in u.inspectOpts?!!u.inspectOpts.colors:t.isatty(process.stderr.fd)}function o(l){const{namespace:F,useColors:C}=this;if(C){const d=this.color,p="\x1B[3"+(d<8?d:"8;5;"+d),h=` ${p};1m${F} \x1B[0m`;l[0]=h+l[0].split(`
|
|
64
|
+
`).join(`
|
|
65
|
+
`+h),l.push(p+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else l[0]=n()+F+" "+l[0]}function n(){return u.inspectOpts.hideDate?"":new Date().toISOString()+" "}function s(...l){return process.stderr.write(D.formatWithOptions(u.inspectOpts,...l)+`
|
|
66
|
+
`)}function i(l){l?process.env.DEBUG=l:delete process.env.DEBUG}function a(){return process.env.DEBUG}function f(l){l.inspectOpts={};const F=Object.keys(u.inspectOpts);for(let C=0;C<F.length;C++)l.inspectOpts[F[C]]=u.inspectOpts[F[C]]}e.exports=MD()(u);const{formatters:c}=e.exports;c.o=function(l){return this.inspectOpts.colors=this.useColors,D.inspect(l,this.inspectOpts).split(`
|
|
67
|
+
`).map(F=>F.trim()).join(" ")},c.O=function(l){return this.inspectOpts.colors=this.useColors,D.inspect(l,this.inspectOpts)}}(he,he.exports)),he.exports}typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ju.exports=oa():ju.exports=aa();var zu=ju.exports,Uu={};Object.defineProperty(Uu,"__esModule",{value:!0});function ca(e){return function(u,t){return new Promise((D,r)=>{e.call(this,u,t,(o,n)=>{o?r(o):D(n)})})}}Uu.default=ca;var ND=k&&k.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const la=ut,fa=ND(zu),Fa=ND(Uu),Ee=fa.default("agent-base");function Ca(e){return!!e&&typeof e.addRequest=="function"}function Wu(){const{stack:e}=new Error;return typeof e!="string"?!1:e.split(`
|
|
68
|
+
`).some(u=>u.indexOf("(https.js:")!==-1||u.indexOf("node:https:")!==-1)}function Ge(e,u){return new Ge.Agent(e,u)}(function(e){class u extends la.EventEmitter{constructor(D,r){super();let o=r;typeof D=="function"?this.callback=D:D&&(o=D),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:Wu()?443:80}set defaultPort(D){this.explicitDefaultPort=D}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:Wu()?"https:":"http:"}set protocol(D){this.explicitProtocol=D}callback(D,r,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(D,r){const o=Object.assign({},r);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=Wu()),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,D._last=!0,D.shouldKeepAlive=!1;let n=!1,s=null;const i=o.timeout||this.timeout,a=F=>{D._hadError||(D.emit("error",F),D._hadError=!0)},f=()=>{s=null,n=!0;const F=new Error(`A "socket" was not created for HTTP request before ${i}ms`);F.code="ETIMEOUT",a(F)},c=F=>{n||(s!==null&&(clearTimeout(s),s=null),a(F))},l=F=>{if(n)return;if(s!=null&&(clearTimeout(s),s=null),Ca(F)){Ee("Callback returned another Agent instance %o",F.constructor.name),F.addRequest(D,o);return}if(F){F.once("free",()=>{this.freeSocket(F,o)}),D.onSocket(F);return}const C=new Error(`no Duplex stream was returned to agent-base for \`${D.method} ${D.path}\``);a(C)};if(typeof this.callback!="function"){a(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(Ee("Converting legacy callback function to promise"),this.promisifiedCallback=Fa.default(this.callback)):this.promisifiedCallback=this.callback),typeof i=="number"&&i>0&&(s=setTimeout(f,i)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{Ee("Resolving socket for %o request: %o",o.protocol,`${D.method} ${D.path}`),Promise.resolve(this.promisifiedCallback(D,o)).then(l,c)}catch(F){Promise.reject(F).catch(c)}}freeSocket(D,r){Ee("Freeing socket %o %o",D.constructor.name,r),D.destroy()}destroy(){Ee("Destroying agent %o",this.constructor.name)}}e.Agent=u,e.prototype=e.Agent.prototype})(Ge||(Ge={}));var da=Ge,qu={},pa=k&&k.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qu,"__esModule",{value:!0});const ma=pa(zu),ge=ma.default("https-proxy-agent:parse-proxy-response");function ha(e){return new Promise((u,t)=>{let D=0;const r=[];function o(){const c=e.read();c?f(c):e.once("readable",o)}function n(){e.removeListener("end",i),e.removeListener("error",a),e.removeListener("close",s),e.removeListener("readable",o)}function s(c){ge("onclose had error %o",c)}function i(){ge("onend")}function a(c){n(),ge("onerror %o",c),t(c)}function f(c){r.push(c),D+=c.length;const l=Buffer.concat(r,D);if(l.indexOf(`\r
|
|
69
|
+
\r
|
|
70
|
+
`)===-1){ge("have not received end of HTTP headers yet..."),o();return}const C=l.toString("ascii",0,l.indexOf(`\r
|
|
71
|
+
`)),d=+C.split(" ")[1];ge("got proxy server response: %o",C),u({statusCode:d,buffered:l})}e.on("error",a),e.on("close",s),e.on("end",i),o()})}qu.default=ha;var Ea=k&&k.__awaiter||function(e,u,t,D){function r(o){return o instanceof t?o:new t(function(n){n(o)})}return new(t||(t=Promise))(function(o,n){function s(f){try{a(D.next(f))}catch(c){n(c)}}function i(f){try{a(D.throw(f))}catch(c){n(c)}}function a(f){f.done?o(f.value):r(f.value).then(s,i)}a((D=D.apply(e,u||[])).next())})},oe=k&&k.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ru,"__esModule",{value:!0});const GD=oe(bn),zD=oe(wn),ga=oe(An),ya=oe(et),Ba=oe(zu),ba=da,wa=oe(qu),ye=Ba.default("https-proxy-agent:agent");class Aa extends ba.Agent{constructor(u){let t;if(typeof u=="string"?t=ga.default.parse(u):t=u,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");ye("creating new HttpsProxyAgent instance: %o",t),super(t);const D=Object.assign({},t);this.secureProxy=t.secureProxy||xa(D.protocol),D.host=D.hostname||D.host,typeof D.port=="string"&&(D.port=parseInt(D.port,10)),!D.port&&D.host&&(D.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in D)&&(D.ALPNProtocols=["http 1.1"]),D.host&&D.path&&(delete D.path,delete D.pathname),this.proxy=D}callback(u,t){return Ea(this,void 0,void 0,function*(){const{proxy:D,secureProxy:r}=this;let o;r?(ye("Creating `tls.Socket`: %o",D),o=zD.default.connect(D)):(ye("Creating `net.Socket`: %o",D),o=GD.default.connect(D));const n=Object.assign({},D.headers);let i=`CONNECT ${`${t.host}:${t.port}`} HTTP/1.1\r
|
|
72
|
+
`;D.auth&&(n["Proxy-Authorization"]=`Basic ${Buffer.from(D.auth).toString("base64")}`);let{host:a,port:f,secureEndpoint:c}=t;$a(f,c)||(a+=`:${f}`),n.Host=a,n.Connection="close";for(const p of Object.keys(n))i+=`${p}: ${n[p]}\r
|
|
73
|
+
`;const l=wa.default(o);o.write(`${i}\r
|
|
74
|
+
`);const{statusCode:F,buffered:C}=yield l;if(F===200){if(u.once("socket",va),t.secureEndpoint){ye("Upgrading socket connection to TLS");const p=t.servername||t.host;return zD.default.connect(Object.assign(Object.assign({},Sa(t,"host","hostname","path","port")),{socket:o,servername:p}))}return o}o.destroy();const d=new GD.default.Socket({writable:!1});return d.readable=!0,u.once("socket",p=>{ye("replaying proxy buffer for failed request"),ya.default(p.listenerCount("data")>0),p.push(C),p.push(null)}),d})}}Ru.default=Aa;function va(e){e.resume()}function $a(e,u){return!!(!u&&e===80||u&&e===443)}function xa(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function Sa(e,...u){const t={};let D;for(D in e)u.includes(D)||(t[D]=e[D]);return t}var Ta=k&&k.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const Hu=Ta(Ru);function Vu(e){return new Hu.default(e)}(function(e){e.HttpsProxyAgent=Hu.default,e.prototype=Hu.default.prototype})(Vu||(Vu={}));var Oa=Vu,Pa=Q(Oa);const ze={docs:"Documentation only changes",style:"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",refactor:"A code change that improves code structure without changing functionality (renaming, restructuring classes/methods, extracting functions, etc)",perf:"A code change focused only on performance improvements, with no functional behavior fix and no structural refactor as the primary purpose",test:"Adding missing tests or correcting existing tests",build:"Changes that affect the build system or external dependencies",ci:"Changes to our CI configuration files and scripts",chore:"Other changes that don't modify src or test files",revert:"Reverts a previous commit",feat:"A new feature",fix:"A bug fix that corrects incorrect behavior, crashes, exceptions, regressions, or other defects"},UD={"":"<commit message>",conventional:"<type>[optional (<scope>)]: <commit message>"},WD=e=>{if(!e)return ze;try{const u=JSON.parse(e);if(!u||typeof u!="object"||Array.isArray(u))return ze;const t=Object.entries(u).map(([D,r])=>[D.trim(),String(r).trim()]).filter(([D,r])=>D.length>0&&r.length>0);return t.length===0?ze:Object.fromEntries(t)}catch{return ze}},qD=(e,u,t=!0)=>e==="conventional"?!t&&!u?.trim()?"<type>: <commit message>":u?.trim()||UD.conventional:UD[e],Ia=(e,u,t,D)=>D?`The commit title line must be in format:
|
|
75
|
+
${qD(e,u,t)}`:`The output response must be in format:
|
|
76
|
+
${qD(e,u,t)}`,ka=(e,u,t)=>{if(e==="conventional"){const D=t?.trim();return D?[`Selected conventional type (locked): ${D}`,"Use this exact type in the title prefix. Do not change it.","The title and body details must stay semantically consistent with this selected type."].join(`
|
|
77
|
+
`):["Choose a type from the type-to-description JSON below that best describes the git diff:",JSON.stringify(WD(u),null,2),"Select the type directly from the diff intent. Do not run or describe any scoring process.","Type rules:","- fix: use only for explicit bug/defect correction evidence (wrong behavior, crash, exception, regression, data corruption).","- perf: use only when the primary purpose is performance improvement.","- refactor: use for structural/API/concurrency-flow changes without explicit bug-fix evidence.","- If uncertain between fix/perf and refactor, choose refactor.","The selected type must stay semantically consistent with both title and body.","Do not output any type-selection reasoning."].join(`
|
|
78
|
+
`)}return""},Ma=(e,u)=>e?u==="list"?["Provide both a title and a body.","Output format must be exactly:","<title>","","<body>","The body must be 3-6 concise bullet points.",'Each bullet must start with "- ".','Do not use section labels like "Impact:", "Changes:", "Summary:", or markdown headings.',"Each bullet should describe one concrete code-path change with real symbols from the diff."].join(`
|
|
79
|
+
`):["Provide both a title and a body.","Output format must be exactly:","<title>","","<body>","The body should be 3-6 concise technical prose sentences in one paragraph, not bullet points.",'Do not use section labels like "Impact:", "Changes:", "Summary:", or markdown headings.',"Describe concrete code-path changes with real symbols from the diff (classes, methods, APIs, actor/threading/cancellation/error-flow changes).","Prefer before/after wording for key behavior changes instead of generic claims."].join(`
|
|
80
|
+
`):"Provide only the title, no description or body.",Ra=()=>["Use GitHub Copilot style.","Keep wording concise, technical, and neutral.","Use specific subsystem, class, API, and type names from the diff.","Prefer an imperative, action-led title (for example: Use..., Convert..., Refactor..., Simplify...).","Prioritize concrete change actions and concurrency/correctness context over generic phrasing.",'Avoid generic wording like "optimize logic" unless the concrete optimization is explicitly described.'].join(`
|
|
81
|
+
`),ja=e=>e?.trim()?`Additional instructions from user:
|
|
82
|
+
${e.trim()}`:"",_a=e=>[`Message language: ${e}`,"You must write the commit message strictly in this language."].join(`
|
|
83
|
+
`),La=e=>{if(!e||e.length===0)return"";const u=e.map(r=>r.trim()).filter(Boolean);if(u.length===0)return"";const t=u.slice(0,12),D=u.length-t.length;return["Changed files:",...t.map(r=>`- ${r}`),...D>0?[`- ...and ${D} more file(s)`]:[]].join(`
|
|
84
|
+
`)},Na=(e,u)=>{if(e==="conventional"){const t=["Title anchor requirement:","- The commit title must mention at least one concrete anchor from the diff (file, class/type, module, or subsystem).","- Prefer class/type/module/subsystem names over raw file paths when possible.","- Avoid titles that only mention function names without file/class context."];return u?(t.push("- For conventional commits, include scope using the primary file/class/module when possible (for example: refactor(RecentScrollshotController): ...)."),t.push("- Only omit scope when there is no clear dominant anchor.")):(t.push("- Do not include scope in conventional titles."),t.push('- Use "<type>: <subject>" format instead of "<type>(<scope>): <subject>".')),t.join(`
|
|
85
|
+
`)}return["Title anchor requirement:","- The commit title must mention at least one concrete anchor from the diff (file, class/type, module, or subsystem).","- Prefer class/type/module/subsystem names over raw file paths when possible.","- Avoid titles that only mention function names without file/class context."].join(`
|
|
86
|
+
`)},Ga=(e,u)=>e!=="conventional"?"":["Conventional title subject rules:",`- The subject text after ${u?'"<type>(<scope>): "':'"<type>: "'} must not start with the same type word.`,'- Example to avoid: "refactor: refactor ...".','- The selected prefix must stay semantically consistent with the subject action; never output titles like "feat: refactor ..." or "fix: refactor ...".',"- For alphabetic languages (for example English), capitalize the first word in the subject.","- Run a final self-check before output: if subject starts with the selected type word, rewrite the subject."].join(`
|
|
87
|
+
`),za=(e,u,t,D={})=>{const r=D.includeDetails??!1,o=D.detailsStyle??"paragraph",n=D.conventionalScope??!0;return["Generate a concise git commit message in present tense that precisely describes the key changes in the following code diff. Focus on what was changed, not just file names.",Ma(r,o),_a(e),`Commit title must be a maximum of ${u} characters.`,"Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.",`IMPORTANT: Do not include any explanations, introductions, or additional text. Do not wrap the commit message in quotes or any other formatting. The commit title must not exceed ${u} characters. Respond with ONLY the commit message text.`,"Be specific: include concrete details (package names, versions, functionality) rather than generic statements.",La(D.changedFiles),Na(t,n),Ga(t,n),ka(t,D.conventionalTypes,D.lockedConventionalType),Ia(t,D.conventionalFormat,n,r),Ra(),ja(D.instructions)].filter(Boolean).join(`
|
|
88
|
+
`)},Ua=async(e,u,t,D,r,o,n=443,s)=>new Promise((i,a)=>{const f=JSON.stringify(D),c={port:n,hostname:e,path:u,method:"POST",headers:{...t,"Content-Type":"application/json","Content-Length":Buffer.byteLength(f)},timeout:r,agent:o?Pa(o):void 0},l=Bn.request(c,F=>{const C=[];F.on("data",d=>{C.push(d),s?.(d.toString())}),F.on("end",()=>{i({request:l,response:F,data:Buffer.concat(C).toString()})})});l.on("error",a),l.on("timeout",()=>{l.destroy(),a(new g(`Time out error: request took over ${r}ms. Try increasing the \`timeout\` config, or checking your API provider status.`))}),l.write(f),l.end()}),Wa=e=>{if(!e?.trim())throw new g("Please set your API base URL via `aicommits config set base-url=<https://...>`");const u=e.trim(),t=new URL(u),D=t.pathname.replace(/\/+$/,"");return{hostname:t.hostname,port:t.port?Number(t.port):443,path:`${D}/chat/completions`}},HD=async(e,u,t,D,r,o)=>{const n={...u,stream:!0};let s="";const i=m=>{if(!o)return;const B=Array.isArray(m.choices)?m.choices:[];for(const b of B){if(typeof b!="object"||b===null)continue;const I=b.delta;if(typeof I!="object"||I===null)continue;const w=I,O=typeof w.reasoning_content=="string"?w.reasoning_content:typeof w.reasoning=="string"?w.reasoning:"";O&&o({kind:"reasoning",text:O}),typeof w.content=="string"&&w.content.length>0&&o({kind:"content",text:w.content})}},a=m=>{if(!o)return;s+=m.replace(/\r\n/g,`
|
|
89
|
+
`);let B=s.indexOf(`
|
|
90
|
+
|
|
91
|
+
`);for(;B!==-1;){const b=s.slice(0,B);s=s.slice(B+2);for(const I of b.split(`
|
|
92
|
+
`)){const w=I.trim();if(!w.startsWith("data:"))continue;const O=w.slice(5).trim();if(!(!O||O==="[DONE]"))try{const _=JSON.parse(O);i(_)}catch{}}B=s.indexOf(`
|
|
93
|
+
|
|
94
|
+
`)}},f=Wa(r),{response:c,data:l}=await Ua(f.hostname,f.path,{Authorization:`Bearer ${e}`},n,t,D,f.port,a);if(!c.statusCode||c.statusCode<200||c.statusCode>299){let m=`API Error: ${c.statusCode} - ${c.statusMessage}`;throw l&&(m+=`
|
|
95
|
+
|
|
96
|
+
${l}`),new g(m)}const F=l.trim();if(!F)throw new g("API Error: Empty response body");if(F.startsWith("{"))return JSON.parse(F);const C=[];for(const m of F.split(/\r?\n/)){const B=m.trim();if(!B.startsWith("data:"))continue;const b=B.slice(5).trim();if(!(!b||b==="[DONE]"))try{C.push(JSON.parse(b))}catch{}}if(C.length===0)throw new g("API Error: Unable to parse streamed response");const d=C.find(m=>typeof m.error=="object"&&m.error!==null);if(d?.error&&typeof d.error=="object"&&d.error!==null){const m="message"in d.error&&typeof d.error.message=="string"?d.error.message:JSON.stringify(d.error);throw new g(`API Error: ${m}`)}const p=C.find(m=>typeof m.id=="string")||C[0],h=new Map;for(const m of C){const B=Array.isArray(m.choices)?m.choices:[];for(const b of B){if(typeof b!="object"||b===null)continue;const I=b,w=typeof I.index=="number"?I.index:0,O=h.get(w)||{index:w,contentParts:[],reasoningParts:[]},_=I.delta;if(typeof _=="object"&&_!==null){const A=_;typeof A.role=="string"&&(O.role=A.role),typeof A.content=="string"&&O.contentParts.push(A.content),typeof A.reasoning_content=="string"&&O.reasoningParts.push(A.reasoning_content),typeof A.reasoning=="string"&&O.reasoningParts.push(A.reasoning)}const L=I.finish_reason;(typeof L=="string"||L===null)&&(O.finishReason=L),h.set(w,O)}}const y=Array.from(h.values()).sort((m,B)=>m.index-B.index).map(m=>{const B={role:m.role||"assistant",content:m.contentParts.join("")},b=m.reasoningParts.join("");return b&&(B.reasoning_content=b),{index:m.index,finish_reason:m.finishReason??"stop",message:B}});if(y.length===0)throw new g("API Error: Streamed response did not include any choices");return{id:typeof p.id=="string"?p.id:"",object:"chat.completion",created:typeof p.created=="number"?p.created:Math.floor(Date.now()/1e3),model:typeof p.model=="string"?p.model:"",choices:y,usage:void 0}},VD=(e,u)=>({model:e,messages:u}),qa=e=>e.replace(/\r\n?/g,`
|
|
97
|
+
`),KD=e=>{const u=e.match(/```(?:[a-zA-Z0-9_-]+)?\n([\s\S]*?)```/);return u?.[1]?u[1].trim():e.replace(/```/g,"").trim()},JD=e=>e.trim().replace(/^title:\s*/i,"").replace(/(\w)\.$/,"$1").replace(/^["'`]|["'`]$/g,""),Ha=e=>e.replace(/^\s*(body|description|details)\s*:\s*/i,"").replace(/^\s*(主要改动包括|主要改动|改动包括)\s*[::]\s*/i,"").replace(/^\s*(impact|影响)\s*[::]\s*/i,""),Va=e=>e.split(/(?<=[。!?.!?])\s+/u).map(u=>u.trim()).filter(Boolean),YD=/^(?:[-*•]+|\d+[.)])\s*/u,Ka=/^[\s\-–—_*•.,;:!?()[\]{}"'`]+$/u,Ja=e=>{let u=e.trim();if(!u)return"";for(;YD.test(u);){const t=u.replace(YD,"").trim();if(!t||t===u)break;u=t}return!u||Ka.test(u)?"":u},Ya=e=>{if(!e.trim())return{paragraph:"",listItems:[]};const u=e.split(`
|
|
98
|
+
`).map(n=>Ha(n.trim())).filter(Boolean);if(u.length===0)return{paragraph:"",listItems:[]};const t=[],D=[];for(const n of u){const s=n.match(/^(?:[-*•]|\d+[.)])\s+(.+)$/);s?.[1]?t.push(s[1].trim()):(D.push(n.trim()),t.push(...Va(n)))}const r=[...D,...t].join(" ").replace(/\s{2,}/g," ").replace(/\s+([,.;:!?])/g,"$1").trim(),o=Array.from(new Set(t.map(Ja).filter(Boolean)));return{paragraph:r,listItems:o}},Be=e=>{const u=qa(e).trim();if(!u)return{title:"",body:""};const t=u.split(`
|
|
99
|
+
`).map(o=>o.replace(/\s+$/g,""));for(;t[0]?.trim()==="";)t.shift();const D=JD(t.shift()||"");for(;t[0]?.trim()==="";)t.shift();t[0]?.trim().toLowerCase().startsWith("body:")&&(t[0]=t[0].replace(/^body:\s*/i,""));const r=t.join(`
|
|
100
|
+
`).trim();return{title:D,body:r}},be=(e,u)=>u?`${e}
|
|
101
|
+
|
|
102
|
+
${u}`:e,ZD=e=>JD(KD(e).trim().split(`
|
|
103
|
+
`)[0]||""),Za=(e,u)=>{const t=KD(e),{title:D,body:r}=Be(t),o=Ya(r);if(u==="list"){const n=o.listItems.slice(0,6).map(s=>`- ${s}`).join(`
|
|
104
|
+
`);return be(D,n)}return be(D,o.paragraph)},Xa=(e,u,t)=>u?Za(e,t):ZD(e),Z=e=>e.trim().toLowerCase(),Qa=e=>Array.from(new Set(e)),ec=/[\u3400-\u9fff]/,XD=/^([a-z]+(?:\([^)]+\))?:\s*)(.+)$/i,QD=/^([a-z]+)(\([^)]+\))?:\s*(.+)$/i,uc=/^([a-z]+)\b(?:\s+|[:\-])/i,tc={feature:"feat",features:"feat",bug:"fix",bugfix:"fix",performance:"perf"},Dc=e=>{const u=e.trim().toLowerCase();return u==="cn"||u.startsWith("zh")},en=e=>{const u=e.match(XD);return u?{prefix:u[1],subject:(u[2]||"").trim()}:{prefix:"",subject:e.trim()}},nc=e=>{const u=new Map,t=WD(e);for(const D of Object.keys(t))u.set(Z(D),D);for(const[D,r]of Object.entries(tc)){if(u.has(Z(D)))continue;const o=u.get(Z(r));o&&u.set(Z(D),o)}return u},Ku=(e,u)=>u.get(Z(e)),rc=(e,u)=>{const t=e.trim().match(uc);if(t?.[1])return Ku(t[1],u)},oc=(e,u,t)=>{const D=e.trim().match(/^([a-z]+)\b(?:\s+|[:\-])+(.*)$/i);if(!D?.[1]||!D[2])return e;const r=Ku(D[1],t);return!r||Z(r)!==Z(u)?e:D[2].trim()||e},sc=(e,u)=>{const t=e.match(QD);if(!t)return e;const[,D,r="",o=""]=t,n=o.trim();if(!n)return e;const s=Ku(D,u)||D.toLowerCase(),a=rc(n,u)||s,f=oc(n,a,u);return`${a}${r}: ${f||n}`},ic=(e,u,t)=>{const{title:D,body:r}=u?Be(e):{title:e.trim(),body:""},o=sc(D,t);return u?be(o,r):o},ac=(e,u)=>{const{title:t,body:D}=u?Be(e):{title:e.trim(),body:""},r=t.match(QD);if(!r)return e;const[,o="",,n=""]=r,s=o.trim().toLowerCase(),i=n.trim();if(!s||!i)return e;const a=`${s}: ${i}`;return u?be(a,D):a},cc=/^([a-z]+)\(([^)\s][^)]*)\):\s*\S/i,lc=(e,u)=>u?Be(e).title:e.trim(),fc=e=>e?.trim()?/<\s*scope\s*>/i.test(e):!0,un=(e,u)=>cc.test(lc(e,u)),Fc=(e,u)=>{if(!Dc(u))return!1;const{subject:t}=en(e);return t.length===0?!1:!ec.test(t)},Cc=async(e,u,t,D,r,o,n,s,i)=>{const{prefix:a,subject:f}=en(D),c=VD(u,[{role:"system",content:[`Rewrite ONLY this commit title into locale "${t}".`,"Keep technical meaning unchanged and keep wording concise.",`Maximum title length: ${r} characters.`,"Return only the rewritten title text. No quotes, no code fences, no explanations.",...a?[`Preserve this conventional prefix exactly: "${a}" and rewrite only the subject part.`]:[]].join(`
|
|
105
|
+
`)},{role:"user",content:D}]),F=(await HD(e,c,o,n,s,i)).choices.map(p=>p.message?.content).find(p=>typeof p=="string");if(!F)return D;const C=ZD(F);if(!C)return D;if(!a)return C;const d=C.replace(XD,"$2").trim();return`${a}${d||f}`},dc=async(e,u,t,D,r,o,n,s,i,a)=>{const{title:f,body:c}=r?Be(D):{title:D.trim(),body:""};if(!Fc(f,t))return D;try{const l=await Cc(e,u,t,f,o,n,s,i,a);return r?be(l,c):l}catch{return D}},tn=async(e,u,t,D,r,o,n,s,i,a={},f)=>{const c=a.includeDetails??!1,l=a.detailsStyle??"paragraph",F=nc(a.conventionalTypes),C=n==="conventional"&&(a.conventionalScope??!0)&&fc(a.conventionalFormat),d=async(p,h=!0)=>{const y=[h?a.instructions?.trim():"",p?.trim()].filter(Boolean).join(`
|
|
106
|
+
`),m={includeDetails:a.includeDetails,detailsStyle:a.detailsStyle,instructions:y,conventionalFormat:a.conventionalFormat,conventionalTypes:a.conventionalTypes,conventionalScope:a.conventionalScope,changedFiles:a.changedFiles},B=[{role:"system",content:za(t,o,n,m)},{role:"user",content:D}],b=Math.max(1,r),w=(await Promise.all(Array.from({length:b},()=>HD(e,VD(u,B),s,i,f,A=>a.onStreamEvent?.({phase:"message",...A}))))).flatMap(A=>A.choices).flatMap(A=>{const P=A.message?.content;return typeof P!="string"?[]:[Xa(P,c,l)]}).filter(Boolean),O=await Promise.all(w.map(A=>dc(e,u,t,A,c,o,s,i,f,P=>a.onStreamEvent?.({phase:"title-rewrite",...P})))),_=n==="conventional"?O.map(A=>ic(A,c,F)):O,L=n==="conventional"&&a.conventionalScope===!1?_.map(A=>ac(A,c)):_;return Qa(L.filter(Boolean))};try{const p=await d();if(!C)return p;const h=p.filter(B=>un(B,c));if(h.length>0)return h;const y=await d(['Hard requirement for this run: use conventional title with non-empty scope exactly in "<type>(<scope>): <subject>" format.',"Do not omit scope. Pick the strongest file/class/module anchor as scope."].join(`
|
|
107
|
+
`),!1),m=y.filter(B=>un(B,c));return m.length>0?m:y}catch(p){const h=p;throw h.code==="ENOTFOUND"?new g(`Error connecting to ${h.hostname} (${h.syscall}). Are you connected to the internet?`):h}},Dn=()=>{const e=["|","/","-","\\"],u=process.stdout.isTTY?120:1e4;let t=0,D="",r=!1,o;const n=ui("\u2502"),s=a=>{if(!process.stdout.isTTY){process.stdout.write(`${a}
|
|
108
|
+
`);return}process.stdout.write(`\r\x1B[2K${a}`)},i=()=>{const a=e[t];s(`${ei("\u25C6")} ${a} ${D}`),t=(t+1)%e.length};return{start(a){if(D=a,r){i();return}if(r=!0,process.stdout.isTTY){process.stdout.write(`${n}
|
|
109
|
+
`),i(),o=setInterval(i,u);return}s(D)},update(a){D=a,!(!r||!process.stdout.isTTY)&&i()},stop(a){if(r){if(r=!1,o&&(clearInterval(o),o=void 0),process.stdout.isTTY){const f=a.split(/\r?\n/),c=f.shift()??"";process.stdout.write(`\r\x1B[2K${Me("\u25C6")} ${c}
|
|
110
|
+
`);for(const l of f)process.stdout.write(`${n} ${l}
|
|
111
|
+
`);return}process.stdout.write(`${a}
|
|
112
|
+
`)}}}},pc=e=>{const u=Math.max(0,Math.floor(e/1e3)),t=Math.floor(u/3600),D=Math.floor(u%3600/60),r=u%60;return t>0?`${t}h ${D}m ${r}s`:D>0?`${D}m ${r}s`:`${r}s`},mc=(e,u)=>{const t=Date.now(),D=1e3,r=()=>e.update(`Thinking for ${pc(Date.now()-t)} (${u})`);r();const o=setInterval(r,D);return()=>clearInterval(o)};var hc=async(e,u,t,D,r,o,n,s,i,a,f,c,l)=>(async()=>{zi(ti(Qs(" aicommits "))),await BD();const F=Dn();t&&await ne("git",["add","--update"]),F.start("Detecting staged files");const C=await wD(u);if(!C)throw F.stop("Detecting staged files"),new g("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");F.stop(`${Wi(C.files)}:
|
|
113
|
+
${C.files.map(P=>` ${P}`).join(`
|
|
114
|
+
`)}`);const d=await Mu({generate:e?.toString(),type:D?.toString(),details:r===!0?"true":void 0,"show-reasoning":o===!0?"true":void 0,"details-style":n,instructions:s,"conventional-format":i,"conventional-types":a,"conventional-scope":f,"base-url":c}),p={includeDetails:d.details,detailsStyle:d["details-style"],instructions:d.instructions,conventionalFormat:d["conventional-format"],conventionalTypes:d["conventional-types"],conventionalScope:d["conventional-scope"],changedFiles:C.files},h=d["show-reasoning"]===!0,y=Dn();y.start(`The AI (${d.model}) is analyzing your changes`);let m,B=!1,b=!0,I=!1,w;const O={message:"Message Generation","title-rewrite":"Title Rewrite"},_=P=>{if(!(P.kind!=="reasoning"||!P.text)){if(!h){B||(m=mc(y,d.model),B=!0);return}b&&(y.stop(`Streaming reasoning from ${d.model}`),b=!1),I||(process.stdout.write(`${Fe(`
|
|
115
|
+
Reasoning stream (${d.model})`)}
|
|
116
|
+
`),I=!0),P.phase!==w&&(w=P.phase,process.stdout.write(`${Fe(`[${O[P.phase]}]
|
|
117
|
+
`)}`)),process.stdout.write(P.text)}};let L;try{L=await tn(d["api-key"],d.model,d.locale,C.diff,d.generate,d["max-length"],d.type,d.timeout,d.proxy,{...p,onStreamEvent:_},d["base-url"])}finally{m?.(),b?y.stop("Changes analyzed"):h&&process.stdout.write(`
|
|
118
|
+
`)}if(L.length===0)throw new g("No commit messages were generated. Try again.");let A;if(L.length===1){[A]=L;const P=await Ni({message:`Use this commit message?
|
|
119
|
+
|
|
120
|
+
${A}
|
|
121
|
+
`});if(!P||pD(P)){Ne("Commit cancelled");return}}else{const P=await Gi({message:`Pick a commit message to use: ${Fe("(Ctrl+c to exit)")}`,options:L.map(Yu=>({label:Yu,value:Yu}))});if(pD(P)){Ne("Commit cancelled");return}A=P}await ne("git",["commit","-m",A,...l]),Ne(`${Me("\u2714")} Successfully committed!`)})().catch(F=>{Ne(`${Eu("\u2716")} ${F.message}`),Ou(F),process.exit(1)});const Ec="prepare-commit-msg-hook",gc=()=>{const e=process.argv.slice(2);return e[0]===Ec?e.slice(1):e},yc=async()=>{const{stdout:e}=await ne("git",["rev-parse","--git-path","COMMIT_EDITMSG"],{reject:!1}),u=e.trim();return u===""?void 0:u},Bc=async e=>j.readFile(e,"utf8").catch(u=>{if(u.code==="ENOENT")return"";throw u});var bc=()=>(async()=>{const[e,u]=gc(),t=e?.trim()||await yc();if(!t)return;const D=await Bc(t);if(u==="message"&&D.trim()!=="")return;const o=await wD();if(!o)return;const n=await Mu({}),s={includeDetails:n.details,detailsStyle:n["details-style"],instructions:n.instructions,conventionalFormat:n["conventional-format"],conventionalTypes:n["conventional-types"],conventionalScope:n["conventional-scope"],changedFiles:o.files},i=await tn(n["api-key"],n.model,n.locale,o.diff,n.generate,n["max-length"],n.type,n.timeout,n.proxy,s,n["base-url"]);if(i.length===0)return;const a=i[0]?.trim();if(!a)return;const f=`${a}
|
|
122
|
+
`;await j.writeFile(t,f),process.stdout.write(f)})().catch(()=>{});const wc=e=>{const u=e.indexOf("=");if(u<=0)throw new g(`Invalid config assignment: "${e}". Use <key>=<value>.`);return[e.slice(0,u),e.slice(u+1)]};var Ac=wt({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:u,keyValue:t}=e._;if(u==="get"){const D=await Mu({},!0);for(const r of t)AD(D,r)&&console.log(`${r}=${D[r]}`);return}if(u==="set"){await na(t.map(wc));return}throw new g(`Invalid mode: ${u}`)})().catch(u=>{console.error(`${Eu("\u2716")} ${u.message}`),Ou(u),process.exit(1)})});const vc=e=>j.lstat(e).then(()=>!0,()=>!1),nn="prepare-commit-msg",rn=`.git/hooks/${nn}`,$c="prepare-commit-msg-hook",on=vn(new URL("cli.mjs",import.meta.url)),sn=`
|
|
123
|
+
#!/usr/bin/env node
|
|
124
|
+
process.argv.splice(2, 0, ${JSON.stringify($c)});
|
|
125
|
+
import(${JSON.stringify($n(on))})
|
|
126
|
+
`.trim(),xc=(process.argv[1]||"").replace(/\\/g,"/").endsWith(`/${rn}`),an=async e=>await j.readFile(e,"utf8").catch(()=>{})===sn,cn=async e=>await j.realpath(e).catch(()=>{})===on;var Sc=wt({name:"hook",parameters:["<install/uninstall>"]},e=>{(async()=>{const u=await BD(),{installUninstall:t}=e._,D=W.join(u,rn),r=await vc(D);if(t==="install"){if(r){if(await an(D)){console.warn("The hook is already installed");return}if(await cn(D))await j.rm(D);else throw new g(`A different ${nn} hook seems to be installed. Please remove it before installing aicommits.`)}await j.mkdir(W.dirname(D),{recursive:!0}),await j.writeFile(D,sn),await j.chmod(D,493),console.log(`${Me("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!r){console.warn("Hook is not installed");return}if(!(await an(D)||await cn(D))){console.warn("Hook is not installed");return}await j.rm(D),console.log(`${Me("\u2714")} Hook uninstalled`);return}throw new g(`Invalid mode: ${t}`)})().catch(u=>{console.error(`${Eu("\u2716")} ${u.message}`),Ou(u),process.exit(1)})});const Tc=yD(),Ju=process.argv.slice(2),Oc=Ju[0]==="prepare-commit-msg-hook";Hr({name:"aicommits",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},type:{type:String,description:"Git commit message format (default: plain). Supports conventional",alias:"t"},details:{type:Boolean,description:"Generate commit message details/body in addition to the title"},showReasoning:{type:Boolean,description:"Stream and print model reasoning while generating messages"},detailsStyle:{type:String,description:"Body style when --details is enabled: paragraph or list"},instructions:{type:String,description:"Additional custom prompt instructions (tone, detail level, wording, etc.)"},conventionalFormat:{type:String,description:"Custom conventional commit format template (works with --type conventional)"},conventionalTypes:{type:String,description:"Custom conventional commit type map as JSON (works with --type conventional)"},conventionalScope:{type:String,description:"Conventional scope preference: true or false (default: true)"},baseUrl:{type:String,description:"API base URL for chat completions (for example https://api.openai.com/v1)"},version:{type:Boolean,description:"Show version number",alias:"v"}},commands:[Ac,Sc],help:{description:Kr},ignoreArgv:e=>e==="unknown-flag"||e==="argument"},e=>{e.flags.version&&(console.log(Tc),process.exit(0)),xc||Oc?bc():hc(e.flags.generate,e.flags.exclude,e.flags.all,e.flags.type,e.flags.details,e.flags.showReasoning,e.flags.detailsStyle,e.flags.instructions,e.flags.conventionalFormat,e.flags.conventionalTypes,e.flags.conventionalScope,e.flags.baseUrl,Ju)},Ju);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-BxYoCO_t.mjs";import{r as b}from"./token-util-Hi0Y_OJ1.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-BxoTG54R.mjs";import{r as b}from"./token-util-Dg8-JbHb.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-B4CzHGlw.mjs";import{r as b}from"./token-util-BK5iblfw.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-DoRxvV2c.mjs";import{r as b}from"./token-util-Db6xqzh1.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-ZGc9mt4a.mjs";import{r as b}from"./token-util-CnZZ1AJv.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-VKXKWT-J.mjs";import{r as b}from"./token-util-CtBubgF8.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-2IldWz4f.mjs";import{r as b}from"./token-util-CIaGUPau.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-D5LKS_gV.mjs";import{r as b}from"./token-util-C-S1NtRU.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-DOlOxITZ.mjs";import{r as b}from"./token-util-C08UmjgT.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-DhEhfPVj.mjs";import{r as b}from"./token-util-CghlsVgF.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var T=Object.defineProperty;var o=(n,p)=>T(n,"name",{value:p,configurable:!0});import{r as w,g as h}from"./cli-BLeSI0RG.mjs";import{r as b}from"./token-util-DtOpdBbh.mjs";function j(n,p){return p.forEach(function(a){a&&typeof a!="string"&&!Array.isArray(a)&&Object.keys(a).forEach(function(i){if(i!=="default"&&!(i in n)){var s=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:o(function(){return a[i]},"get")})}})}),Object.freeze(n)}o(j,"_mergeNamespaces");var k,O;function m(){if(O)return k;O=1;var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s=o((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},"__export"),y=o((e,r,t,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of a(r))!i.call(e,u)&&u!==t&&n(e,u,{get:o(()=>r[u],"get"),enumerable:!(f=p(r,u))||f.enumerable});return e},"__copyProps"),d=o(e=>y(n({},"__esModule",{value:!0}),e),"__toCommonJS"),_={};s(_,{refreshToken:o(()=>g,"refreshToken")}),k=d(_);var l=w(),c=b();async function g(){const{projectId:e,teamId:r}=(0,c.findProjectInfo)();let t=(0,c.loadToken)(e);if(!t||(0,c.isExpired)((0,c.getTokenPayload)(t.token))){const f=await(0,c.getVercelCliToken)();if(!f)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new l.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(t=await(0,c.getVercelOidcToken)(f,e,r),!t)throw new l.VercelOidcTokenError("Failed to refresh OIDC token");(0,c.saveToken)(t,e)}process.env.VERCEL_OIDC_TOKEN=t.token}return o(g,"refreshToken"),k}o(m,"requireToken");var v=m(),P=h(v),E=j({__proto__:null,default:P},[v]);export{E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var n=(t,o)=>f(t,"name",{value:o,configurable:!0});import{g as u}from"./cli-DhEhfPVj.mjs";import{r as c}from"./token-util-CghlsVgF.mjs";function p(t,o){return o.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(e){if(e!=="default"&&!(e in t)){var a=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:n(function(){return r[e]},"get")})}})}),Object.freeze(t)}n(p,"_mergeNamespaces");var i=c(),s=u(i),l=p({__proto__:null,default:s},[i]);export{l as t};
|