@sugarmo/aicommits 1.16.1 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +10 -0
  2. package/dist/cli.mjs +119 -111
  3. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -1,140 +1,148 @@
1
1
  #!/usr/bin/env node
2
- import Qe from"tty";import{Buffer as PD}from"node:buffer";import ne from"node:path";import lu,{ChildProcess as RD}from"node:child_process";import M,{stdin as _D,stdout as jD}from"node:process";import ND from"child_process";import N from"path";import et from"fs";import{fileURLToPath as fu}from"node:url";import LD,{constants as du}from"node:os";import Fu from"assert";import pu from"events";import{createWriteStream as GD,createReadStream as zD}from"node:fs";import WD from"buffer";import tt from"stream";import Cu from"util";import{debuglog as UD}from"node:util";import mu from"node:readline";import{WriteStream as qD}from"node:tty";import $ from"fs/promises";import Oe from"os";import HD from"https";import KD from"net";import VD from"tls";import JD,{fileURLToPath as hu,pathToFileURL as YD}from"url";const ZD="known-flag",XD="unknown-flag",QD="argument",{stringify:de}=JSON,er=/\B([A-Z])/g,tr=e=>e.replace(er,"-$1").toLowerCase(),{hasOwnProperty:ur}=Object.prototype,Fe=(e,t)=>ur.call(e,t),nr=e=>Array.isArray(e),gu=e=>typeof e=="function"?[e,!1]:nr(e)?[e[0],!0]:gu(e.type),Dr=(e,t)=>e===Boolean?t!=="false":t,rr=(e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),or=/[\s.:=]/,sr=e=>{const t=`Flag name ${de(e)}`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const u=e.match(or);if(u)throw new Error(`${t} cannot contain ${de(u?.[0])}`)},ir=e=>{const t={},u=(n,r)=>{if(Fe(t,n))throw new Error(`Duplicate flags named ${de(n)}`);t[n]=r};for(const n in e){if(!Fe(e,n))continue;sr(n);const r=e[n],o=[[],...gu(r),r];u(n,o);const D=tr(n);if(n!==D&&u(D,o),"alias"in r&&typeof r.alias=="string"){const{alias:i}=r,s=`Flag alias ${de(i)} for flag ${de(n)}`;if(i.length===0)throw new Error(`${s} cannot be empty`);if(i.length>1)throw new Error(`${s} must be a single character`);u(i,o)}}return t},ar=(e,t)=>{const u={};for(const n in e){if(!Fe(e,n))continue;const[r,,o,D]=t[n];if(r.length===0&&"default"in D){let{default:i}=D;typeof i=="function"&&(i=i()),u[n]=i}else u[n]=o?r:r.pop()}return u},Ie="--",cr=/[.:=]/,lr=/^-{1,2}\w/,fr=e=>{if(!lr.test(e))return;const t=!e.startsWith(Ie);let u=e.slice(t?1:2),n;const r=u.match(cr);if(r){const{index:o}=r;n=u.slice(o+1),u=u.slice(0,o)}return[u,n,t]},dr=(e,{onFlag:t,onArgument:u})=>{let n;const r=(o,D)=>{if(typeof n!="function")return!0;n(o,D),n=void 0};for(let o=0;o<e.length;o+=1){const D=e[o];if(D===Ie){r();const s=e.slice(o+1);u?.(s,[o],!0);break}const i=fr(D);if(i){if(r(),!t)continue;const[s,c,f]=i;if(f)for(let l=0;l<s.length;l+=1){r();const a=l===s.length-1;n=t(s[l],a?c:void 0,[o,l+1,a])}else n=t(s,c,[o])}else r(D,[o])&&u?.([D],[o])}r()},Fr=(e,t)=>{for(const[u,n,r]of t.reverse()){if(n){const o=e[u];let D=o.slice(0,n);if(r||(D+=o.slice(n+1)),D!=="-"){e[u]=D;continue}}e.splice(u,1)}},pr=(e,t=process.argv.slice(2),{ignore:u}={})=>{const n=[],r=ir(e),o={},D=[];return D[Ie]=[],dr(t,{onFlag(i,s,c){const f=Fe(r,i);if(!u?.(f?ZD:XD,i,s)){if(f){const[l,a]=r[i],d=Dr(a,s),F=(p,C)=>{n.push(c),C&&n.push(C),l.push(rr(a,p||""))};return d===void 0?F:F(d)}Fe(o,i)||(o[i]=[]),o[i].push(s===void 0?!0:s),n.push(c)}},onArgument(i,s,c){u?.(QD,t[s[0]])||(D.push(...i),c?(D[Ie]=i,t.splice(s[0])):n.push(s))}}),Fr(t,n),{flags:ar(e,r),unknownFlags:o,_:D}};var Cr=Object.create,Me=Object.defineProperty,mr=Object.defineProperties,hr=Object.getOwnPropertyDescriptor,gr=Object.getOwnPropertyDescriptors,Er=Object.getOwnPropertyNames,Eu=Object.getOwnPropertySymbols,yr=Object.getPrototypeOf,yu=Object.prototype.hasOwnProperty,Br=Object.prototype.propertyIsEnumerable,Bu=(e,t,u)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,ke=(e,t)=>{for(var u in t||(t={}))yu.call(t,u)&&Bu(e,u,t[u]);if(Eu)for(var u of Eu(t))Br.call(t,u)&&Bu(e,u,t[u]);return e},ut=(e,t)=>mr(e,gr(t)),br=e=>Me(e,"__esModule",{value:!0}),wr=(e,t)=>()=>(e&&(t=e(e=0)),t),Ar=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vr=(e,t,u,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Er(t))!yu.call(e,r)&&(u||r!=="default")&&Me(e,r,{get:()=>t[r],enumerable:!(n=hr(t,r))||n.enumerable});return e},$r=(e,t)=>vr(br(Me(e!=null?Cr(yr(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),L=wr(()=>{}),xr=Ar((e,t)=>{L(),t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});L(),L(),L();var Sr=e=>{var t,u,n;let r=(t=process.stdout.columns)!=null?t:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(r)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:r}:{columns:(u=e.columns)!=null?u:[],stdoutColumns:(n=e.stdoutColumns)!=null?n:r}};L(),L(),L(),L(),L();function Or({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}function bu(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Or(),"")}L();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 Mr=$r(xr(),1);function Q(e){if(typeof e!="string"||e.length===0||(e=bu(e),e.length===0))return 0;e=e.replace((0,Mr.default)()," ");let t=0;for(let u=0;u<e.length;u++){let n=e.codePointAt(u);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&u++,t+=Ir(n)?2:1)}return t}var wu=e=>Math.max(...e.split(`
3
- `).map(Q)),kr=e=>{let t=[];for(let u of e){let{length:n}=u,r=n-t.length;for(let o=0;o<r;o+=1)t.push(0);for(let o=0;o<n;o+=1){let D=wu(u[o]);D>t[o]&&(t[o]=D)}}return t};L();var Au=/^\d+%$/,vu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Tr=(e,t)=>{var u;let n=[];for(let r=0;r<e.length;r+=1){let o=(u=t[r])!=null?u:"auto";if(typeof o=="number"||o==="auto"||o==="content-width"||typeof o=="string"&&Au.test(o)){n.push(ut(ke({},vu),{width:o,contentWidth:e[r]}));continue}if(o&&typeof o=="object"){let D=ut(ke(ke({},vu),o),{contentWidth:e[r]});D.horizontalPadding=D.paddingLeft+D.paddingRight,n.push(D);continue}throw new Error(`Invalid column width: ${JSON.stringify(o)}`)}return n};function Pr(e,t){for(let u of e){let{width:n}=u;if(n==="content-width"&&(u.width=u.contentWidth),n==="auto"){let s=Math.min(20,u.contentWidth);u.width=s,u.autoOverflow=u.contentWidth-s}if(typeof n=="string"&&Au.test(n)){let s=Number.parseFloat(n.slice(0,-1))/100;u.width=Math.floor(t*s)-(u.paddingLeft+u.paddingRight)}let{horizontalPadding:r}=u,o=1,D=o+r;if(D>=t){let s=D-t,c=Math.ceil(u.paddingLeft/r*s),f=s-c;u.paddingLeft-=c,u.paddingRight-=f,u.horizontalPadding=u.paddingLeft+u.paddingRight}u.paddingLeftString=u.paddingLeft?" ".repeat(u.paddingLeft):"",u.paddingRightString=u.paddingRight?" ".repeat(u.paddingRight):"";let i=t-u.horizontalPadding;u.width=Math.max(Math.min(u.width,i),o)}}var $u=()=>Object.assign([],{columns:0});function Rr(e,t){let u=[$u()],[n]=u;for(let r of e){let o=r.width+r.horizontalPadding;n.columns+o>t&&(n=$u(),u.push(n)),n.push(r),n.columns+=o}for(let r of u){let o=r.reduce((a,d)=>a+d.width+d.horizontalPadding,0),D=t-o;if(D===0)continue;let i=r.filter(a=>"autoOverflow"in a),s=i.filter(a=>a.autoOverflow>0),c=s.reduce((a,d)=>a+d.autoOverflow,0),f=Math.min(c,D);for(let a of s){let d=Math.floor(a.autoOverflow/c*f);a.width+=d,D-=d}let l=Math.floor(D/i.length);for(let a=0;a<i.length;a+=1){let d=i[a];a===i.length-1?d.width+=D:d.width+=l,D-=l}}return u}function _r(e,t,u){let n=Tr(u,t);return Pr(n,e),Rr(n,e)}L(),L(),L();var nt=10,xu=(e=0)=>t=>`\x1B[${t+e}m`,Su=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Ou=(e=0)=>(t,u,n)=>`\x1B[${38+e};2;${t};${u};${n}m`;function jr(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[u,n]of Object.entries(t)){for(let[r,o]of Object.entries(n))t[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[r]=t[r],e.set(o[0],o[1]);Object.defineProperty(t,u,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",t.color.ansi=xu(),t.color.ansi256=Su(),t.color.ansi16m=Ou(),t.bgColor.ansi=xu(nt),t.bgColor.ansi256=Su(nt),t.bgColor.ansi16m=Ou(nt),Object.defineProperties(t,{rgbToAnsi256:{value:(u,n,r)=>u===n&&n===r?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:u=>{let n=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(u.toString(16));if(!n)return[0,0,0];let{colorString:r}=n.groups;r.length===3&&(r=r.split("").map(D=>D+D).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:u=>t.rgbToAnsi256(...t.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let n,r,o;if(u>=232)n=((u-232)*10+8)/255,r=n,o=n;else{u-=16;let s=u%36;n=Math.floor(u/36)/5,r=Math.floor(s/6)/5,o=s%6/5}let D=Math.max(n,r,o)*2;if(D===0)return 30;let i=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(n));return D===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(u,n,r)=>t.ansi256ToAnsi(t.rgbToAnsi256(u,n,r)),enumerable:!1},hexToAnsi:{value:u=>t.ansi256ToAnsi(t.hexToAnsi256(u)),enumerable:!1}}),t}var Nr=jr(),Lr=Nr,Te=new Set(["\x1B","\x9B"]),Gr=39,Dt="\x07",Iu="[",zr="]",Mu="m",rt=`${zr}8;;`,ku=e=>`${Te.values().next().value}${Iu}${e}${Mu}`,Tu=e=>`${Te.values().next().value}${rt}${e}${Dt}`,Wr=e=>e.split(" ").map(t=>Q(t)),ot=(e,t,u)=>{let n=[...t],r=!1,o=!1,D=Q(bu(e[e.length-1]));for(let[i,s]of n.entries()){let c=Q(s);if(D+c<=u?e[e.length-1]+=s:(e.push(s),D=0),Te.has(s)&&(r=!0,o=n.slice(i+1).join("").startsWith(rt)),r){o?s===Dt&&(r=!1,o=!1):s===Mu&&(r=!1);continue}D+=c,D===u&&i<n.length-1&&(e.push(""),D=0)}!D&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Ur=e=>{let t=e.split(" "),u=t.length;for(;u>0&&!(Q(t[u-1])>0);)u--;return u===t.length?e:t.slice(0,u).join(" ")+t.slice(u).join("")},qr=(e,t,u={})=>{if(u.trim!==!1&&e.trim()==="")return"";let n="",r,o,D=Wr(e),i=[""];for(let[c,f]of e.split(" ").entries()){u.trim!==!1&&(i[i.length-1]=i[i.length-1].trimStart());let l=Q(i[i.length-1]);if(c!==0&&(l>=t&&(u.wordWrap===!1||u.trim===!1)&&(i.push(""),l=0),(l>0||u.trim===!1)&&(i[i.length-1]+=" ",l++)),u.hard&&D[c]>t){let a=t-l,d=1+Math.floor((D[c]-a-1)/t);Math.floor((D[c]-1)/t)<d&&i.push(""),ot(i,f,t);continue}if(l+D[c]>t&&l>0&&D[c]>0){if(u.wordWrap===!1&&l<t){ot(i,f,t);continue}i.push("")}if(l+D[c]>t&&u.wordWrap===!1){ot(i,f,t);continue}i[i.length-1]+=f}u.trim!==!1&&(i=i.map(c=>Ur(c)));let s=[...i.join(`
4
- `)];for(let[c,f]of s.entries()){if(n+=f,Te.has(f)){let{groups:a}=new RegExp(`(?:\\${Iu}(?<code>\\d+)m|\\${rt}(?<uri>.*)${Dt})`).exec(s.slice(c).join(""))||{groups:{}};if(a.code!==void 0){let d=Number.parseFloat(a.code);r=d===Gr?void 0:d}else a.uri!==void 0&&(o=a.uri.length===0?void 0:a.uri)}let l=Lr.codes.get(Number(r));s[c+1]===`
5
- `?(o&&(n+=Tu("")),r&&l&&(n+=ku(l))):f===`
6
- `&&(r&&l&&(n+=ku(r)),o&&(n+=Tu(o)))}return n};function Hr(e,t,u){return String(e).normalize().replace(/\r\n/g,`
2
+ import Dt from"tty";import{Buffer as Hr}from"node:buffer";import oe from"node:path";import Cu,{ChildProcess as Vr}from"node:child_process";import T,{stdin as Kr,stdout as Jr}from"node:process";import Yr from"child_process";import N from"path";import ot from"fs";import{fileURLToPath as mu}from"node:url";import Zr,{constants as hu}from"node:os";import gu from"assert";import Eu from"events";import{createWriteStream as Xr,createReadStream as Qr}from"node:fs";import eD from"buffer";import st from"stream";import yu from"util";import{debuglog as tD}from"node:util";import bu from"node:readline";import{WriteStream as uD}from"node:tty";import A from"fs/promises";import Oe from"os";import nD from"https";import rD from"net";import DD from"tls";import oD,{fileURLToPath as wu,pathToFileURL as sD}from"url";const iD="known-flag",aD="unknown-flag",cD="argument",{stringify:pe}=JSON,lD=/\B([A-Z])/g,fD=e=>e.replace(lD,"-$1").toLowerCase(),{hasOwnProperty:dD}=Object.prototype,Ce=(e,t)=>dD.call(e,t),FD=e=>Array.isArray(e),Bu=e=>typeof e=="function"?[e,!1]:FD(e)?[e[0],!0]:Bu(e.type),pD=(e,t)=>e===Boolean?t!=="false":t,CD=(e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),mD=/[\s.:=]/,hD=e=>{const t=`Flag name ${pe(e)}`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const u=e.match(mD);if(u)throw new Error(`${t} cannot contain ${pe(u?.[0])}`)},gD=e=>{const t={},u=(n,D)=>{if(Ce(t,n))throw new Error(`Duplicate flags named ${pe(n)}`);t[n]=D};for(const n in e){if(!Ce(e,n))continue;hD(n);const D=e[n],o=[[],...Bu(D),D];u(n,o);const r=fD(n);if(n!==r&&u(r,o),"alias"in D&&typeof D.alias=="string"){const{alias:i}=D,s=`Flag alias ${pe(i)} for flag ${pe(n)}`;if(i.length===0)throw new Error(`${s} cannot be empty`);if(i.length>1)throw new Error(`${s} must be a single character`);u(i,o)}}return t},ED=(e,t)=>{const u={};for(const n in e){if(!Ce(e,n))continue;const[D,,o,r]=t[n];if(D.length===0&&"default"in r){let{default:i}=r;typeof i=="function"&&(i=i()),u[n]=i}else u[n]=o?D:D.pop()}return u},Te="--",yD=/[.:=]/,bD=/^-{1,2}\w/,wD=e=>{if(!bD.test(e))return;const t=!e.startsWith(Te);let u=e.slice(t?1:2),n;const D=u.match(yD);if(D){const{index:o}=D;n=u.slice(o+1),u=u.slice(0,o)}return[u,n,t]},BD=(e,{onFlag:t,onArgument:u})=>{let n;const D=(o,r)=>{if(typeof n!="function")return!0;n(o,r),n=void 0};for(let o=0;o<e.length;o+=1){const r=e[o];if(r===Te){D();const s=e.slice(o+1);u?.(s,[o],!0);break}const i=wD(r);if(i){if(D(),!t)continue;const[s,c,f]=i;if(f)for(let l=0;l<s.length;l+=1){D();const a=l===s.length-1;n=t(s[l],a?c:void 0,[o,l+1,a])}else n=t(s,c,[o])}else D(r,[o])&&u?.([r],[o])}D()},vD=(e,t)=>{for(const[u,n,D]of t.reverse()){if(n){const o=e[u];let r=o.slice(0,n);if(D||(r+=o.slice(n+1)),r!=="-"){e[u]=r;continue}}e.splice(u,1)}},AD=(e,t=process.argv.slice(2),{ignore:u}={})=>{const n=[],D=gD(e),o={},r=[];return r[Te]=[],BD(t,{onFlag(i,s,c){const f=Ce(D,i);if(!u?.(f?iD:aD,i,s)){if(f){const[l,a]=D[i],d=pD(a,s),F=(h,p)=>{n.push(c),p&&n.push(p),l.push(CD(a,h||""))};return d===void 0?F:F(d)}Ce(o,i)||(o[i]=[]),o[i].push(s===void 0?!0:s),n.push(c)}},onArgument(i,s,c){u?.(cD,t[s[0]])||(r.push(...i),c?(r[Te]=i,t.splice(s[0])):n.push(s))}}),vD(t,n),{flags:ED(e,D),unknownFlags:o,_:r}};var $D=Object.create,Pe=Object.defineProperty,xD=Object.defineProperties,SD=Object.getOwnPropertyDescriptor,kD=Object.getOwnPropertyDescriptors,MD=Object.getOwnPropertyNames,vu=Object.getOwnPropertySymbols,ID=Object.getPrototypeOf,Au=Object.prototype.hasOwnProperty,OD=Object.prototype.propertyIsEnumerable,$u=(e,t,u)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,Re=(e,t)=>{for(var u in t||(t={}))Au.call(t,u)&&$u(e,u,t[u]);if(vu)for(var u of vu(t))OD.call(t,u)&&$u(e,u,t[u]);return e},it=(e,t)=>xD(e,kD(t)),TD=e=>Pe(e,"__esModule",{value:!0}),PD=(e,t)=>()=>(e&&(t=e(e=0)),t),RD=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_D=(e,t,u,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let D of MD(t))!Au.call(e,D)&&(u||D!=="default")&&Pe(e,D,{get:()=>t[D],enumerable:!(n=SD(t,D))||n.enumerable});return e},jD=(e,t)=>_D(TD(Pe(e!=null?$D(ID(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),L=PD(()=>{}),ND=RD((e,t)=>{L(),t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});L(),L(),L();var LD=e=>{var t,u,n;let D=(t=process.stdout.columns)!=null?t:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(D)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:D}:{columns:(u=e.columns)!=null?u:[],stdoutColumns:(n=e.stdoutColumns)!=null?n:D}};L(),L(),L(),L(),L();function GD({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}function xu(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(GD(),"")}L();function WD(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 zD=jD(ND(),1);function ue(e){if(typeof e!="string"||e.length===0||(e=xu(e),e.length===0))return 0;e=e.replace((0,zD.default)()," ");let t=0;for(let u=0;u<e.length;u++){let n=e.codePointAt(u);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&u++,t+=WD(n)?2:1)}return t}var Su=e=>Math.max(...e.split(`
3
+ `).map(ue)),UD=e=>{let t=[];for(let u of e){let{length:n}=u,D=n-t.length;for(let o=0;o<D;o+=1)t.push(0);for(let o=0;o<n;o+=1){let r=Su(u[o]);r>t[o]&&(t[o]=r)}}return t};L();var ku=/^\d+%$/,Mu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},qD=(e,t)=>{var u;let n=[];for(let D=0;D<e.length;D+=1){let o=(u=t[D])!=null?u:"auto";if(typeof o=="number"||o==="auto"||o==="content-width"||typeof o=="string"&&ku.test(o)){n.push(it(Re({},Mu),{width:o,contentWidth:e[D]}));continue}if(o&&typeof o=="object"){let r=it(Re(Re({},Mu),o),{contentWidth:e[D]});r.horizontalPadding=r.paddingLeft+r.paddingRight,n.push(r);continue}throw new Error(`Invalid column width: ${JSON.stringify(o)}`)}return n};function HD(e,t){for(let u of e){let{width:n}=u;if(n==="content-width"&&(u.width=u.contentWidth),n==="auto"){let s=Math.min(20,u.contentWidth);u.width=s,u.autoOverflow=u.contentWidth-s}if(typeof n=="string"&&ku.test(n)){let s=Number.parseFloat(n.slice(0,-1))/100;u.width=Math.floor(t*s)-(u.paddingLeft+u.paddingRight)}let{horizontalPadding:D}=u,o=1,r=o+D;if(r>=t){let s=r-t,c=Math.ceil(u.paddingLeft/D*s),f=s-c;u.paddingLeft-=c,u.paddingRight-=f,u.horizontalPadding=u.paddingLeft+u.paddingRight}u.paddingLeftString=u.paddingLeft?" ".repeat(u.paddingLeft):"",u.paddingRightString=u.paddingRight?" ".repeat(u.paddingRight):"";let i=t-u.horizontalPadding;u.width=Math.max(Math.min(u.width,i),o)}}var Iu=()=>Object.assign([],{columns:0});function VD(e,t){let u=[Iu()],[n]=u;for(let D of e){let o=D.width+D.horizontalPadding;n.columns+o>t&&(n=Iu(),u.push(n)),n.push(D),n.columns+=o}for(let D of u){let o=D.reduce((a,d)=>a+d.width+d.horizontalPadding,0),r=t-o;if(r===0)continue;let i=D.filter(a=>"autoOverflow"in a),s=i.filter(a=>a.autoOverflow>0),c=s.reduce((a,d)=>a+d.autoOverflow,0),f=Math.min(c,r);for(let a of s){let d=Math.floor(a.autoOverflow/c*f);a.width+=d,r-=d}let l=Math.floor(r/i.length);for(let a=0;a<i.length;a+=1){let d=i[a];a===i.length-1?d.width+=r:d.width+=l,r-=l}}return u}function KD(e,t,u){let n=qD(u,t);return HD(n,e),VD(n,e)}L(),L(),L();var at=10,Ou=(e=0)=>t=>`\x1B[${t+e}m`,Tu=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Pu=(e=0)=>(t,u,n)=>`\x1B[${38+e};2;${t};${u};${n}m`;function JD(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[u,n]of Object.entries(t)){for(let[D,o]of Object.entries(n))t[D]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[D]=t[D],e.set(o[0],o[1]);Object.defineProperty(t,u,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",t.color.ansi=Ou(),t.color.ansi256=Tu(),t.color.ansi16m=Pu(),t.bgColor.ansi=Ou(at),t.bgColor.ansi256=Tu(at),t.bgColor.ansi16m=Pu(at),Object.defineProperties(t,{rgbToAnsi256:{value:(u,n,D)=>u===n&&n===D?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(n/255*5)+Math.round(D/255*5),enumerable:!1},hexToRgb:{value:u=>{let n=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(u.toString(16));if(!n)return[0,0,0];let{colorString:D}=n.groups;D.length===3&&(D=D.split("").map(r=>r+r).join(""));let o=Number.parseInt(D,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:u=>t.rgbToAnsi256(...t.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let n,D,o;if(u>=232)n=((u-232)*10+8)/255,D=n,o=n;else{u-=16;let s=u%36;n=Math.floor(u/36)/5,D=Math.floor(s/6)/5,o=s%6/5}let r=Math.max(n,D,o)*2;if(r===0)return 30;let i=30+(Math.round(o)<<2|Math.round(D)<<1|Math.round(n));return r===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(u,n,D)=>t.ansi256ToAnsi(t.rgbToAnsi256(u,n,D)),enumerable:!1},hexToAnsi:{value:u=>t.ansi256ToAnsi(t.hexToAnsi256(u)),enumerable:!1}}),t}var YD=JD(),ZD=YD,_e=new Set(["\x1B","\x9B"]),XD=39,ct="\x07",Ru="[",QD="]",_u="m",lt=`${QD}8;;`,ju=e=>`${_e.values().next().value}${Ru}${e}${_u}`,Nu=e=>`${_e.values().next().value}${lt}${e}${ct}`,eo=e=>e.split(" ").map(t=>ue(t)),ft=(e,t,u)=>{let n=[...t],D=!1,o=!1,r=ue(xu(e[e.length-1]));for(let[i,s]of n.entries()){let c=ue(s);if(r+c<=u?e[e.length-1]+=s:(e.push(s),r=0),_e.has(s)&&(D=!0,o=n.slice(i+1).join("").startsWith(lt)),D){o?s===ct&&(D=!1,o=!1):s===_u&&(D=!1);continue}r+=c,r===u&&i<n.length-1&&(e.push(""),r=0)}!r&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},to=e=>{let t=e.split(" "),u=t.length;for(;u>0&&!(ue(t[u-1])>0);)u--;return u===t.length?e:t.slice(0,u).join(" ")+t.slice(u).join("")},uo=(e,t,u={})=>{if(u.trim!==!1&&e.trim()==="")return"";let n="",D,o,r=eo(e),i=[""];for(let[c,f]of e.split(" ").entries()){u.trim!==!1&&(i[i.length-1]=i[i.length-1].trimStart());let l=ue(i[i.length-1]);if(c!==0&&(l>=t&&(u.wordWrap===!1||u.trim===!1)&&(i.push(""),l=0),(l>0||u.trim===!1)&&(i[i.length-1]+=" ",l++)),u.hard&&r[c]>t){let a=t-l,d=1+Math.floor((r[c]-a-1)/t);Math.floor((r[c]-1)/t)<d&&i.push(""),ft(i,f,t);continue}if(l+r[c]>t&&l>0&&r[c]>0){if(u.wordWrap===!1&&l<t){ft(i,f,t);continue}i.push("")}if(l+r[c]>t&&u.wordWrap===!1){ft(i,f,t);continue}i[i.length-1]+=f}u.trim!==!1&&(i=i.map(c=>to(c)));let s=[...i.join(`
4
+ `)];for(let[c,f]of s.entries()){if(n+=f,_e.has(f)){let{groups:a}=new RegExp(`(?:\\${Ru}(?<code>\\d+)m|\\${lt}(?<uri>.*)${ct})`).exec(s.slice(c).join(""))||{groups:{}};if(a.code!==void 0){let d=Number.parseFloat(a.code);D=d===XD?void 0:d}else a.uri!==void 0&&(o=a.uri.length===0?void 0:a.uri)}let l=ZD.codes.get(Number(D));s[c+1]===`
5
+ `?(o&&(n+=Nu("")),D&&l&&(n+=ju(l))):f===`
6
+ `&&(D&&l&&(n+=ju(D)),o&&(n+=Nu(o)))}return n};function no(e,t,u){return String(e).normalize().replace(/\r\n/g,`
7
7
  `).split(`
8
- `).map(n=>qr(n,t,u)).join(`
9
- `)}var Pu=e=>Array.from({length:e}).fill("");function Kr(e,t){let u=[],n=0;for(let r of e){let o=0,D=r.map(s=>{var c;let f=(c=t[n])!=null?c:"";n+=1,s.preprocess&&(f=s.preprocess(f)),wu(f)>s.width&&(f=Hr(f,s.width,{hard:!0}));let l=f.split(`
10
- `);if(s.postprocess){let{postprocess:a}=s;l=l.map((d,F)=>a.call(s,d,F))}return s.paddingTop&&l.unshift(...Pu(s.paddingTop)),s.paddingBottom&&l.push(...Pu(s.paddingBottom)),l.length>o&&(o=l.length),ut(ke({},s),{lines:l})}),i=[];for(let s=0;s<o;s+=1){let c=D.map(f=>{var l;let a=(l=f.lines[s])!=null?l:"",d=Number.isFinite(f.width)?" ".repeat(f.width-Q(a)):"",F=f.paddingLeftString;return f.align==="right"&&(F+=d),F+=a,f.align==="left"&&(F+=d),F+f.paddingRightString}).join("");i.push(c)}u.push(i.join(`
8
+ `).map(n=>uo(n,t,u)).join(`
9
+ `)}var Lu=e=>Array.from({length:e}).fill("");function ro(e,t){let u=[],n=0;for(let D of e){let o=0,r=D.map(s=>{var c;let f=(c=t[n])!=null?c:"";n+=1,s.preprocess&&(f=s.preprocess(f)),Su(f)>s.width&&(f=no(f,s.width,{hard:!0}));let l=f.split(`
10
+ `);if(s.postprocess){let{postprocess:a}=s;l=l.map((d,F)=>a.call(s,d,F))}return s.paddingTop&&l.unshift(...Lu(s.paddingTop)),s.paddingBottom&&l.push(...Lu(s.paddingBottom)),l.length>o&&(o=l.length),it(Re({},s),{lines:l})}),i=[];for(let s=0;s<o;s+=1){let c=r.map(f=>{var l;let a=(l=f.lines[s])!=null?l:"",d=Number.isFinite(f.width)?" ".repeat(f.width-ue(a)):"",F=f.paddingLeftString;return f.align==="right"&&(F+=d),F+=a,f.align==="left"&&(F+=d),F+f.paddingRightString}).join("");i.push(c)}u.push(i.join(`
11
11
  `))}return u.join(`
12
- `)}function Vr(e,t){if(!e||e.length===0)return"";let u=kr(e),n=u.length;if(n===0)return"";let{stdoutColumns:r,columns:o}=Sr(t);if(o.length>n)throw new Error(`${o.length} columns defined, but only ${n} columns found`);let D=_r(r,o,u);return e.map(i=>Kr(D,i)).join(`
13
- `)}L();var Jr=["<",">","=",">=","<="];function Yr(e){if(!Jr.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function Zr(e){let t=Object.keys(e).map(u=>{let[n,r]=u.split(" ");Yr(n);let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new TypeError(`Invalid breakpoint value: ${r}`);let D=e[u];return{operator:n,breakpoint:o,value:D}}).sort((u,n)=>n.breakpoint-u.breakpoint);return u=>{var n;return(n=t.find(({operator:r,breakpoint:o})=>r==="="&&u===o||r===">"&&u>o||r==="<"&&u<o||r===">="&&u>=o||r==="<="&&u<=o))==null?void 0:n.value}}const Xr=e=>e.replace(/[\W_]([a-z\d])?/gi,(t,u)=>u?u.toUpperCase():""),Qr=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),eo={"> 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 to(e){let t=!1;return{type:"table",data:{tableData:Object.keys(e).sort((u,n)=>u.localeCompare(n)).map(u=>{const n=e[u],r="alias"in n;return r&&(t=!0),{name:u,flag:n,flagFormatted:`--${Qr(u)}`,aliasesEnabled:t,aliasFormatted:r?`-${n.alias}`:void 0}}).map(u=>(u.aliasesEnabled=t,[{type:"flagName",data:u},{type:"flagDescription",data:u}])),tableBreakpoints:eo}}}const Ru=e=>!e||(e.version??(e.help?e.help.version:void 0)),_u=e=>{const t="parent"in e&&e.parent?.name;return(t?`${t} `:"")+e.name};function uo(e){const t=[];e.name&&t.push(_u(e));const u=Ru(e)??("parent"in e&&Ru(e.parent));if(u&&t.push(`v${u}`),t.length!==0)return{id:"name",type:"text",data:`${t.join(" ")}
14
- `}}function no(e){const{help:t}=e;if(!(!t||!t.description))return{id:"description",type:"text",data:`${t.description}
15
- `}}function Do(e){const t=e.help||{};if("usage"in t)return t.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(t.usage)?t.usage.join(`
16
- `):t.usage}}:void 0;if(e.name){const u=[],n=[_u(e)];if(e.flags&&Object.keys(e.flags).length>0&&n.push("[flags...]"),e.parameters&&e.parameters.length>0){const{parameters:r}=e,o=r.indexOf("--"),D=o>-1&&r.slice(o+1).some(i=>i.startsWith("<"));n.push(r.map(i=>i!=="--"?i:D?"--":"[--]").join(" "))}if(n.length>1&&u.push(n.join(" ")),"commands"in e&&e.commands?.length&&u.push(`${e.name} <command>`),u.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:u.join(`
17
- `)}}}}function ro(e){return!("commands"in e)||!e.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:e.commands.map(t=>[t.options.name,t.options.help?t.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function oo(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:to(e.flags),indentBody:0}}}function so(e){const{help:t}=e;if(!t||!t.examples||t.examples.length===0)return;let{examples:u}=t;if(Array.isArray(u)&&(u=u.join(`
18
- `)),u)return{id:"examples",type:"section",data:{title:"Examples:",body:u}}}function io(e){if(!("alias"in e)||!e.alias)return;const{alias:t}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(t)?t.join(", "):t}}}const ao=e=>[uo,no,Do,ro,oo,so,io].map(t=>t(e)).filter(Boolean),co=Qe.WriteStream.prototype.hasColors();class lo{text(t){return t}bold(t){return co?`\x1B[1m${t}\x1B[22m`:t.toLocaleUpperCase()}indentText({text:t,spaces:u}){return t.replace(/^/gm," ".repeat(u))}heading(t){return this.bold(t)}section({title:t,body:u,indentBody:n=2}){return`${(t?`${this.heading(t)}
12
+ `)}function Do(e,t){if(!e||e.length===0)return"";let u=UD(e),n=u.length;if(n===0)return"";let{stdoutColumns:D,columns:o}=LD(t);if(o.length>n)throw new Error(`${o.length} columns defined, but only ${n} columns found`);let r=KD(D,o,u);return e.map(i=>ro(r,i)).join(`
13
+ `)}L();var oo=["<",">","=",">=","<="];function so(e){if(!oo.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function io(e){let t=Object.keys(e).map(u=>{let[n,D]=u.split(" ");so(n);let o=Number.parseInt(D,10);if(Number.isNaN(o))throw new TypeError(`Invalid breakpoint value: ${D}`);let r=e[u];return{operator:n,breakpoint:o,value:r}}).sort((u,n)=>n.breakpoint-u.breakpoint);return u=>{var n;return(n=t.find(({operator:D,breakpoint:o})=>D==="="&&u===o||D===">"&&u>o||D==="<"&&u<o||D===">="&&u>=o||D==="<="&&u<=o))==null?void 0:n.value}}const ao=e=>e.replace(/[\W_]([a-z\d])?/gi,(t,u)=>u?u.toUpperCase():""),co=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),lo={"> 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 fo(e){let t=!1;return{type:"table",data:{tableData:Object.keys(e).sort((u,n)=>u.localeCompare(n)).map(u=>{const n=e[u],D="alias"in n;return D&&(t=!0),{name:u,flag:n,flagFormatted:`--${co(u)}`,aliasesEnabled:t,aliasFormatted:D?`-${n.alias}`:void 0}}).map(u=>(u.aliasesEnabled=t,[{type:"flagName",data:u},{type:"flagDescription",data:u}])),tableBreakpoints:lo}}}const Gu=e=>!e||(e.version??(e.help?e.help.version:void 0)),Wu=e=>{const t="parent"in e&&e.parent?.name;return(t?`${t} `:"")+e.name};function Fo(e){const t=[];e.name&&t.push(Wu(e));const u=Gu(e)??("parent"in e&&Gu(e.parent));if(u&&t.push(`v${u}`),t.length!==0)return{id:"name",type:"text",data:`${t.join(" ")}
14
+ `}}function po(e){const{help:t}=e;if(!(!t||!t.description))return{id:"description",type:"text",data:`${t.description}
15
+ `}}function Co(e){const t=e.help||{};if("usage"in t)return t.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(t.usage)?t.usage.join(`
16
+ `):t.usage}}:void 0;if(e.name){const u=[],n=[Wu(e)];if(e.flags&&Object.keys(e.flags).length>0&&n.push("[flags...]"),e.parameters&&e.parameters.length>0){const{parameters:D}=e,o=D.indexOf("--"),r=o>-1&&D.slice(o+1).some(i=>i.startsWith("<"));n.push(D.map(i=>i!=="--"?i:r?"--":"[--]").join(" "))}if(n.length>1&&u.push(n.join(" ")),"commands"in e&&e.commands?.length&&u.push(`${e.name} <command>`),u.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:u.join(`
17
+ `)}}}}function mo(e){return!("commands"in e)||!e.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:e.commands.map(t=>[t.options.name,t.options.help?t.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function ho(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:fo(e.flags),indentBody:0}}}function go(e){const{help:t}=e;if(!t||!t.examples||t.examples.length===0)return;let{examples:u}=t;if(Array.isArray(u)&&(u=u.join(`
18
+ `)),u)return{id:"examples",type:"section",data:{title:"Examples:",body:u}}}function Eo(e){if(!("alias"in e)||!e.alias)return;const{alias:t}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(t)?t.join(", "):t}}}const yo=e=>[Fo,po,Co,mo,ho,go,Eo].map(t=>t(e)).filter(Boolean),bo=Dt.WriteStream.prototype.hasColors();class wo{text(t){return t}bold(t){return bo?`\x1B[1m${t}\x1B[22m`:t.toLocaleUpperCase()}indentText({text:t,spaces:u}){return t.replace(/^/gm," ".repeat(u))}heading(t){return this.bold(t)}section({title:t,body:u,indentBody:n=2}){return`${(t?`${this.heading(t)}
19
19
  `:"")+(u?this.indentText({text:this.render(u),spaces:n}):"")}
20
- `}table({tableData:t,tableOptions:u,tableBreakpoints:n}){return Vr(t.map(r=>r.map(o=>this.render(o))),n?Zr(n):u)}flagParameter(t){return t===Boolean?"":t===String?"<string>":t===Number?"<number>":Array.isArray(t)?this.flagParameter(t[0]):"<value>"}flagOperator(t){return" "}flagName(t){const{flag:u,flagFormatted:n,aliasesEnabled:r,aliasFormatted:o}=t;let D="";if(o?D+=`${o}, `:r&&(D+=" "),D+=n,"placeholder"in u&&typeof u.placeholder=="string")D+=`${this.flagOperator(t)}${u.placeholder}`;else{const i=this.flagParameter("type"in u?u.type:u);i&&(D+=`${this.flagOperator(t)}${i}`)}return D}flagDefault(t){return JSON.stringify(t)}flagDescription({flag:t}){let u="description"in t?t.description??"":"";if("default"in t){let{default:n}=t;typeof n=="function"&&(n=n()),n&&(u+=` (default: ${this.flagDefault(n)})`)}return u}render(t){if(typeof t=="string")return t;if(Array.isArray(t))return t.map(u=>this.render(u)).join(`
21
- `);if("type"in t&&this[t.type]){const u=this[t.type];if(typeof u=="function")return u.call(this,t.data)}throw new Error(`Invalid node type: ${JSON.stringify(t)}`)}}const st=e=>e.length>0&&!e.includes(" "),{stringify:K}=JSON,fo=/[|\\{}()[\]^$+*?.]/;function it(e){const t=[];let u,n;for(const r of e){if(n)throw new Error(`Invalid parameter: Spread parameter ${K(n)} must be last`);const o=r[0],D=r[r.length-1];let i;if(o==="<"&&D===">"&&(i=!0,u))throw new Error(`Invalid parameter: Required parameter ${K(r)} cannot come after optional parameter ${K(u)}`);if(o==="["&&D==="]"&&(i=!1,u=r),i===void 0)throw new Error(`Invalid parameter: ${K(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let s=r.slice(1,-1);const c=s.slice(-3)==="...";c&&(n=r,s=s.slice(0,-3));const f=s.match(fo);if(f)throw new Error(`Invalid parameter: ${K(r)}. Invalid character found ${K(f[0])}`);t.push({name:s,required:i,spread:c})}return t}function at(e,t,u,n){for(let r=0;r<t.length;r+=1){const{name:o,required:D,spread:i}=t[r],s=Xr(o);if(s in e)throw new Error(`Invalid parameter: ${K(o)} is used more than once.`);const c=i?u.slice(r):u[r];if(i&&(r=t.length),D&&(!c||i&&c.length===0))return console.error(`Error: Missing required parameter ${K(o)}
22
- `),n(),process.exit(1);e[s]=c}}function Fo(e){return e===void 0||e!==!1}function ju(e,t,u,n){const r={...t.flags},o=t.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:D}=t,i=Fo(D);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const s=pr(r,n,{ignore:t.ignoreArgv}),c=()=>{console.log(t.version)};if(o&&s.flags.version===!0)return c(),process.exit(0);const f=new lo,l=i&&D?.render?D.render:F=>f.render(F),a=F=>{const p=ao({...t,...F?{help:F}:{},flags:r});console.log(l(p,f))};if(i&&s.flags.help===!0)return a(),process.exit(0);if(t.parameters){let{parameters:F}=t,p=s._;const C=F.indexOf("--"),h=F.slice(C+1),y=Object.create(null);if(C>-1&&h.length>0){F=F.slice(0,C);const A=s._["--"];p=p.slice(0,-A.length||void 0),at(y,it(F),p,a),at(y,it(h),A,a)}else at(y,it(F),p,a);Object.assign(s._,y)}const d={...s,showVersion:c,showHelp:a};return typeof u=="function"&&u(d),{command:e,...d}}function po(e,t){const u=new Map;for(const n of t){const r=[n.options.name],{alias:o}=n.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const D of r){if(u.has(D))throw new Error(`Duplicate command name found: ${K(D)}`);u.set(D,n)}}return u.get(e)}function Co(e,t,u=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!st(e.name)))throw new Error(`Invalid script name: ${K(e.name)}`);const n=u[0];if(e.commands&&n&&st(n)){const r=po(n,e.commands);if(r)return ju(r.options.name,{...r.options,parent:e},r.callback,u.slice(1))}return ju(void 0,e,t,u)}function Nu(e,t){if(!e)throw new Error("Command options are required");const{name:u}=e;if(u===void 0)throw new Error("Command name is required");if(!st(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:e,callback:t}}var mo="1.16.1",ho="Writes your git commit messages for you with AI",go="sugarmo/aicommits",T=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var re={exports:{}},ct,Lu;function Eo(){if(Lu)return ct;Lu=1,ct=n,n.sync=r;var e=et;function t(o,D){var i=D.pathExt!==void 0?D.pathExt:process.env.PATHEXT;if(!i||(i=i.split(";"),i.indexOf("")!==-1))return!0;for(var s=0;s<i.length;s++){var c=i[s].toLowerCase();if(c&&o.substr(-c.length).toLowerCase()===c)return!0}return!1}function u(o,D,i){return!o.isSymbolicLink()&&!o.isFile()?!1:t(D,i)}function n(o,D,i){e.stat(o,function(s,c){i(s,s?!1:u(c,o,D))})}function r(o,D){return u(e.statSync(o),o,D)}return ct}var lt,Gu;function yo(){if(Gu)return lt;Gu=1,lt=t,t.sync=u;var e=et;function t(o,D,i){e.stat(o,function(s,c){i(s,s?!1:n(c,D))})}function u(o,D){return n(e.statSync(o),D)}function n(o,D){return o.isFile()&&r(o,D)}function r(o,D){var i=o.mode,s=o.uid,c=o.gid,f=D.uid!==void 0?D.uid:process.getuid&&process.getuid(),l=D.gid!==void 0?D.gid:process.getgid&&process.getgid(),a=parseInt("100",8),d=parseInt("010",8),F=parseInt("001",8),p=a|d,C=i&F||i&d&&c===l||i&a&&s===f||i&p&&f===0;return C}return lt}var Pe;process.platform==="win32"||T.TESTING_WINDOWS?Pe=Eo():Pe=yo();var Bo=ft;ft.sync=bo;function ft(e,t,u){if(typeof t=="function"&&(u=t,t={}),!u){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,r){ft(e,t||{},function(o,D){o?r(o):n(D)})})}Pe(e,t||{},function(n,r){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,r=!1),u(n,r)})}function bo(e,t){try{return Pe.sync(e,t||{})}catch(u){if(t&&t.ignoreErrors||u.code==="EACCES")return!1;throw u}}const oe=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",zu=N,wo=oe?";":":",Wu=Bo,Uu=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),qu=(e,t)=>{const u=t.colon||wo,n=e.match(/\//)||oe&&e.match(/\\/)?[""]:[...oe?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(u)],r=oe?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=oe?r.split(u):[""];return oe&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:r}},Hu=(e,t,u)=>{typeof t=="function"&&(u=t,t={}),t||(t={});const{pathEnv:n,pathExt:r,pathExtExe:o}=qu(e,t),D=[],i=c=>new Promise((f,l)=>{if(c===n.length)return t.all&&D.length?f(D):l(Uu(e));const a=n[c],d=/^".*"$/.test(a)?a.slice(1,-1):a,F=zu.join(d,e),p=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+F:F;f(s(p,c,0))}),s=(c,f,l)=>new Promise((a,d)=>{if(l===r.length)return a(i(f+1));const F=r[l];Wu(c+F,{pathExt:o},(p,C)=>{if(!p&&C)if(t.all)D.push(c+F);else return a(c+F);return a(s(c,f,l+1))})});return u?i(0).then(c=>u(null,c),u):i(0)},Ao=(e,t)=>{t=t||{};const{pathEnv:u,pathExt:n,pathExtExe:r}=qu(e,t),o=[];for(let D=0;D<u.length;D++){const i=u[D],s=/^".*"$/.test(i)?i.slice(1,-1):i,c=zu.join(s,e),f=!s&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let l=0;l<n.length;l++){const a=f+n[l];try{if(Wu.sync(a,{pathExt:r}))if(t.all)o.push(a);else return a}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw Uu(e)};var vo=Hu;Hu.sync=Ao;var dt={exports:{}};const Ku=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};dt.exports=Ku,dt.exports.default=Ku;var $o=dt.exports;const Vu=N,xo=vo,So=$o;function Ju(e,t){const u=e.options.env||process.env,n=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 D;try{D=xo.sync(e.command,{path:u[So({env:u})],pathExt:t?Vu.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return D&&(D=Vu.resolve(r?e.options.cwd:"",D)),D}function Oo(e){return Ju(e)||Ju(e,!0)}var Io=Oo,Ft={};const pt=/([()\][%!^"`<>&|;, *?])/g;function Mo(e){return e=e.replace(pt,"^$1"),e}function ko(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(pt,"^$1"),t&&(e=e.replace(pt,"^$1")),e}Ft.command=Mo,Ft.argument=ko;var To=/^#!(.*)/;const Po=To;var Ro=(e="")=>{const t=e.match(Po);if(!t)return null;const[u,n]=t[0].replace(/#! ?/,"").split(" "),r=u.split("/").pop();return r==="env"?n:n?`${r} ${n}`:r};const Ct=et,_o=Ro;function jo(e){const u=Buffer.alloc(150);let n;try{n=Ct.openSync(e,"r"),Ct.readSync(n,u,0,150,0),Ct.closeSync(n)}catch{}return _o(u.toString())}var No=jo;const Lo=N,Yu=Io,Zu=Ft,Go=No,zo=process.platform==="win32",Wo=/\.(?:com|exe)$/i,Uo=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qo(e){e.file=Yu(e);const t=e.file&&Go(e.file);return t?(e.args.unshift(e.file),e.command=t,Yu(e)):e.file}function Ho(e){if(!zo)return e;const t=qo(e),u=!Wo.test(t);if(e.options.forceShell||u){const n=Uo.test(t);e.command=Lo.normalize(e.command),e.command=Zu.command(e.command),e.args=e.args.map(o=>Zu.argument(o,n));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 Ko(e,t,u){t&&!Array.isArray(t)&&(u=t,t=null),t=t?t.slice(0):[],u=Object.assign({},u);const n={command:e,args:t,options:u,file:void 0,original:{command:e,args:t}};return u.shell?n:Ho(n)}var Vo=Ko;const mt=process.platform==="win32";function ht(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Jo(e,t){if(!mt)return;const u=e.emit;e.emit=function(n,r){if(n==="exit"){const o=Xu(r,t);if(o)return u.call(e,"error",o)}return u.apply(e,arguments)}}function Xu(e,t){return mt&&e===1&&!t.file?ht(t.original,"spawn"):null}function Yo(e,t){return mt&&e===1&&!t.file?ht(t.original,"spawnSync"):null}var Zo={hookChildProcess:Jo,verifyENOENT:Xu,verifyENOENTSync:Yo,notFoundError:ht};const Qu=ND,gt=Vo,Et=Zo;function en(e,t,u){const n=gt(e,t,u),r=Qu.spawn(n.command,n.args,n.options);return Et.hookChildProcess(r,n),r}function Xo(e,t,u){const n=gt(e,t,u),r=Qu.spawnSync(n.command,n.args,n.options);return r.error=r.error||Et.verifyENOENTSync(r.status,n),r}re.exports=en,re.exports.spawn=en,re.exports.sync=Xo,re.exports._parse=gt,re.exports._enoent=Et;var Qo=re.exports,es=De(Qo);function ts(e){const t=typeof e=="string"?`
20
+ `}table({tableData:t,tableOptions:u,tableBreakpoints:n}){return Do(t.map(D=>D.map(o=>this.render(o))),n?io(n):u)}flagParameter(t){return t===Boolean?"":t===String?"<string>":t===Number?"<number>":Array.isArray(t)?this.flagParameter(t[0]):"<value>"}flagOperator(t){return" "}flagName(t){const{flag:u,flagFormatted:n,aliasesEnabled:D,aliasFormatted:o}=t;let r="";if(o?r+=`${o}, `:D&&(r+=" "),r+=n,"placeholder"in u&&typeof u.placeholder=="string")r+=`${this.flagOperator(t)}${u.placeholder}`;else{const i=this.flagParameter("type"in u?u.type:u);i&&(r+=`${this.flagOperator(t)}${i}`)}return r}flagDefault(t){return JSON.stringify(t)}flagDescription({flag:t}){let u="description"in t?t.description??"":"";if("default"in t){let{default:n}=t;typeof n=="function"&&(n=n()),n&&(u+=` (default: ${this.flagDefault(n)})`)}return u}render(t){if(typeof t=="string")return t;if(Array.isArray(t))return t.map(u=>this.render(u)).join(`
21
+ `);if("type"in t&&this[t.type]){const u=this[t.type];if(typeof u=="function")return u.call(this,t.data)}throw new Error(`Invalid node type: ${JSON.stringify(t)}`)}}const dt=e=>e.length>0&&!e.includes(" "),{stringify:K}=JSON,Bo=/[|\\{}()[\]^$+*?.]/;function Ft(e){const t=[];let u,n;for(const D of e){if(n)throw new Error(`Invalid parameter: Spread parameter ${K(n)} must be last`);const o=D[0],r=D[D.length-1];let i;if(o==="<"&&r===">"&&(i=!0,u))throw new Error(`Invalid parameter: Required parameter ${K(D)} cannot come after optional parameter ${K(u)}`);if(o==="["&&r==="]"&&(i=!1,u=D),i===void 0)throw new Error(`Invalid parameter: ${K(D)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let s=D.slice(1,-1);const c=s.slice(-3)==="...";c&&(n=D,s=s.slice(0,-3));const f=s.match(Bo);if(f)throw new Error(`Invalid parameter: ${K(D)}. Invalid character found ${K(f[0])}`);t.push({name:s,required:i,spread:c})}return t}function pt(e,t,u,n){for(let D=0;D<t.length;D+=1){const{name:o,required:r,spread:i}=t[D],s=ao(o);if(s in e)throw new Error(`Invalid parameter: ${K(o)} is used more than once.`);const c=i?u.slice(D):u[D];if(i&&(D=t.length),r&&(!c||i&&c.length===0))return console.error(`Error: Missing required parameter ${K(o)}
22
+ `),n(),process.exit(1);e[s]=c}}function vo(e){return e===void 0||e!==!1}function zu(e,t,u,n){const D={...t.flags},o=t.version;o&&(D.version={type:Boolean,description:"Show version"});const{help:r}=t,i=vo(r);i&&!("help"in D)&&(D.help={type:Boolean,alias:"h",description:"Show help"});const s=AD(D,n,{ignore:t.ignoreArgv}),c=()=>{console.log(t.version)};if(o&&s.flags.version===!0)return c(),process.exit(0);const f=new wo,l=i&&r?.render?r.render:F=>f.render(F),a=F=>{const h=yo({...t,...F?{help:F}:{},flags:D});console.log(l(h,f))};if(i&&s.flags.help===!0)return a(),process.exit(0);if(t.parameters){let{parameters:F}=t,h=s._;const p=F.indexOf("--"),C=F.slice(p+1),b=Object.create(null);if(p>-1&&C.length>0){F=F.slice(0,p);const v=s._["--"];h=h.slice(0,-v.length||void 0),pt(b,Ft(F),h,a),pt(b,Ft(C),v,a)}else pt(b,Ft(F),h,a);Object.assign(s._,b)}const d={...s,showVersion:c,showHelp:a};return typeof u=="function"&&u(d),{command:e,...d}}function Ao(e,t){const u=new Map;for(const n of t){const D=[n.options.name],{alias:o}=n.options;o&&(Array.isArray(o)?D.push(...o):D.push(o));for(const r of D){if(u.has(r))throw new Error(`Duplicate command name found: ${K(r)}`);u.set(r,n)}}return u.get(e)}function $o(e,t,u=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!dt(e.name)))throw new Error(`Invalid script name: ${K(e.name)}`);const n=u[0];if(e.commands&&n&&dt(n)){const D=Ao(n,e.commands);if(D)return zu(D.options.name,{...D.options,parent:e},D.callback,u.slice(1))}return zu(void 0,e,t,u)}function Uu(e,t){if(!e)throw new Error("Command options are required");const{name:u}=e;if(u===void 0)throw new Error("Command name is required");if(!dt(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:e,callback:t}}var xo="1.18.0",So="Writes your git commit messages for you with AI",ko="sugarmo/aicommits",_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ie={exports:{}},Ct,qu;function Mo(){if(qu)return Ct;qu=1,Ct=n,n.sync=D;var e=ot;function t(o,r){var i=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!i||(i=i.split(";"),i.indexOf("")!==-1))return!0;for(var s=0;s<i.length;s++){var c=i[s].toLowerCase();if(c&&o.substr(-c.length).toLowerCase()===c)return!0}return!1}function u(o,r,i){return!o.isSymbolicLink()&&!o.isFile()?!1:t(r,i)}function n(o,r,i){e.stat(o,function(s,c){i(s,s?!1:u(c,o,r))})}function D(o,r){return u(e.statSync(o),o,r)}return Ct}var mt,Hu;function Io(){if(Hu)return mt;Hu=1,mt=t,t.sync=u;var e=ot;function t(o,r,i){e.stat(o,function(s,c){i(s,s?!1:n(c,r))})}function u(o,r){return n(e.statSync(o),r)}function n(o,r){return o.isFile()&&D(o,r)}function D(o,r){var i=o.mode,s=o.uid,c=o.gid,f=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),l=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),a=parseInt("100",8),d=parseInt("010",8),F=parseInt("001",8),h=a|d,p=i&F||i&d&&c===l||i&a&&s===f||i&h&&f===0;return p}return mt}var je;process.platform==="win32"||_.TESTING_WINDOWS?je=Mo():je=Io();var Oo=ht;ht.sync=To;function ht(e,t,u){if(typeof t=="function"&&(u=t,t={}),!u){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,D){ht(e,t||{},function(o,r){o?D(o):n(r)})})}je(e,t||{},function(n,D){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,D=!1),u(n,D)})}function To(e,t){try{return je.sync(e,t||{})}catch(u){if(t&&t.ignoreErrors||u.code==="EACCES")return!1;throw u}}const ae=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Vu=N,Po=ae?";":":",Ku=Oo,Ju=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Yu=(e,t)=>{const u=t.colon||Po,n=e.match(/\//)||ae&&e.match(/\\/)?[""]:[...ae?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(u)],D=ae?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=ae?D.split(u):[""];return ae&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:D}},Zu=(e,t,u)=>{typeof t=="function"&&(u=t,t={}),t||(t={});const{pathEnv:n,pathExt:D,pathExtExe:o}=Yu(e,t),r=[],i=c=>new Promise((f,l)=>{if(c===n.length)return t.all&&r.length?f(r):l(Ju(e));const a=n[c],d=/^".*"$/.test(a)?a.slice(1,-1):a,F=Vu.join(d,e),h=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+F:F;f(s(h,c,0))}),s=(c,f,l)=>new Promise((a,d)=>{if(l===D.length)return a(i(f+1));const F=D[l];Ku(c+F,{pathExt:o},(h,p)=>{if(!h&&p)if(t.all)r.push(c+F);else return a(c+F);return a(s(c,f,l+1))})});return u?i(0).then(c=>u(null,c),u):i(0)},Ro=(e,t)=>{t=t||{};const{pathEnv:u,pathExt:n,pathExtExe:D}=Yu(e,t),o=[];for(let r=0;r<u.length;r++){const i=u[r],s=/^".*"$/.test(i)?i.slice(1,-1):i,c=Vu.join(s,e),f=!s&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let l=0;l<n.length;l++){const a=f+n[l];try{if(Ku.sync(a,{pathExt:D}))if(t.all)o.push(a);else return a}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw Ju(e)};var _o=Zu;Zu.sync=Ro;var gt={exports:{}};const Xu=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};gt.exports=Xu,gt.exports.default=Xu;var jo=gt.exports;const Qu=N,No=_o,Lo=jo;function en(e,t){const u=e.options.env||process.env,n=process.cwd(),D=e.options.cwd!=null,o=D&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let r;try{r=No.sync(e.command,{path:u[Lo({env:u})],pathExt:t?Qu.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return r&&(r=Qu.resolve(D?e.options.cwd:"",r)),r}function Go(e){return en(e)||en(e,!0)}var Wo=Go,Et={};const yt=/([()\][%!^"`<>&|;, *?])/g;function zo(e){return e=e.replace(yt,"^$1"),e}function Uo(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(yt,"^$1"),t&&(e=e.replace(yt,"^$1")),e}Et.command=zo,Et.argument=Uo;var qo=/^#!(.*)/;const Ho=qo;var Vo=(e="")=>{const t=e.match(Ho);if(!t)return null;const[u,n]=t[0].replace(/#! ?/,"").split(" "),D=u.split("/").pop();return D==="env"?n:n?`${D} ${n}`:D};const bt=ot,Ko=Vo;function Jo(e){const u=Buffer.alloc(150);let n;try{n=bt.openSync(e,"r"),bt.readSync(n,u,0,150,0),bt.closeSync(n)}catch{}return Ko(u.toString())}var Yo=Jo;const Zo=N,tn=Wo,un=Et,Xo=Yo,Qo=process.platform==="win32",es=/\.(?:com|exe)$/i,ts=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function us(e){e.file=tn(e);const t=e.file&&Xo(e.file);return t?(e.args.unshift(e.file),e.command=t,tn(e)):e.file}function ns(e){if(!Qo)return e;const t=us(e),u=!es.test(t);if(e.options.forceShell||u){const n=ts.test(t);e.command=Zo.normalize(e.command),e.command=un.command(e.command),e.args=e.args.map(o=>un.argument(o,n));const D=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${D}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function rs(e,t,u){t&&!Array.isArray(t)&&(u=t,t=null),t=t?t.slice(0):[],u=Object.assign({},u);const n={command:e,args:t,options:u,file:void 0,original:{command:e,args:t}};return u.shell?n:ns(n)}var Ds=rs;const wt=process.platform==="win32";function Bt(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function os(e,t){if(!wt)return;const u=e.emit;e.emit=function(n,D){if(n==="exit"){const o=nn(D,t);if(o)return u.call(e,"error",o)}return u.apply(e,arguments)}}function nn(e,t){return wt&&e===1&&!t.file?Bt(t.original,"spawn"):null}function ss(e,t){return wt&&e===1&&!t.file?Bt(t.original,"spawnSync"):null}var is={hookChildProcess:os,verifyENOENT:nn,verifyENOENTSync:ss,notFoundError:Bt};const rn=Yr,vt=Ds,At=is;function Dn(e,t,u){const n=vt(e,t,u),D=rn.spawn(n.command,n.args,n.options);return At.hookChildProcess(D,n),D}function as(e,t,u){const n=vt(e,t,u),D=rn.spawnSync(n.command,n.args,n.options);return D.error=D.error||At.verifyENOENTSync(D.status,n),D}ie.exports=Dn,ie.exports.spawn=Dn,ie.exports.sync=as,ie.exports._parse=vt,ie.exports._enoent=At;var cs=ie.exports,ls=se(cs);function fs(e){const t=typeof e=="string"?`
23
23
  `:`
24
- `.charCodeAt(),u=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===u&&(e=e.slice(0,-1)),e}function tn(e={}){const{env:t=process.env,platform:u=process.platform}=e;return u!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}const us=({cwd:e=M.cwd(),path:t=M.env[tn()],preferLocal:u=!0,execPath:n=M.execPath,addExecPath:r=!0}={})=>{const o=e instanceof URL?fu(e):e,D=ne.resolve(o),i=[];return u&&ns(i,D),r&&Ds(i,n,D),[...i,t].join(ne.delimiter)},ns=(e,t)=>{let u;for(;u!==t;)e.push(ne.join(t,"node_modules/.bin")),u=t,t=ne.resolve(t,"..")},Ds=(e,t,u)=>{const n=t instanceof URL?fu(t):t;e.push(ne.resolve(u,n,".."))},rs=({env:e=M.env,...t}={})=>{e={...e};const u=tn({env:e});return t.path=e[u],e[u]=us(t),e},os=(e,t,u,n)=>{if(u==="length"||u==="prototype"||u==="arguments"||u==="caller")return;const r=Object.getOwnPropertyDescriptor(e,u),o=Object.getOwnPropertyDescriptor(t,u);!ss(r,o)&&n||Object.defineProperty(e,u,o)},ss=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},is=(e,t)=>{const u=Object.getPrototypeOf(t);u!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,u)},as=(e,t)=>`/* Wrapped ${e}*/
25
- ${t}`,cs=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ls=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),fs=(e,t,u)=>{const n=u===""?"":`with ${u.trim()}() `,r=as.bind(null,n,t.toString());Object.defineProperty(r,"name",ls),Object.defineProperty(e,"toString",{...cs,value:r})};function ds(e,t,{ignoreNonConfigurable:u=!1}={}){const{name:n}=e;for(const r of Reflect.ownKeys(t))os(e,t,r,u);return is(e,t),fs(e,t,n),e}const Re=new WeakMap,un=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let u,n=0;const r=e.displayName||e.name||"<anonymous>",o=function(...D){if(Re.set(o,++n),n===1)u=e.apply(this,D),e=null;else if(t.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return u};return ds(o,e),Re.set(o,n),o};un.callCount=e=>{if(!Re.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Re.get(e)};const Fs=()=>{const e=Dn-nn+1;return Array.from({length:e},ps)},ps=(e,t)=>({name:`SIGRT${t+1}`,number:nn+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),nn=34,Dn=64,Cs=[{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"}],rn=()=>{const e=Fs();return[...Cs,...e].map(ms)},ms=({name:e,number:t,description:u,action:n,forced:r=!1,standard:o})=>{const{signals:{[e]:D}}=du,i=D!==void 0;return{name:e,number:i?D:t,description:u,supported:i,action:n,forced:r,standard:o}},hs=()=>{const e=rn();return Object.fromEntries(e.map(gs))},gs=({name:e,number:t,description:u,supported:n,action:r,forced:o,standard:D})=>[e,{name:e,number:t,description:u,supported:n,action:r,forced:o,standard:D}],Es=hs(),ys=()=>{const e=rn(),t=Dn+1,u=Array.from({length:t},(n,r)=>Bs(r,e));return Object.assign({},...u)},Bs=(e,t)=>{const u=bs(e,t);if(u===void 0)return{};const{name:n,description:r,supported:o,action:D,forced:i,standard:s}=u;return{[e]:{name:n,number:e,description:r,supported:o,action:D,forced:i,standard:s}}},bs=(e,t)=>{const u=t.find(({name:n})=>du.signals[n]===e);return u!==void 0?u:t.find(n=>n.number===e)};ys();const ws=({timedOut:e,timeout:t,errorCode:u,signal:n,signalDescription:r,exitCode:o,isCanceled:D})=>e?`timed out after ${t} milliseconds`:D?"was canceled":u!==void 0?`failed with ${u}`:n!==void 0?`was killed with ${n} (${r})`:o!==void 0?`failed with exit code ${o}`:"failed",on=({stdout:e,stderr:t,all:u,error:n,signal:r,exitCode:o,command:D,escapedCommand:i,timedOut:s,isCanceled:c,killed:f,parsed:{options:{timeout:l,cwd:a=M.cwd()}}})=>{o=o===null?void 0:o,r=r===null?void 0:r;const d=r===void 0?void 0:Es[r].description,F=n&&n.code,C=`Command ${ws({timedOut:s,timeout:l,errorCode:F,signal:r,signalDescription:d,exitCode:o,isCanceled:c})}: ${D}`,h=Object.prototype.toString.call(n)==="[object Error]",y=h?`${C}
26
- ${n.message}`:C,A=[y,t,e].filter(Boolean).join(`
27
- `);return h?(n.originalMessage=n.message,n.message=A):n=new Error(A),n.shortMessage=y,n.command=D,n.escapedCommand=i,n.exitCode=o,n.signal=r,n.signalDescription=d,n.stdout=e,n.stderr=t,n.cwd=a,u!==void 0&&(n.all=u),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!s,n.isCanceled=c,n.killed=f&&!s,n},_e=["stdin","stdout","stderr"],As=e=>_e.some(t=>e[t]!==void 0),vs=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return _e.map(n=>e[n]);if(As(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${_e.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const u=Math.max(t.length,_e.length);return Array.from({length:u},(n,r)=>t[r])};var se={exports:{}},je={exports:{}};je.exports;var sn;function $s(){return sn||(sn=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")}(je)),je.exports}var S=T.process;const ee=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(!ee(S))se.exports=function(){return function(){}};else{var xs=Fu,pe=$s(),Ss=/^win/i.test(S.platform),Ne=pu;typeof Ne!="function"&&(Ne=Ne.EventEmitter);var R;S.__signal_exit_emitter__?R=S.__signal_exit_emitter__:(R=S.__signal_exit_emitter__=new Ne,R.count=0,R.emitted={}),R.infinite||(R.setMaxListeners(1/0),R.infinite=!0),se.exports=function(e,t){if(!ee(T.process))return function(){};xs.equal(typeof e,"function","a callback must be provided for exit handler"),Ce===!1&&an();var u="exit";t&&t.alwaysLast&&(u="afterexit");var n=function(){R.removeListener(u,e),R.listeners("exit").length===0&&R.listeners("afterexit").length===0&&yt()};return R.on(u,e),n};var yt=function(){!Ce||!ee(T.process)||(Ce=!1,pe.forEach(function(t){try{S.removeListener(t,Bt[t])}catch{}}),S.emit=bt,S.reallyExit=cn,R.count-=1)};se.exports.unload=yt;var ie=function(t,u,n){R.emitted[t]||(R.emitted[t]=!0,R.emit(t,u,n))},Bt={};pe.forEach(function(e){Bt[e]=function(){if(ee(T.process)){var u=S.listeners(e);u.length===R.count&&(yt(),ie("exit",null,e),ie("afterexit",null,e),Ss&&e==="SIGHUP"&&(e="SIGINT"),S.kill(S.pid,e))}}}),se.exports.signals=function(){return pe};var Ce=!1,an=function(){Ce||!ee(T.process)||(Ce=!0,R.count+=1,pe=pe.filter(function(t){try{return S.on(t,Bt[t]),!0}catch{return!1}}),S.emit=Is,S.reallyExit=Os)};se.exports.load=an;var cn=S.reallyExit,Os=function(t){ee(T.process)&&(S.exitCode=t||0,ie("exit",S.exitCode,null),ie("afterexit",S.exitCode,null),cn.call(S,S.exitCode))},bt=S.emit,Is=function(t,u){if(t==="exit"&&ee(T.process)){u!==void 0&&(S.exitCode=u);var n=bt.apply(this,arguments);return ie("exit",S.exitCode,null),ie("afterexit",S.exitCode,null),n}else return bt.apply(this,arguments)}}var Ms=se.exports,ks=De(Ms);const Ts=1e3*5,Ps=(e,t="SIGTERM",u={})=>{const n=e(t);return Rs(e,t,u,n),n},Rs=(e,t,u,n)=>{if(!_s(t,u,n))return;const r=Ns(u),o=setTimeout(()=>{e("SIGKILL")},r);o.unref&&o.unref()},_s=(e,{forceKillAfterTimeout:t},u)=>js(e)&&t!==!1&&u,js=e=>e===LD.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Ns=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Ts;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},Ls=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Gs=(e,t,u)=>{e.kill(t),u(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},zs=(e,{timeout:t,killSignal:u="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let r;const o=new Promise((i,s)=>{r=setTimeout(()=>{Gs(e,u,s)},t)}),D=n.finally(()=>{clearTimeout(r)});return Promise.race([o,D])},Ws=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Us=async(e,{cleanup:t,detached:u},n)=>{if(!t||u)return n;const r=ks(()=>{e.kill()});return n.finally(()=>{r()})};function ln(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function fn(e){return ln(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}const qs=e=>e instanceof RD&&typeof e.then=="function",wt=(e,t,u)=>{if(typeof u=="string")return e[t].pipe(GD(u)),e;if(fn(u))return e[t].pipe(u),e;if(!qs(u))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!fn(u.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(u.stdin),u},Hs=e=>{e.stdout!==null&&(e.pipeStdout=wt.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=wt.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=wt.bind(void 0,e,"all"))};var me={exports:{}};const{PassThrough:Ks}=tt;var Vs=e=>{e={...e};const{array:t}=e;let{encoding:u}=e;const n=u==="buffer";let r=!1;t?r=!(u||n):u=u||"utf8",n&&(u=null);const o=new Ks({objectMode:r});u&&o.setEncoding(u);let D=0;const i=[];return o.on("data",s=>{i.push(s),r?D=i.length:D+=s.length}),o.getBufferedValue=()=>t?i:n?Buffer.concat(i,D):i.join(""),o.getBufferedLength=()=>D,o};const{constants:Js}=WD,Ys=tt,{promisify:Zs}=Cu,Xs=Vs,Qs=Zs(Ys.pipeline);class dn extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function At(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:u}=t,n=Xs(t);return await new Promise((r,o)=>{const D=i=>{i&&n.getBufferedLength()<=Js.MAX_LENGTH&&(i.bufferedData=n.getBufferedValue()),o(i)};(async()=>{try{await Qs(e,n),r()}catch(i){D(i)}})(),n.on("data",()=>{n.getBufferedLength()>u&&D(new dn)})}),n.getBufferedValue()}me.exports=At,me.exports.buffer=(e,t)=>At(e,{...t,encoding:"buffer"}),me.exports.array=(e,t)=>At(e,{...t,array:!0}),me.exports.MaxBufferError=dn;var ei=me.exports,Fn=De(ei);const{PassThrough:ti}=tt;var ui=function(){var e=[],t=new ti({objectMode:!0});return t.setMaxListeners(0),t.add=u,t.isEmpty=n,t.on("unpipe",r),Array.prototype.slice.call(arguments).forEach(u),t;function u(o){return Array.isArray(o)?(o.forEach(u),this):(e.push(o),o.once("end",r.bind(null,o)),o.once("error",t.emit.bind(t,"error")),o.pipe(t,{end:!1}),this)}function n(){return e.length==0}function r(o){e=e.filter(function(D){return D!==o}),!e.length&&t.readable&&t.end()}},ni=De(ui);const Di=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},ri=({input:e,inputFile:t})=>typeof t!="string"?e:(Di(e),zD(t)),oi=(e,t)=>{const u=ri(t);u!==void 0&&(ln(u)?u.pipe(e.stdin):e.stdin.end(u))},si=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const u=ni();return e.stdout&&u.add(e.stdout),e.stderr&&u.add(e.stderr),u},vt=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(u){return u.bufferedData}}},$t=(e,{encoding:t,buffer:u,maxBuffer:n})=>{if(!(!e||!u))return t?Fn(e,{encoding:t,maxBuffer:n}):Fn.buffer(e,{maxBuffer:n})},ii=async({stdout:e,stderr:t,all:u},{encoding:n,buffer:r,maxBuffer:o},D)=>{const i=$t(e,{encoding:n,buffer:r,maxBuffer:o}),s=$t(t,{encoding:n,buffer:r,maxBuffer:o}),c=$t(u,{encoding:n,buffer:r,maxBuffer:o*2});try{return await Promise.all([D,i,s,c])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},vt(e,i),vt(t,s),vt(u,c)])}},ai=(async()=>{})().constructor.prototype,ci=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(ai,e)]),pn=(e,t)=>{for(const[u,n]of ci){const r=typeof t=="function"?(...o)=>Reflect.apply(n.value,t(),o):n.value.bind(t);Reflect.defineProperty(e,u,{...n,value:r})}},li=e=>new Promise((t,u)=>{e.on("exit",(n,r)=>{t({exitCode:n,signal:r})}),e.on("error",n=>{u(n)}),e.stdin&&e.stdin.on("error",n=>{u(n)})}),Cn=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],fi=/^[\w.-]+$/,di=/"/g,Fi=e=>typeof e!="string"||fi.test(e)?e:`"${e.replace(di,'\\"')}"`,pi=(e,t)=>Cn(e,t).join(" "),Ci=(e,t)=>Cn(e,t).map(u=>Fi(u)).join(" "),mi=UD("execa").enabled,Le=(e,t)=>String(e).padStart(t,"0"),hi=()=>{const e=new Date;return`${Le(e.getHours(),2)}:${Le(e.getMinutes(),2)}:${Le(e.getSeconds(),2)}.${Le(e.getMilliseconds(),3)}`},gi=(e,{verbose:t})=>{t&&M.stderr.write(`[${hi()}] ${e}
28
- `)},Ei=1e3*1e3*100,yi=({env:e,extendEnv:t,preferLocal:u,localDir:n,execPath:r})=>{const o=t?{...M.env,...e}:e;return u?rs({env:o,cwd:n,execPath:r}):o},Bi=(e,t,u={})=>{const n=es._parse(e,t,u);return e=n.command,t=n.args,u=n.options,u={maxBuffer:Ei,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:u.cwd||M.cwd(),execPath:M.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:mi,...u},u.env=yi(u),u.stdio=vs(u),M.platform==="win32"&&ne.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:u,parsed:n}},xt=(e,t,u)=>typeof t!="string"&&!PD.isBuffer(t)?u===void 0?void 0:"":e.stripFinalNewline?ts(t):t;function U(e,t,u){const n=Bi(e,t,u),r=pi(e,t),o=Ci(e,t);gi(o,n.options),Ws(n.options);let D;try{D=lu.spawn(n.file,n.args,n.options)}catch(d){const F=new lu.ChildProcess,p=Promise.reject(on({error:d,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return pn(F,p),F}const i=li(D),s=zs(D,n.options,i),c=Us(D,n.options,s),f={isCanceled:!1};D.kill=Ps.bind(null,D.kill.bind(D)),D.cancel=Ls.bind(null,D,f);const a=un(async()=>{const[{error:d,exitCode:F,signal:p,timedOut:C},h,y,A]=await ii(D,n.options,c),_=xt(n.options,h),j=xt(n.options,y),E=xt(n.options,A);if(d||F!==0||p!==null){const v=on({error:d,exitCode:F,signal:p,stdout:_,stderr:j,all:E,command:r,escapedCommand:o,parsed:n,timedOut:C,isCanceled:f.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:D.killed});if(!n.options.reject)return v;throw v}return{command:r,escapedCommand:o,exitCode:0,stdout:_,stderr:j,all:E,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return oi(D,n.options),D.all=si(D,n.options),Hs(D),pn(D,a),D}let te=!0;const ae=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let he=0;if(ae.process&&ae.process.env&&ae.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:u,TERM:n,COLORTERM:r}=ae.process.env;t||u||e==="0"?te=!1:e==="1"||e==="2"||e==="3"?te=!0:n==="dumb"?te=!1:"CI"in ae.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in ae.process.env)?te=!0:te=process.stdout.isTTY,te&&(process.platform==="win32"||r&&(r==="truecolor"||r==="24bit")?he=3:n&&(n.endsWith("-256color")||n.endsWith("256"))?he=2:he=1)}let mn={enabled:te,supportLevel:he};function ue(e,t,u=1){const n=`\x1B[${e}m`,r=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return D=>mn.enabled&&mn.supportLevel>=u?n+(""+D).replace(o,n)+r:""+D}const ge=ue(2,22),bi=ue(30,39),St=ue(31,39),Ge=ue(32,39),wi=ue(35,39),Ai=ue(90,39),vi=ue(46,49),Ot="\x1B",I=`${Ot}[`,$i="\x07",It={to(e,t){return t?`${I}${t+1};${e+1}H`:`${I}${e+1}G`},move(e,t){let u="";return e<0?u+=`${I}${-e}D`:e>0&&(u+=`${I}${e}C`),t<0?u+=`${I}${-t}A`:t>0&&(u+=`${I}${t}B`),u},up:(e=1)=>`${I}${e}A`,down:(e=1)=>`${I}${e}B`,forward:(e=1)=>`${I}${e}C`,backward:(e=1)=>`${I}${e}D`,nextLine:(e=1)=>`${I}E`.repeat(e),prevLine:(e=1)=>`${I}F`.repeat(e),left:`${I}G`,hide:`${I}?25l`,show:`${I}?25h`,save:`${Ot}7`,restore:`${Ot}8`},xi={up:(e=1)=>`${I}S`.repeat(e),down:(e=1)=>`${I}T`.repeat(e)},Si={screen:`${I}2J`,up:(e=1)=>`${I}1J`.repeat(e),down:(e=1)=>`${I}J`.repeat(e),line:`${I}2K`,lineEnd:`${I}K`,lineStart:`${I}1K`,lines(e){let t="";for(let u=0;u<e;u++)t+=this.line+(u<e-1?It.up():"");return e&&(t+=It.left),t}};var q={cursor:It,scroll:xi,erase:Si,beep:$i},Mt={exports:{}};let ze=process||{},hn=ze.argv||[],We=ze.env||{},Oi=!(We.NO_COLOR||hn.includes("--no-color"))&&(!!We.FORCE_COLOR||hn.includes("--color")||ze.platform==="win32"||(ze.stdout||{}).isTTY&&We.TERM!=="dumb"||!!We.CI),Ii=(e,t,u=e)=>n=>{let r=""+n,o=r.indexOf(t,e.length);return~o?e+Mi(r,t,u,o)+t:e+r+t},Mi=(e,t,u,n)=>{let r="",o=0;do r+=e.substring(o,n)+u,o=n+t.length,n=e.indexOf(t,o);while(~n);return r+e.substring(o)},gn=(e=Oi)=>{let t=e?Ii:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Mt.exports=gn(),Mt.exports.createColors=gn;var ki=Mt.exports,b=De(ki);function Ti({onlyFirst:e=!1}={}){const t=["[\\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(t,e?void 0:"g")}const Pi=Ti();function En(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Pi,"")}function yn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bn={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(n){var r=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,D=r;return 55296<=r&&r<=56319&&56320<=o&&o<=57343&&(r&=1023,o&=1023,D=r<<10|o,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},t.characterLength=function(n){var r=this.eastAsianWidth(n);return r=="F"||r=="W"||r=="A"?2:1};function u(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(n){for(var r=u(n),o=0,D=0;D<r.length;D++)o=o+this.characterLength(r[D]);return o},t.slice=function(n,r,o){textLen=t.length(n),r=r||0,o=o||1,r<0&&(r=textLen+r),o<0&&(o=textLen+o);for(var D="",i=0,s=u(n),c=0;c<s.length;c++){var f=s[c],l=t.length(f);if(i>=r-(l==2?1:0))if(i+l<=o)D+=f;else break;i+=l}return D}})(Bn);var Ri=Bn.exports;const _i=yn(Ri);var ji=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 Ni=yn(ji);function Ee(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=En(e),e.length===0))return 0;e=e.replace(Ni()," ");const u=t.ambiguousIsNarrow?1:2;let n=0;for(const r of e){const o=r.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(_i.eastAsianWidth(r)){case"F":case"W":n+=2;break;case"A":n+=u;break;default:n+=1}}return n}const kt=10,bn=(e=0)=>t=>`\x1B[${t+e}m`,wn=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,An=(e=0)=>(t,u,n)=>`\x1B[${38+e};2;${t};${u};${n}m`,O={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(O.modifier);const Li=Object.keys(O.color),Gi=Object.keys(O.bgColor);[...Li,...Gi];function zi(){const e=new Map;for(const[t,u]of Object.entries(O)){for(const[n,r]of Object.entries(u))O[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},u[n]=O[n],e.set(r[0],r[1]);Object.defineProperty(O,t,{value:u,enumerable:!1})}return Object.defineProperty(O,"codes",{value:e,enumerable:!1}),O.color.close="\x1B[39m",O.bgColor.close="\x1B[49m",O.color.ansi=bn(),O.color.ansi256=wn(),O.color.ansi16m=An(),O.bgColor.ansi=bn(kt),O.bgColor.ansi256=wn(kt),O.bgColor.ansi16m=An(kt),Object.defineProperties(O,{rgbToAnsi256:{value:(t,u,n)=>t===u&&u===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(u/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:t=>{const u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!u)return[0,0,0];let[n]=u;n.length===3&&(n=[...n].map(o=>o+o).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:t=>O.rgbToAnsi256(...O.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let u,n,r;if(t>=232)u=((t-232)*10+8)/255,n=u,r=u;else{t-=16;const i=t%36;u=Math.floor(t/36)/5,n=Math.floor(i/6)/5,r=i%6/5}const o=Math.max(u,n,r)*2;if(o===0)return 30;let D=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(u));return o===2&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(t,u,n)=>O.ansi256ToAnsi(O.rgbToAnsi256(t,u,n)),enumerable:!1},hexToAnsi:{value:t=>O.ansi256ToAnsi(O.hexToAnsi256(t)),enumerable:!1}}),O}const Wi=zi(),Ue=new Set(["\x1B","\x9B"]),Ui=39,Tt="\x07",vn="[",qi="]",$n="m",Pt=`${qi}8;;`,xn=e=>`${Ue.values().next().value}${vn}${e}${$n}`,Sn=e=>`${Ue.values().next().value}${Pt}${e}${Tt}`,Hi=e=>e.split(" ").map(t=>Ee(t)),Rt=(e,t,u)=>{const n=[...t];let r=!1,o=!1,D=Ee(En(e[e.length-1]));for(const[i,s]of n.entries()){const c=Ee(s);if(D+c<=u?e[e.length-1]+=s:(e.push(s),D=0),Ue.has(s)&&(r=!0,o=n.slice(i+1).join("").startsWith(Pt)),r){o?s===Tt&&(r=!1,o=!1):s===$n&&(r=!1);continue}D+=c,D===u&&i<n.length-1&&(e.push(""),D=0)}!D&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Ki=e=>{const t=e.split(" ");let u=t.length;for(;u>0&&!(Ee(t[u-1])>0);)u--;return u===t.length?e:t.slice(0,u).join(" ")+t.slice(u).join("")},Vi=(e,t,u={})=>{if(u.trim!==!1&&e.trim()==="")return"";let n="",r,o;const D=Hi(e);let i=[""];for(const[c,f]of e.split(" ").entries()){u.trim!==!1&&(i[i.length-1]=i[i.length-1].trimStart());let l=Ee(i[i.length-1]);if(c!==0&&(l>=t&&(u.wordWrap===!1||u.trim===!1)&&(i.push(""),l=0),(l>0||u.trim===!1)&&(i[i.length-1]+=" ",l++)),u.hard&&D[c]>t){const a=t-l,d=1+Math.floor((D[c]-a-1)/t);Math.floor((D[c]-1)/t)<d&&i.push(""),Rt(i,f,t);continue}if(l+D[c]>t&&l>0&&D[c]>0){if(u.wordWrap===!1&&l<t){Rt(i,f,t);continue}i.push("")}if(l+D[c]>t&&u.wordWrap===!1){Rt(i,f,t);continue}i[i.length-1]+=f}u.trim!==!1&&(i=i.map(c=>Ki(c)));const s=[...i.join(`
29
- `)];for(const[c,f]of s.entries()){if(n+=f,Ue.has(f)){const{groups:a}=new RegExp(`(?:\\${vn}(?<code>\\d+)m|\\${Pt}(?<uri>.*)${Tt})`).exec(s.slice(c).join(""))||{groups:{}};if(a.code!==void 0){const d=Number.parseFloat(a.code);r=d===Ui?void 0:d}else a.uri!==void 0&&(o=a.uri.length===0?void 0:a.uri)}const l=Wi.codes.get(Number(r));s[c+1]===`
30
- `?(o&&(n+=Sn("")),r&&l&&(n+=xn(l))):f===`
31
- `&&(r&&l&&(n+=xn(r)),o&&(n+=Sn(o)))}return n};function On(e,t,u){return String(e).normalize().replace(/\r\n/g,`
24
+ `.charCodeAt(),u=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===u&&(e=e.slice(0,-1)),e}function on(e={}){const{env:t=process.env,platform:u=process.platform}=e;return u!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}const ds=({cwd:e=T.cwd(),path:t=T.env[on()],preferLocal:u=!0,execPath:n=T.execPath,addExecPath:D=!0}={})=>{const o=e instanceof URL?mu(e):e,r=oe.resolve(o),i=[];return u&&Fs(i,r),D&&ps(i,n,r),[...i,t].join(oe.delimiter)},Fs=(e,t)=>{let u;for(;u!==t;)e.push(oe.join(t,"node_modules/.bin")),u=t,t=oe.resolve(t,"..")},ps=(e,t,u)=>{const n=t instanceof URL?mu(t):t;e.push(oe.resolve(u,n,".."))},Cs=({env:e=T.env,...t}={})=>{e={...e};const u=on({env:e});return t.path=e[u],e[u]=ds(t),e},ms=(e,t,u,n)=>{if(u==="length"||u==="prototype"||u==="arguments"||u==="caller")return;const D=Object.getOwnPropertyDescriptor(e,u),o=Object.getOwnPropertyDescriptor(t,u);!hs(D,o)&&n||Object.defineProperty(e,u,o)},hs=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},gs=(e,t)=>{const u=Object.getPrototypeOf(t);u!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,u)},Es=(e,t)=>`/* Wrapped ${e}*/
25
+ ${t}`,ys=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),bs=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ws=(e,t,u)=>{const n=u===""?"":`with ${u.trim()}() `,D=Es.bind(null,n,t.toString());Object.defineProperty(D,"name",bs),Object.defineProperty(e,"toString",{...ys,value:D})};function Bs(e,t,{ignoreNonConfigurable:u=!1}={}){const{name:n}=e;for(const D of Reflect.ownKeys(t))ms(e,t,D,u);return gs(e,t),ws(e,t,n),e}const Ne=new WeakMap,sn=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let u,n=0;const D=e.displayName||e.name||"<anonymous>",o=function(...r){if(Ne.set(o,++n),n===1)u=e.apply(this,r),e=null;else if(t.throw===!0)throw new Error(`Function \`${D}\` can only be called once`);return u};return Bs(o,e),Ne.set(o,n),o};sn.callCount=e=>{if(!Ne.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Ne.get(e)};const vs=()=>{const e=cn-an+1;return Array.from({length:e},As)},As=(e,t)=>({name:`SIGRT${t+1}`,number:an+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),an=34,cn=64,$s=[{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"}],ln=()=>{const e=vs();return[...$s,...e].map(xs)},xs=({name:e,number:t,description:u,action:n,forced:D=!1,standard:o})=>{const{signals:{[e]:r}}=hu,i=r!==void 0;return{name:e,number:i?r:t,description:u,supported:i,action:n,forced:D,standard:o}},Ss=()=>{const e=ln();return Object.fromEntries(e.map(ks))},ks=({name:e,number:t,description:u,supported:n,action:D,forced:o,standard:r})=>[e,{name:e,number:t,description:u,supported:n,action:D,forced:o,standard:r}],Ms=Ss(),Is=()=>{const e=ln(),t=cn+1,u=Array.from({length:t},(n,D)=>Os(D,e));return Object.assign({},...u)},Os=(e,t)=>{const u=Ts(e,t);if(u===void 0)return{};const{name:n,description:D,supported:o,action:r,forced:i,standard:s}=u;return{[e]:{name:n,number:e,description:D,supported:o,action:r,forced:i,standard:s}}},Ts=(e,t)=>{const u=t.find(({name:n})=>hu.signals[n]===e);return u!==void 0?u:t.find(n=>n.number===e)};Is();const Ps=({timedOut:e,timeout:t,errorCode:u,signal:n,signalDescription:D,exitCode:o,isCanceled:r})=>e?`timed out after ${t} milliseconds`:r?"was canceled":u!==void 0?`failed with ${u}`:n!==void 0?`was killed with ${n} (${D})`:o!==void 0?`failed with exit code ${o}`:"failed",fn=({stdout:e,stderr:t,all:u,error:n,signal:D,exitCode:o,command:r,escapedCommand:i,timedOut:s,isCanceled:c,killed:f,parsed:{options:{timeout:l,cwd:a=T.cwd()}}})=>{o=o===null?void 0:o,D=D===null?void 0:D;const d=D===void 0?void 0:Ms[D].description,F=n&&n.code,p=`Command ${Ps({timedOut:s,timeout:l,errorCode:F,signal:D,signalDescription:d,exitCode:o,isCanceled:c})}: ${r}`,C=Object.prototype.toString.call(n)==="[object Error]",b=C?`${p}
26
+ ${n.message}`:p,v=[b,t,e].filter(Boolean).join(`
27
+ `);return C?(n.originalMessage=n.message,n.message=v):n=new Error(v),n.shortMessage=b,n.command=r,n.escapedCommand=i,n.exitCode=o,n.signal=D,n.signalDescription=d,n.stdout=e,n.stderr=t,n.cwd=a,u!==void 0&&(n.all=u),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!s,n.isCanceled=c,n.killed=f&&!s,n},Le=["stdin","stdout","stderr"],Rs=e=>Le.some(t=>e[t]!==void 0),_s=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return Le.map(n=>e[n]);if(Rs(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Le.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const u=Math.max(t.length,Le.length);return Array.from({length:u},(n,D)=>t[D])};var ce={exports:{}},Ge={exports:{}};Ge.exports;var dn;function js(){return dn||(dn=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")}(Ge)),Ge.exports}var x=_.process;const ne=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(!ne(x))ce.exports=function(){return function(){}};else{var Ns=gu,me=js(),Ls=/^win/i.test(x.platform),We=Eu;typeof We!="function"&&(We=We.EventEmitter);var j;x.__signal_exit_emitter__?j=x.__signal_exit_emitter__:(j=x.__signal_exit_emitter__=new We,j.count=0,j.emitted={}),j.infinite||(j.setMaxListeners(1/0),j.infinite=!0),ce.exports=function(e,t){if(!ne(_.process))return function(){};Ns.equal(typeof e,"function","a callback must be provided for exit handler"),he===!1&&Fn();var u="exit";t&&t.alwaysLast&&(u="afterexit");var n=function(){j.removeListener(u,e),j.listeners("exit").length===0&&j.listeners("afterexit").length===0&&$t()};return j.on(u,e),n};var $t=function(){!he||!ne(_.process)||(he=!1,me.forEach(function(t){try{x.removeListener(t,xt[t])}catch{}}),x.emit=St,x.reallyExit=pn,j.count-=1)};ce.exports.unload=$t;var le=function(t,u,n){j.emitted[t]||(j.emitted[t]=!0,j.emit(t,u,n))},xt={};me.forEach(function(e){xt[e]=function(){if(ne(_.process)){var u=x.listeners(e);u.length===j.count&&($t(),le("exit",null,e),le("afterexit",null,e),Ls&&e==="SIGHUP"&&(e="SIGINT"),x.kill(x.pid,e))}}}),ce.exports.signals=function(){return me};var he=!1,Fn=function(){he||!ne(_.process)||(he=!0,j.count+=1,me=me.filter(function(t){try{return x.on(t,xt[t]),!0}catch{return!1}}),x.emit=Ws,x.reallyExit=Gs)};ce.exports.load=Fn;var pn=x.reallyExit,Gs=function(t){ne(_.process)&&(x.exitCode=t||0,le("exit",x.exitCode,null),le("afterexit",x.exitCode,null),pn.call(x,x.exitCode))},St=x.emit,Ws=function(t,u){if(t==="exit"&&ne(_.process)){u!==void 0&&(x.exitCode=u);var n=St.apply(this,arguments);return le("exit",x.exitCode,null),le("afterexit",x.exitCode,null),n}else return St.apply(this,arguments)}}var zs=ce.exports,Us=se(zs);const qs=1e3*5,Hs=(e,t="SIGTERM",u={})=>{const n=e(t);return Vs(e,t,u,n),n},Vs=(e,t,u,n)=>{if(!Ks(t,u,n))return;const D=Ys(u),o=setTimeout(()=>{e("SIGKILL")},D);o.unref&&o.unref()},Ks=(e,{forceKillAfterTimeout:t},u)=>Js(e)&&t!==!1&&u,Js=e=>e===Zr.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Ys=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return qs;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},Zs=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Xs=(e,t,u)=>{e.kill(t),u(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Qs=(e,{timeout:t,killSignal:u="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let D;const o=new Promise((i,s)=>{D=setTimeout(()=>{Xs(e,u,s)},t)}),r=n.finally(()=>{clearTimeout(D)});return Promise.race([o,r])},ei=({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})`)},ti=async(e,{cleanup:t,detached:u},n)=>{if(!t||u)return n;const D=Us(()=>{e.kill()});return n.finally(()=>{D()})};function Cn(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function mn(e){return Cn(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}const ui=e=>e instanceof Vr&&typeof e.then=="function",kt=(e,t,u)=>{if(typeof u=="string")return e[t].pipe(Xr(u)),e;if(mn(u))return e[t].pipe(u),e;if(!ui(u))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!mn(u.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(u.stdin),u},ni=e=>{e.stdout!==null&&(e.pipeStdout=kt.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=kt.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=kt.bind(void 0,e,"all"))};var ge={exports:{}};const{PassThrough:ri}=st;var Di=e=>{e={...e};const{array:t}=e;let{encoding:u}=e;const n=u==="buffer";let D=!1;t?D=!(u||n):u=u||"utf8",n&&(u=null);const o=new ri({objectMode:D});u&&o.setEncoding(u);let r=0;const i=[];return o.on("data",s=>{i.push(s),D?r=i.length:r+=s.length}),o.getBufferedValue=()=>t?i:n?Buffer.concat(i,r):i.join(""),o.getBufferedLength=()=>r,o};const{constants:oi}=eD,si=st,{promisify:ii}=yu,ai=Di,ci=ii(si.pipeline);class hn extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function Mt(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:u}=t,n=ai(t);return await new Promise((D,o)=>{const r=i=>{i&&n.getBufferedLength()<=oi.MAX_LENGTH&&(i.bufferedData=n.getBufferedValue()),o(i)};(async()=>{try{await ci(e,n),D()}catch(i){r(i)}})(),n.on("data",()=>{n.getBufferedLength()>u&&r(new hn)})}),n.getBufferedValue()}ge.exports=Mt,ge.exports.buffer=(e,t)=>Mt(e,{...t,encoding:"buffer"}),ge.exports.array=(e,t)=>Mt(e,{...t,array:!0}),ge.exports.MaxBufferError=hn;var li=ge.exports,gn=se(li);const{PassThrough:fi}=st;var di=function(){var e=[],t=new fi({objectMode:!0});return t.setMaxListeners(0),t.add=u,t.isEmpty=n,t.on("unpipe",D),Array.prototype.slice.call(arguments).forEach(u),t;function u(o){return Array.isArray(o)?(o.forEach(u),this):(e.push(o),o.once("end",D.bind(null,o)),o.once("error",t.emit.bind(t,"error")),o.pipe(t,{end:!1}),this)}function n(){return e.length==0}function D(o){e=e.filter(function(r){return r!==o}),!e.length&&t.readable&&t.end()}},Fi=se(di);const pi=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Ci=({input:e,inputFile:t})=>typeof t!="string"?e:(pi(e),Qr(t)),mi=(e,t)=>{const u=Ci(t);u!==void 0&&(Cn(u)?u.pipe(e.stdin):e.stdin.end(u))},hi=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const u=Fi();return e.stdout&&u.add(e.stdout),e.stderr&&u.add(e.stderr),u},It=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(u){return u.bufferedData}}},Ot=(e,{encoding:t,buffer:u,maxBuffer:n})=>{if(!(!e||!u))return t?gn(e,{encoding:t,maxBuffer:n}):gn.buffer(e,{maxBuffer:n})},gi=async({stdout:e,stderr:t,all:u},{encoding:n,buffer:D,maxBuffer:o},r)=>{const i=Ot(e,{encoding:n,buffer:D,maxBuffer:o}),s=Ot(t,{encoding:n,buffer:D,maxBuffer:o}),c=Ot(u,{encoding:n,buffer:D,maxBuffer:o*2});try{return await Promise.all([r,i,s,c])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},It(e,i),It(t,s),It(u,c)])}},Ei=(async()=>{})().constructor.prototype,yi=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Ei,e)]),En=(e,t)=>{for(const[u,n]of yi){const D=typeof t=="function"?(...o)=>Reflect.apply(n.value,t(),o):n.value.bind(t);Reflect.defineProperty(e,u,{...n,value:D})}},bi=e=>new Promise((t,u)=>{e.on("exit",(n,D)=>{t({exitCode:n,signal:D})}),e.on("error",n=>{u(n)}),e.stdin&&e.stdin.on("error",n=>{u(n)})}),yn=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],wi=/^[\w.-]+$/,Bi=/"/g,vi=e=>typeof e!="string"||wi.test(e)?e:`"${e.replace(Bi,'\\"')}"`,Ai=(e,t)=>yn(e,t).join(" "),$i=(e,t)=>yn(e,t).map(u=>vi(u)).join(" "),xi=tD("execa").enabled,ze=(e,t)=>String(e).padStart(t,"0"),Si=()=>{const e=new Date;return`${ze(e.getHours(),2)}:${ze(e.getMinutes(),2)}:${ze(e.getSeconds(),2)}.${ze(e.getMilliseconds(),3)}`},ki=(e,{verbose:t})=>{t&&T.stderr.write(`[${Si()}] ${e}
28
+ `)},Mi=1e3*1e3*100,Ii=({env:e,extendEnv:t,preferLocal:u,localDir:n,execPath:D})=>{const o=t?{...T.env,...e}:e;return u?Cs({env:o,cwd:n,execPath:D}):o},Oi=(e,t,u={})=>{const n=ls._parse(e,t,u);return e=n.command,t=n.args,u=n.options,u={maxBuffer:Mi,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:u.cwd||T.cwd(),execPath:T.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:xi,...u},u.env=Ii(u),u.stdio=_s(u),T.platform==="win32"&&oe.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:u,parsed:n}},Tt=(e,t,u)=>typeof t!="string"&&!Hr.isBuffer(t)?u===void 0?void 0:"":e.stripFinalNewline?fs(t):t;function U(e,t,u){const n=Oi(e,t,u),D=Ai(e,t),o=$i(e,t);ki(o,n.options),ei(n.options);let r;try{r=Cu.spawn(n.file,n.args,n.options)}catch(d){const F=new Cu.ChildProcess,h=Promise.reject(fn({error:d,stdout:"",stderr:"",all:"",command:D,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return En(F,h),F}const i=bi(r),s=Qs(r,n.options,i),c=ti(r,n.options,s),f={isCanceled:!1};r.kill=Hs.bind(null,r.kill.bind(r)),r.cancel=Zs.bind(null,r,f);const a=sn(async()=>{const[{error:d,exitCode:F,signal:h,timedOut:p},C,b,v]=await gi(r,n.options,c),M=Tt(n.options,C),O=Tt(n.options,b),g=Tt(n.options,v);if(d||F!==0||h!==null){const E=fn({error:d,exitCode:F,signal:h,stdout:M,stderr:O,all:g,command:D,escapedCommand:o,parsed:n,timedOut:p,isCanceled:f.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:r.killed});if(!n.options.reject)return E;throw E}return{command:D,escapedCommand:o,exitCode:0,stdout:M,stderr:O,all:g,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return mi(r,n.options),r.all=hi(r,n.options),ni(r),En(r,a),r}let re=!0;const fe=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Ee=0;if(fe.process&&fe.process.env&&fe.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:u,TERM:n,COLORTERM:D}=fe.process.env;t||u||e==="0"?re=!1:e==="1"||e==="2"||e==="3"?re=!0:n==="dumb"?re=!1:"CI"in fe.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in fe.process.env)?re=!0:re=process.stdout.isTTY,re&&(process.platform==="win32"||D&&(D==="truecolor"||D==="24bit")?Ee=3:n&&(n.endsWith("-256color")||n.endsWith("256"))?Ee=2:Ee=1)}let bn={enabled:re,supportLevel:Ee};function De(e,t,u=1){const n=`\x1B[${e}m`,D=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return r=>bn.enabled&&bn.supportLevel>=u?n+(""+r).replace(o,n)+D:""+r}const Ue=De(2,22),Ti=De(30,39),Pt=De(31,39),ye=De(32,39),Pi=De(35,39),Ri=De(90,39),_i=De(46,49),Rt="\x1B",k=`${Rt}[`,ji="\x07",_t={to(e,t){return t?`${k}${t+1};${e+1}H`:`${k}${e+1}G`},move(e,t){let u="";return e<0?u+=`${k}${-e}D`:e>0&&(u+=`${k}${e}C`),t<0?u+=`${k}${-t}A`:t>0&&(u+=`${k}${t}B`),u},up:(e=1)=>`${k}${e}A`,down:(e=1)=>`${k}${e}B`,forward:(e=1)=>`${k}${e}C`,backward:(e=1)=>`${k}${e}D`,nextLine:(e=1)=>`${k}E`.repeat(e),prevLine:(e=1)=>`${k}F`.repeat(e),left:`${k}G`,hide:`${k}?25l`,show:`${k}?25h`,save:`${Rt}7`,restore:`${Rt}8`},Ni={up:(e=1)=>`${k}S`.repeat(e),down:(e=1)=>`${k}T`.repeat(e)},Li={screen:`${k}2J`,up:(e=1)=>`${k}1J`.repeat(e),down:(e=1)=>`${k}J`.repeat(e),line:`${k}2K`,lineEnd:`${k}K`,lineStart:`${k}1K`,lines(e){let t="";for(let u=0;u<e;u++)t+=this.line+(u<e-1?_t.up():"");return e&&(t+=_t.left),t}};var J={cursor:_t,scroll:Ni,erase:Li,beep:ji},jt={exports:{}};let qe=process||{},wn=qe.argv||[],He=qe.env||{},Gi=!(He.NO_COLOR||wn.includes("--no-color"))&&(!!He.FORCE_COLOR||wn.includes("--color")||qe.platform==="win32"||(qe.stdout||{}).isTTY&&He.TERM!=="dumb"||!!He.CI),Wi=(e,t,u=e)=>n=>{let D=""+n,o=D.indexOf(t,e.length);return~o?e+zi(D,t,u,o)+t:e+D+t},zi=(e,t,u,n)=>{let D="",o=0;do D+=e.substring(o,n)+u,o=n+t.length,n=e.indexOf(t,o);while(~n);return D+e.substring(o)},Bn=(e=Gi)=>{let t=e?Wi:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};jt.exports=Bn(),jt.exports.createColors=Bn;var Ui=jt.exports,y=se(Ui);function qi({onlyFirst:e=!1}={}){const t=["[\\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(t,e?void 0:"g")}const Hi=qi();function vn(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Hi,"")}function An(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $n={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(n){var D=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,r=D;return 55296<=D&&D<=56319&&56320<=o&&o<=57343&&(D&=1023,o&=1023,r=D<<10|o,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?"F":r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?"H":4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?"W":32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?"Na":r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?"A":"N"},t.characterLength=function(n){var D=this.eastAsianWidth(n);return D=="F"||D=="W"||D=="A"?2:1};function u(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(n){for(var D=u(n),o=0,r=0;r<D.length;r++)o=o+this.characterLength(D[r]);return o},t.slice=function(n,D,o){textLen=t.length(n),D=D||0,o=o||1,D<0&&(D=textLen+D),o<0&&(o=textLen+o);for(var r="",i=0,s=u(n),c=0;c<s.length;c++){var f=s[c],l=t.length(f);if(i>=D-(l==2?1:0))if(i+l<=o)r+=f;else break;i+=l}return r}})($n);var Vi=$n.exports;const Ki=An(Vi);var Ji=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 Yi=An(Ji);function be(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=vn(e),e.length===0))return 0;e=e.replace(Yi()," ");const u=t.ambiguousIsNarrow?1:2;let n=0;for(const D of e){const o=D.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(Ki.eastAsianWidth(D)){case"F":case"W":n+=2;break;case"A":n+=u;break;default:n+=1}}return n}const Nt=10,xn=(e=0)=>t=>`\x1B[${t+e}m`,Sn=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,kn=(e=0)=>(t,u,n)=>`\x1B[${38+e};2;${t};${u};${n}m`,S={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(S.modifier);const Zi=Object.keys(S.color),Xi=Object.keys(S.bgColor);[...Zi,...Xi];function Qi(){const e=new Map;for(const[t,u]of Object.entries(S)){for(const[n,D]of Object.entries(u))S[n]={open:`\x1B[${D[0]}m`,close:`\x1B[${D[1]}m`},u[n]=S[n],e.set(D[0],D[1]);Object.defineProperty(S,t,{value:u,enumerable:!1})}return Object.defineProperty(S,"codes",{value:e,enumerable:!1}),S.color.close="\x1B[39m",S.bgColor.close="\x1B[49m",S.color.ansi=xn(),S.color.ansi256=Sn(),S.color.ansi16m=kn(),S.bgColor.ansi=xn(Nt),S.bgColor.ansi256=Sn(Nt),S.bgColor.ansi16m=kn(Nt),Object.defineProperties(S,{rgbToAnsi256:{value:(t,u,n)=>t===u&&u===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(u/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:t=>{const u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!u)return[0,0,0];let[n]=u;n.length===3&&(n=[...n].map(o=>o+o).join(""));const D=Number.parseInt(n,16);return[D>>16&255,D>>8&255,D&255]},enumerable:!1},hexToAnsi256:{value:t=>S.rgbToAnsi256(...S.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let u,n,D;if(t>=232)u=((t-232)*10+8)/255,n=u,D=u;else{t-=16;const i=t%36;u=Math.floor(t/36)/5,n=Math.floor(i/6)/5,D=i%6/5}const o=Math.max(u,n,D)*2;if(o===0)return 30;let r=30+(Math.round(D)<<2|Math.round(n)<<1|Math.round(u));return o===2&&(r+=60),r},enumerable:!1},rgbToAnsi:{value:(t,u,n)=>S.ansi256ToAnsi(S.rgbToAnsi256(t,u,n)),enumerable:!1},hexToAnsi:{value:t=>S.ansi256ToAnsi(S.hexToAnsi256(t)),enumerable:!1}}),S}const ea=Qi(),Ve=new Set(["\x1B","\x9B"]),ta=39,Lt="\x07",Mn="[",ua="]",In="m",Gt=`${ua}8;;`,On=e=>`${Ve.values().next().value}${Mn}${e}${In}`,Tn=e=>`${Ve.values().next().value}${Gt}${e}${Lt}`,na=e=>e.split(" ").map(t=>be(t)),Wt=(e,t,u)=>{const n=[...t];let D=!1,o=!1,r=be(vn(e[e.length-1]));for(const[i,s]of n.entries()){const c=be(s);if(r+c<=u?e[e.length-1]+=s:(e.push(s),r=0),Ve.has(s)&&(D=!0,o=n.slice(i+1).join("").startsWith(Gt)),D){o?s===Lt&&(D=!1,o=!1):s===In&&(D=!1);continue}r+=c,r===u&&i<n.length-1&&(e.push(""),r=0)}!r&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},ra=e=>{const t=e.split(" ");let u=t.length;for(;u>0&&!(be(t[u-1])>0);)u--;return u===t.length?e:t.slice(0,u).join(" ")+t.slice(u).join("")},Da=(e,t,u={})=>{if(u.trim!==!1&&e.trim()==="")return"";let n="",D,o;const r=na(e);let i=[""];for(const[c,f]of e.split(" ").entries()){u.trim!==!1&&(i[i.length-1]=i[i.length-1].trimStart());let l=be(i[i.length-1]);if(c!==0&&(l>=t&&(u.wordWrap===!1||u.trim===!1)&&(i.push(""),l=0),(l>0||u.trim===!1)&&(i[i.length-1]+=" ",l++)),u.hard&&r[c]>t){const a=t-l,d=1+Math.floor((r[c]-a-1)/t);Math.floor((r[c]-1)/t)<d&&i.push(""),Wt(i,f,t);continue}if(l+r[c]>t&&l>0&&r[c]>0){if(u.wordWrap===!1&&l<t){Wt(i,f,t);continue}i.push("")}if(l+r[c]>t&&u.wordWrap===!1){Wt(i,f,t);continue}i[i.length-1]+=f}u.trim!==!1&&(i=i.map(c=>ra(c)));const s=[...i.join(`
29
+ `)];for(const[c,f]of s.entries()){if(n+=f,Ve.has(f)){const{groups:a}=new RegExp(`(?:\\${Mn}(?<code>\\d+)m|\\${Gt}(?<uri>.*)${Lt})`).exec(s.slice(c).join(""))||{groups:{}};if(a.code!==void 0){const d=Number.parseFloat(a.code);D=d===ta?void 0:d}else a.uri!==void 0&&(o=a.uri.length===0?void 0:a.uri)}const l=ea.codes.get(Number(D));s[c+1]===`
30
+ `?(o&&(n+=Tn("")),D&&l&&(n+=On(l))):f===`
31
+ `&&(D&&l&&(n+=On(D)),o&&(n+=Tn(o)))}return n};function Pn(e,t,u){return String(e).normalize().replace(/\r\n/g,`
32
32
  `).split(`
33
- `).map(n=>Vi(n,t,u)).join(`
34
- `)}var Ji=Object.defineProperty,Yi=(e,t,u)=>t in e?Ji(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,G=(e,t,u)=>(Yi(e,typeof t!="symbol"?t+"":t,u),u);function Zi(e,t){if(e===t)return;const u=e.split(`
33
+ `).map(n=>Da(n,t,u)).join(`
34
+ `)}var oa=Object.defineProperty,sa=(e,t,u)=>t in e?oa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,W=(e,t,u)=>(sa(e,typeof t!="symbol"?t+"":t,u),u);function ia(e,t){if(e===t)return;const u=e.split(`
35
35
  `),n=t.split(`
36
- `),r=[];for(let o=0;o<Math.max(u.length,n.length);o++)u[o]!==n[o]&&r.push(o);return r}const In=Symbol("clack:cancel");function Mn(e){return e===In}function qe(e,t){e.isTTY&&e.setRawMode(t)}const kn=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),Xi=new Set(["up","down","left","right","space","enter"]);class Tn{constructor({render:t,input:u=_D,output:n=jD,...r},o=!0){G(this,"input"),G(this,"output"),G(this,"rl"),G(this,"opts"),G(this,"_track",!1),G(this,"_render"),G(this,"_cursor",0),G(this,"state","initial"),G(this,"value"),G(this,"error",""),G(this,"subscribers",new Map),G(this,"_prevFrame",""),this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=t.bind(this),this._track=o,this.input=u,this.output=n}prompt(){const t=new qD(0);return t._write=(u,n,r)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),r()},this.input.pipe(t),this.rl=mu.createInterface({input:this.input,output:t,tabSize:2,prompt:"",escapeCodeTimeout:50}),mu.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),qe(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((u,n)=>{this.once("submit",()=>{this.output.write(q.cursor.show),this.output.off("resize",this.render),qe(this.input,!1),u(this.value)}),this.once("cancel",()=>{this.output.write(q.cursor.show),this.output.off("resize",this.render),qe(this.input,!1),u(In)})})}on(t,u){const n=this.subscribers.get(t)??[];n.push({cb:u}),this.subscribers.set(t,n)}once(t,u){const n=this.subscribers.get(t)??[];n.push({cb:u,once:!0}),this.subscribers.set(t,n)}emit(t,...u){const n=this.subscribers.get(t)??[],r=[];for(const o of n)o.cb(...u),o.once&&r.push(()=>n.splice(n.indexOf(o),1));for(const o of r)o()}unsubscribe(){this.subscribers.clear()}onKeypress(t,u){if(this.state==="error"&&(this.state="active"),u?.name&&!this._track&&kn.has(u.name)&&this.emit("cursor",kn.get(u.name)),u?.name&&Xi.has(u.name)&&this.emit("cursor",u.name),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),u?.name==="return"){if(this.opts.validate){const n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}t===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
37
- `),qe(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const t=On(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
38
- `).length-1;this.output.write(q.cursor.move(-999,t*-1))}render(){const t=On(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(q.cursor.hide);else{const u=Zi(this._prevFrame,t);if(this.restoreCursor(),u&&u?.length===1){const n=u[0];this.output.write(q.cursor.move(0,n)),this.output.write(q.erase.lines(1));const r=t.split(`
39
- `);this.output.write(r[n]),this._prevFrame=t,this.output.write(q.cursor.move(0,r.length-n-1));return}else if(u&&u?.length>1){const n=u[0];this.output.write(q.cursor.move(0,n)),this.output.write(q.erase.down());const r=t.split(`
40
- `).slice(n);this.output.write(r.join(`
41
- `)),this._prevFrame=t;return}this.output.write(q.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}class Qi extends Tn{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",u=>{this.output.write(q.cursor.move(0,-1)),this.value=u,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var ea=Object.defineProperty,ta=(e,t,u)=>t in e?ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,Pn=(e,t,u)=>(ta(e,typeof t!="symbol"?t+"":t,u),u);let ua=class extends Tn{constructor(e){super(e,!1),Pn(this,"options"),Pn(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};globalThis.process.platform.startsWith("win");function na(){return M.platform!=="win32"?M.env.TERM!=="linux":!!M.env.CI||!!M.env.WT_SESSION||!!M.env.TERMINUS_SUBLIME||M.env.ConEmuTask==="{cmd::Cmder}"||M.env.TERM_PROGRAM==="Terminus-Sublime"||M.env.TERM_PROGRAM==="vscode"||M.env.TERM==="xterm-256color"||M.env.TERM==="alacritty"||M.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Da=na(),Z=(e,t)=>Da?e:t,ra=Z("\u25C6","*"),oa=Z("\u25A0","x"),sa=Z("\u25B2","x"),ia=Z("\u25C7","o"),aa=Z("\u250C","T"),z=Z("\u2502","|"),_t=Z("\u2514","\u2014"),jt=Z("\u25CF",">"),Nt=Z("\u25CB"," "),Rn=e=>{switch(e){case"initial":case"active":return b.cyan(ra);case"cancel":return b.red(oa);case"error":return b.yellow(sa);case"submit":return b.green(ia)}},ca=e=>{const t=e.active??"Yes",u=e.inactive??"No";return new Qi({active:t,inactive:u,initialValue:e.initialValue??!0,render(){const n=`${b.gray(z)}
42
- ${Rn(this.state)} ${e.message}
43
- `,r=this.value?t:u;switch(this.state){case"submit":return`${n}${b.gray(z)} ${b.dim(r)}`;case"cancel":return`${n}${b.gray(z)} ${b.strikethrough(b.dim(r))}
44
- ${b.gray(z)}`;default:return`${n}${b.cyan(z)} ${this.value?`${b.green(jt)} ${t}`:`${b.dim(Nt)} ${b.dim(t)}`} ${b.dim("/")} ${this.value?`${b.dim(Nt)} ${b.dim(u)}`:`${b.green(jt)} ${u}`}
45
- ${b.cyan(_t)}
46
- `}}}).prompt()},la=e=>{const t=(u,n)=>{const r=u.label??String(u.value);return n==="active"?`${b.green(jt)} ${r} ${u.hint?b.dim(`(${u.hint})`):""}`:n==="selected"?`${b.dim(r)}`:n==="cancelled"?`${b.strikethrough(b.dim(r))}`:`${b.dim(Nt)} ${b.dim(r)}`};return new ua({options:e.options,initialValue:e.initialValue,render(){const u=`${b.gray(z)}
47
- ${Rn(this.state)} ${e.message}
48
- `;switch(this.state){case"submit":return`${u}${b.gray(z)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${u}${b.gray(z)} ${t(this.options[this.cursor],"cancelled")}
49
- ${b.gray(z)}`;default:return`${u}${b.cyan(z)} ${this.options.map((n,r)=>t(n,r===this.cursor?"active":"inactive")).join(`
50
- ${b.cyan(z)} `)}
51
- ${b.cyan(_t)}
52
- `}}}).prompt()},fa=(e="")=>{process.stdout.write(`${b.gray(aa)} ${e}
53
- `)},He=(e="")=>{process.stdout.write(`${b.gray(z)}
54
- ${b.gray(_t)} ${e}
55
-
56
- `)},_n=e=>mo,da=_n();class m extends Error{}const Lt=" ",Fa="https://github.com/sugarmo/aicommits/issues/new/choose",pa=e=>e.trim().replace(/^github:/,"").replace(/^git\+/,"").replace(/\.git$/,""),jn=e=>{if(typeof e=="string"){const t=pa(e);if(/^[^/\s]+\/[^/\s]+$/.test(t))return t;const u=t.match(/^git@github\.com:([^/\s]+\/[^/\s]+)$/);if(u?.[1])return u[1];const n=t.match(/^https?:\/\/github\.com\/([^/\s]+\/[^/\s]+)$/);if(n?.[1])return n[1]}if(e&&typeof e=="object"&&"url"in e)return jn(e.url)},Ca=(()=>{const e=jn(go);return e?`https://github.com/${e}/issues/new/choose`:Fa})(),Gt=e=>{e instanceof Error&&!(e instanceof m)&&(e.stack&&console.error(ge(e.stack.split(`
36
+ `),D=[];for(let o=0;o<Math.max(u.length,n.length);o++)u[o]!==n[o]&&D.push(o);return D}const Rn=Symbol("clack:cancel");function aa(e){return e===Rn}function Ke(e,t){e.isTTY&&e.setRawMode(t)}const _n=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),ca=new Set(["up","down","left","right","space","enter"]);class jn{constructor({render:t,input:u=Kr,output:n=Jr,...D},o=!0){W(this,"input"),W(this,"output"),W(this,"rl"),W(this,"opts"),W(this,"_track",!1),W(this,"_render"),W(this,"_cursor",0),W(this,"state","initial"),W(this,"value"),W(this,"error",""),W(this,"subscribers",new Map),W(this,"_prevFrame",""),this.opts=D,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=t.bind(this),this._track=o,this.input=u,this.output=n}prompt(){const t=new uD(0);return t._write=(u,n,D)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),D()},this.input.pipe(t),this.rl=bu.createInterface({input:this.input,output:t,tabSize:2,prompt:"",escapeCodeTimeout:50}),bu.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),Ke(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((u,n)=>{this.once("submit",()=>{this.output.write(J.cursor.show),this.output.off("resize",this.render),Ke(this.input,!1),u(this.value)}),this.once("cancel",()=>{this.output.write(J.cursor.show),this.output.off("resize",this.render),Ke(this.input,!1),u(Rn)})})}on(t,u){const n=this.subscribers.get(t)??[];n.push({cb:u}),this.subscribers.set(t,n)}once(t,u){const n=this.subscribers.get(t)??[];n.push({cb:u,once:!0}),this.subscribers.set(t,n)}emit(t,...u){const n=this.subscribers.get(t)??[],D=[];for(const o of n)o.cb(...u),o.once&&D.push(()=>n.splice(n.indexOf(o),1));for(const o of D)o()}unsubscribe(){this.subscribers.clear()}onKeypress(t,u){if(this.state==="error"&&(this.state="active"),u?.name&&!this._track&&_n.has(u.name)&&this.emit("cursor",_n.get(u.name)),u?.name&&ca.has(u.name)&&this.emit("cursor",u.name),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),u?.name==="return"){if(this.opts.validate){const n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}t===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
37
+ `),Ke(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const t=Pn(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
38
+ `).length-1;this.output.write(J.cursor.move(-999,t*-1))}render(){const t=Pn(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(J.cursor.hide);else{const u=ia(this._prevFrame,t);if(this.restoreCursor(),u&&u?.length===1){const n=u[0];this.output.write(J.cursor.move(0,n)),this.output.write(J.erase.lines(1));const D=t.split(`
39
+ `);this.output.write(D[n]),this._prevFrame=t,this.output.write(J.cursor.move(0,D.length-n-1));return}else if(u&&u?.length>1){const n=u[0];this.output.write(J.cursor.move(0,n)),this.output.write(J.erase.down());const D=t.split(`
40
+ `).slice(n);this.output.write(D.join(`
41
+ `)),this._prevFrame=t;return}this.output.write(J.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}var la=Object.defineProperty,fa=(e,t,u)=>t in e?la(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,Nn=(e,t,u)=>(fa(e,typeof t!="symbol"?t+"":t,u),u);let da=class extends jn{constructor(e){super(e,!1),Nn(this,"options"),Nn(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var Fa=Object.defineProperty,pa=(e,t,u)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,Ca=(e,t,u)=>(pa(e,typeof t!="symbol"?t+"":t,u),u);class ma extends jn{constructor(t){super(t),Ca(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${y.inverse(y.hidden("_"))}`;else{const u=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${u}${y.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}}globalThis.process.platform.startsWith("win");function ha(){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 ga=ha(),X=(e,t)=>ga?e:t,Ea=X("\u25C6","*"),ya=X("\u25A0","x"),ba=X("\u25B2","x"),wa=X("\u25C7","o"),Ba=X("\u250C","T"),G=X("\u2502","|"),Je=X("\u2514","\u2014"),va=X("\u25CF",">"),Aa=X("\u25CB"," "),Ln=e=>{switch(e){case"initial":case"active":return y.cyan(Ea);case"cancel":return y.red(ya);case"error":return y.yellow(ba);case"submit":return y.green(wa)}},$a=e=>new ma({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){const t=`${y.gray(G)}
42
+ ${Ln(this.state)} ${e.message}
43
+ `,u=e.placeholder?y.inverse(e.placeholder[0])+y.dim(e.placeholder.slice(1)):y.inverse(y.hidden("_")),n=this.value?this.valueWithCursor:u;switch(this.state){case"error":return`${t.trim()}
44
+ ${y.yellow(G)} ${n}
45
+ ${y.yellow(Je)} ${y.yellow(this.error)}
46
+ `;case"submit":return`${t}${y.gray(G)} ${y.dim(this.value||e.placeholder)}`;case"cancel":return`${t}${y.gray(G)} ${y.strikethrough(y.dim(this.value??""))}${this.value?.trim()?`
47
+ `+y.gray(G):""}`;default:return`${t}${y.cyan(G)} ${n}
48
+ ${y.cyan(Je)}
49
+ `}}}).prompt(),xa=e=>{const t=(u,n)=>{const D=u.label??String(u.value);return n==="active"?`${y.green(va)} ${D} ${u.hint?y.dim(`(${u.hint})`):""}`:n==="selected"?`${y.dim(D)}`:n==="cancelled"?`${y.strikethrough(y.dim(D))}`:`${y.dim(Aa)} ${y.dim(D)}`};return new da({options:e.options,initialValue:e.initialValue,render(){const u=`${y.gray(G)}
50
+ ${Ln(this.state)} ${e.message}
51
+ `;switch(this.state){case"submit":return`${u}${y.gray(G)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${u}${y.gray(G)} ${t(this.options[this.cursor],"cancelled")}
52
+ ${y.gray(G)}`;default:return`${u}${y.cyan(G)} ${this.options.map((n,D)=>t(n,D===this.cursor?"active":"inactive")).join(`
53
+ ${y.cyan(G)} `)}
54
+ ${y.cyan(Je)}
55
+ `}}}).prompt()},Sa=(e="")=>{process.stdout.write(`${y.gray(Ba)} ${e}
56
+ `)},Ye=(e="")=>{process.stdout.write(`${y.gray(G)}
57
+ ${y.gray(Je)} ${e}
58
+
59
+ `)},Gn=e=>xo,ka=Gn();class m extends Error{}const zt=" ",Ma="https://github.com/sugarmo/aicommits/issues/new/choose",Ia=e=>e.trim().replace(/^github:/,"").replace(/^git\+/,"").replace(/\.git$/,""),Wn=e=>{if(typeof e=="string"){const t=Ia(e);if(/^[^/\s]+\/[^/\s]+$/.test(t))return t;const u=t.match(/^git@github\.com:([^/\s]+\/[^/\s]+)$/);if(u?.[1])return u[1];const n=t.match(/^https?:\/\/github\.com\/([^/\s]+\/[^/\s]+)$/);if(n?.[1])return n[1]}if(e&&typeof e=="object"&&"url"in e)return Wn(e.url)},Oa=(()=>{const e=Wn(ko);return e?`https://github.com/${e}/issues/new/choose`:Ma})(),Ut=e=>{e instanceof Error&&!(e instanceof m)&&(e.stack&&console.error(Ue(e.stack.split(`
57
60
  `).slice(1).join(`
58
61
  `))),console.error(`
59
- ${Lt}${ge(`aicommits v${da}`)}`),console.error(`
60
- ${Lt}Please open a Bug report with the information above:`),console.error(`${Lt}${Ca}`))},Nn=async(e,t)=>{const{stdout:u,failed:n}=await U("git",["rev-parse",...e],{reject:!1,cwd:t});if(n)throw new m("The current directory must be a Git repository!");return u.trim()},Ln=async()=>Nn(["--show-toplevel"]),ma=async(e,t)=>{const u=t||process.cwd(),n=await Nn(["--git-path",e],u);return N.isAbsolute(n)?n:N.resolve(u,n)},Gn=e=>`:(exclude)${e}`,ha=["package-lock.json","pnpm-lock.yaml","*.lock"].map(Gn),zn=e=>e.split(`
61
- `).filter(Boolean),Wn=e=>[...ha,...e?e.map(Gn):[]],Un=async(e,t,u)=>{const n=Wn(t),{stdout:r}=await U("git",[...e,"--name-only",...n],{cwd:u});if(!r)return;const{stdout:o}=await U("git",[...e,...n],{cwd:u});return{files:zn(r),diff:o}},ga=async(e,t)=>{const{stdout:u}=await U("git",["ls-files","--others","--exclude-standard","--",".",...Wn(e)],{cwd:t});return u?zn(u):[]},Ea=async(e,t)=>{if(e.length===0)return"";const u=[];for(const n of e){const{stdout:r}=await U("git",["diff","--no-index","--diff-algorithm=minimal","--","/dev/null",n],{reject:!1,cwd:t});r&&u.push(r)}return u.join(`
62
+ ${zt}${Ue(`aicommits v${ka}`)}`),console.error(`
63
+ ${zt}Please open a Bug report with the information above:`),console.error(`${zt}${Oa}`))},zn=async(e,t)=>{const{stdout:u,failed:n}=await U("git",["rev-parse",...e],{reject:!1,cwd:t});if(n)throw new m("The current directory must be a Git repository!");return u.trim()},Un=async()=>zn(["--show-toplevel"]),Ta=async(e,t)=>{const u=t||process.cwd(),n=await zn(["--git-path",e],u);return N.isAbsolute(n)?n:N.resolve(u,n)},qn=e=>`:(exclude)${e}`,Pa=["package-lock.json","pnpm-lock.yaml","*.lock"].map(qn),Hn=e=>e.split(`
64
+ `).filter(Boolean),Vn=e=>[...Pa,...e?e.map(qn):[]],Kn=async(e,t,u)=>{const n=Vn(t),{stdout:D}=await U("git",[...e,"--name-only",...n],{cwd:u});if(!D)return;const{stdout:o}=await U("git",[...e,...n],{cwd:u});return{files:Hn(D),diff:o}},Ra=async(e,t)=>{const{stdout:u}=await U("git",["ls-files","--others","--exclude-standard","--",".",...Vn(e)],{cwd:t});return u?Hn(u):[]},_a=async(e,t)=>{if(e.length===0)return"";const u=[];for(const n of e){const{stdout:D}=await U("git",["diff","--no-index","--diff-algorithm=minimal","--","/dev/null",n],{reject:!1,cwd:t});D&&u.push(D)}return u.join(`
62
65
 
63
- `)},ya=async e=>{const{stdout:t}=await U("git",["diff","--cached","--name-only"],{cwd:e});return t.trim().length>0},qn=async(e,t)=>{const n=await Un(["diff","--cached","--diff-algorithm=minimal"],e,t);if(n)return{...n,source:"staged"}},Ba=async(e,t)=>{const n=await Un(["diff","--diff-algorithm=minimal"],e,t),r=await ga(e,t);if(!n&&r.length===0)return;const o=await Ea(r,t),D=Array.from(new Set([...n?.files??[],...r])),i=[n?.diff,o].filter(Boolean).join(`
66
+ `)},ja=async e=>{const{stdout:t}=await U("git",["diff","--cached","--name-only"],{cwd:e});return t.trim().length>0},Jn=async(e,t)=>{const n=await Kn(["diff","--cached","--diff-algorithm=minimal"],e,t);if(n)return{...n,source:"staged"}},Na=async(e,t)=>{const n=await Kn(["diff","--diff-algorithm=minimal"],e,t),D=await Ra(e,t);if(!n&&D.length===0)return;const o=await _a(D,t),r=Array.from(new Set([...n?.files??[],...D])),i=[n?.diff,o].filter(Boolean).join(`
64
67
 
65
- `);return{files:D,diff:i,source:"uncommitted"}},ba=async(e,t)=>{const u=await qn(e,t);if(u)return u;if(!await ya(t))return Ba(e,t)},wa=(e,t="staged")=>`Detected ${e.length.toLocaleString()} ${t} file${e.length>1?"s":""}`,Hn="message.md",Kn=["# Commit Message Instructions","","## Language","- Write the commit message in English.","","## Format","- Output a plain git commit title, not a conventional commit prefix.","- Return only a single title line with no body.","- Use concise imperative wording.","","## Focus","- Lead with the dominant user-facing, product-facing, or operational outcome.","- Prefer the end result over the implementation mechanism.","- Describe what the change enables, fixes, prevents, or improves.","- Mention a concrete file, module, class, or subsystem only when it helps disambiguate the change.","","## Constraints","- Keep the title around 50 characters when practical.",'- Avoid vague subjects like "update", "improve", "refactor", or "cleanup" unless the diff is genuinely dominated by maintenance work.'].join(`
66
- `),Ke=(e,t,u="")=>{const n=t?.trim()||u.trim();return n?N.isAbsolute(n)?n:N.join(e,n):""},Aa=async e=>{await $.mkdir(N.dirname(e),{recursive:!0})},va=async(e,t)=>{let u;try{u=await $.lstat(e)}catch(n){throw n.code==="ENOENT"?new m(`${t} was not created: ${e}`):n}if(!u.isFile())throw new m(`${t} must point to a file: ${e}`)},$a=async(e,t)=>{try{if(!(await $.lstat(e)).isFile())throw new m(`Message Markdown file must point to a file: ${e}`);return}catch(u){if(u.code!=="ENOENT")throw u}await Aa(e),await $.writeFile(e,`${t.trimEnd()}
67
- `,"utf8"),await va(e,"Message Markdown file")},Vn=async(e,t)=>{const u=Ke(e,t,Hn);await $a(u,Kn);const n=await $.readFile(u,"utf8");return{messageFilePath:u,messageInstructionsMarkdown:n}},zt=(e,t)=>Ke(e,t)||void 0,xa=async({configDirectoryPath:e,messagePathValue:t,postResponseScriptValue:u,suppressErrors:n=!1})=>{if(n)try{return{...await Vn(e,t),postResponseScriptPath:zt(e,u)}}catch{return{messageFilePath:Ke(e,t,Hn),messageInstructionsMarkdown:Kn,postResponseScriptPath:zt(e,u)}}return{...await Vn(e,t),postResponseScriptPath:zt(e,u)}},Wt=e=>`Flag "${e}" has been removed. Move commit message instructions into ~/.aicommits/message.md or point --message-file at another Markdown file.`,Sa={cn:"zh-CN","zh-cn":"zh-CN","zh-hans":"zh-CN",zh:"zh-CN","zh-tw":"zh-TW","zh-hant":"zh-TW"},Oa="message.md",Ut=["locale","type","details","details-style","instructions","conventional-format","conventional-types","conventional-scope","title-length-guide","detail-column-guide"],Jn={"title-length-guide":["max-length"]},Ia=new Set([...Ut,"max-length"]),W=(e,t,u)=>{if(!t)throw new m(`Invalid config property ${e}: ${u}`)},qt=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:void 0,Yn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Zn=(e,t,u)=>{if(t==null||t==="")return u;if(typeof t=="boolean")return t;if(typeof t=="number"){if(t===1)return!0;if(t===0)return!1}if(typeof t=="string"){const n=t.trim().toLowerCase();if(["true","1","yes","on"].includes(n))return!0;if(["false","0","no","off"].includes(n))return!1}throw new m(`Invalid config property ${e}: Must be a boolean (true/false)`)},Ma=e=>{const t=e.trim().replace(/_/g,"-");return Sa[t.toLowerCase()]??t},ka=e=>e?(W("type",typeof e=="string","Must be a string"),W("type",["","conventional"].includes(e),"Invalid commit type"),e):"",Ta=e=>{if(e==null||e==="")return"paragraph";if(typeof e!="string")throw new m("Invalid config property details-style: Must be a string");const t=e.trim().toLowerCase();return W("details-style",["paragraph","list","markdown"].includes(t),"Must be one of: paragraph, list, markdown"),t},Pa=e=>{if(e==null)return"";if(typeof e!="string")throw new m("Invalid config property instructions: Must be a string");return e.trim()},Ra=e=>{if(e==null)return"";if(typeof e!="string")throw new m("Invalid config property conventional-format: Must be a string");return e.trim()},_a=e=>{if(!e)return"";if(typeof e!="string")throw new m("Invalid config property conventional-types: Must be valid JSON");let t;try{t=JSON.parse(e)}catch{throw new m("Invalid config property conventional-types: Must be valid JSON")}W("conventional-types",typeof t=="object"&&t!==null&&!Array.isArray(t),'Must be a JSON object with "type":"description" pairs');const u=Object.entries(t).map(([n,r])=>[n.trim(),String(r).trim()]).filter(([n,r])=>n.length>0&&r.length>0);return W("conventional-types",u.length>0,"Must contain at least one type"),JSON.stringify(Object.fromEntries(u))},ja=e=>{if(!e)return 50;W("title-length-guide",typeof e=="string"||typeof e=="number","Must be an integer");const t=Number(e);return W("title-length-guide",Number.isInteger(t),"Must be an integer"),W("title-length-guide",t>=20,"Must be greater than 20 characters"),t},Na=e=>{if(!e)return 72;W("detail-column-guide",typeof e=="string"||typeof e=="number","Must be an integer");const t=Number(e);return W("detail-column-guide",Number.isInteger(t),"Must be an integer"),W("detail-column-guide",t>=20,"Must be greater than 20 characters"),t},V={locale(e){if(!e)return"en";if(typeof e!="string")throw new m("Invalid config property locale: Must be a string");const t=Ma(e);return W("locale",/^[a-z]{2,3}(?:-[a-z\d]{2,8})*$/i.test(t),"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"),t},type:ka,details(e){return Zn("details",e,!1)},"details-style":Ta,instructions:Pa,"conventional-format":Ra,"conventional-types":_a,"conventional-scope"(e){return Zn("conventional-scope",e,!1)},"title-length-guide":ja,"detail-column-guide":Na},H=(e,t)=>{const u=qt(e[t]);if(u!==void 0)return u;const n=Jn[t]||[];for(const r of n){const o=qt(e[r]);if(o!==void 0)return o}},La=e=>Ut.some(t=>H(e,t)!==void 0),Ga=e=>e.trim().replace(/[^\w.-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")||"profile",za=e=>{if(e.type!=="conventional")return["## Commit Type","- Output a plain commit title, not a conventional commit prefix."].join(`
68
+ `);return{files:r,diff:i,source:"uncommitted"}},La=async(e,t)=>{const u=await Jn(e,t);if(u)return u;if(!await ja(t))return Na(e,t)},Ga=(e,t="staged")=>`Detected ${e.length.toLocaleString()} ${t} file${e.length>1?"s":""}`,Yn="message.md",Zn=["# Commit Message Instructions","","## Language","- Write the commit message in English.","","## Format","- Output a plain git commit title, not a conventional commit prefix.","- Return only a single title line with no body.","- Use concise imperative wording.","","## Focus","- Lead with the dominant user-facing, product-facing, or operational outcome.","- Prefer the end result over the implementation mechanism.","- Describe what the change enables, fixes, prevents, or improves.","- Mention a concrete file, module, class, or subsystem only when it helps disambiguate the change.","","## Constraints","- Keep the title around 50 characters when practical.",'- Avoid vague subjects like "update", "improve", "refactor", or "cleanup" unless the diff is genuinely dominated by maintenance work.'].join(`
69
+ `),Ze=(e,t,u="")=>{const n=t?.trim()||u.trim();return n?N.isAbsolute(n)?n:N.join(e,n):""},Wa=async e=>{await A.mkdir(N.dirname(e),{recursive:!0})},za=async(e,t)=>{let u;try{u=await A.lstat(e)}catch(n){throw n.code==="ENOENT"?new m(`${t} was not created: ${e}`):n}if(!u.isFile())throw new m(`${t} must point to a file: ${e}`)},Ua=async(e,t)=>{try{if(!(await A.lstat(e)).isFile())throw new m(`Message Markdown file must point to a file: ${e}`);return}catch(u){if(u.code!=="ENOENT")throw u}await Wa(e),await A.writeFile(e,`${t.trimEnd()}
70
+ `,"utf8"),await za(e,"Message Markdown file")},Xn=async(e,t)=>{const u=Ze(e,t,Yn);await Ua(u,Zn);const n=await A.readFile(u,"utf8");return{messageFilePath:u,messageInstructionsMarkdown:n}},qt=(e,t)=>Ze(e,t)||void 0,qa=async({configDirectoryPath:e,messagePathValue:t,postResponseScriptValue:u,suppressErrors:n=!1})=>{if(n)try{return{...await Xn(e,t),postResponseScriptPath:qt(e,u)}}catch{return{messageFilePath:Ze(e,t,Yn),messageInstructionsMarkdown:Zn,postResponseScriptPath:qt(e,u)}}return{...await Xn(e,t),postResponseScriptPath:qt(e,u)}},Ht=e=>`Flag "${e}" has been removed. Move commit message instructions into ~/.aicommits/message.md or point --message-file at another Markdown file.`,Ha={cn:"zh-CN","zh-cn":"zh-CN","zh-hans":"zh-CN",zh:"zh-CN","zh-tw":"zh-TW","zh-hant":"zh-TW"},Va="message.md",Vt=["locale","type","details","details-style","instructions","conventional-format","conventional-types","conventional-scope","title-length-guide","detail-column-guide"],Qn={"title-length-guide":["max-length"]},Ka=new Set([...Vt,"max-length"]),z=(e,t,u)=>{if(!t)throw new m(`Invalid config property ${e}: ${u}`)},Kt=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:void 0,er=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),tr=(e,t,u)=>{if(t==null||t==="")return u;if(typeof t=="boolean")return t;if(typeof t=="number"){if(t===1)return!0;if(t===0)return!1}if(typeof t=="string"){const n=t.trim().toLowerCase();if(["true","1","yes","on"].includes(n))return!0;if(["false","0","no","off"].includes(n))return!1}throw new m(`Invalid config property ${e}: Must be a boolean (true/false)`)},Ja=e=>{const t=e.trim().replace(/_/g,"-");return Ha[t.toLowerCase()]??t},Ya=e=>e?(z("type",typeof e=="string","Must be a string"),z("type",["","conventional"].includes(e),"Invalid commit type"),e):"",Za=e=>{if(e==null||e==="")return"paragraph";if(typeof e!="string")throw new m("Invalid config property details-style: Must be a string");const t=e.trim().toLowerCase();return z("details-style",["paragraph","list","markdown"].includes(t),"Must be one of: paragraph, list, markdown"),t},Xa=e=>{if(e==null)return"";if(typeof e!="string")throw new m("Invalid config property instructions: Must be a string");return e.trim()},Qa=e=>{if(e==null)return"";if(typeof e!="string")throw new m("Invalid config property conventional-format: Must be a string");return e.trim()},ec=e=>{if(!e)return"";if(typeof e!="string")throw new m("Invalid config property conventional-types: Must be valid JSON");let t;try{t=JSON.parse(e)}catch{throw new m("Invalid config property conventional-types: Must be valid JSON")}z("conventional-types",typeof t=="object"&&t!==null&&!Array.isArray(t),'Must be a JSON object with "type":"description" pairs');const u=Object.entries(t).map(([n,D])=>[n.trim(),String(D).trim()]).filter(([n,D])=>n.length>0&&D.length>0);return z("conventional-types",u.length>0,"Must contain at least one type"),JSON.stringify(Object.fromEntries(u))},tc=e=>{if(!e)return 50;z("title-length-guide",typeof e=="string"||typeof e=="number","Must be an integer");const t=Number(e);return z("title-length-guide",Number.isInteger(t),"Must be an integer"),z("title-length-guide",t>=20,"Must be greater than 20 characters"),t},uc=e=>{if(!e)return 72;z("detail-column-guide",typeof e=="string"||typeof e=="number","Must be an integer");const t=Number(e);return z("detail-column-guide",Number.isInteger(t),"Must be an integer"),z("detail-column-guide",t>=20,"Must be greater than 20 characters"),t},Y={locale(e){if(!e)return"en";if(typeof e!="string")throw new m("Invalid config property locale: Must be a string");const t=Ja(e);return z("locale",/^[a-z]{2,3}(?:-[a-z\d]{2,8})*$/i.test(t),"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"),t},type:Ya,details(e){return tr("details",e,!1)},"details-style":Za,instructions:Xa,"conventional-format":Qa,"conventional-types":ec,"conventional-scope"(e){return tr("conventional-scope",e,!1)},"title-length-guide":tc,"detail-column-guide":uc},q=(e,t)=>{const u=Kt(e[t]);if(u!==void 0)return u;const n=Qn[t]||[];for(const D of n){const o=Kt(e[D]);if(o!==void 0)return o}},nc=e=>Vt.some(t=>q(e,t)!==void 0),rc=e=>e.trim().replace(/[^\w.-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")||"profile",Dc=e=>{if(e.type!=="conventional")return["## Commit Type","- Output a plain commit title, not a conventional commit prefix."].join(`
68
71
  `);const t=["## Commit Type","- Use conventional commit formatting."];return e["conventional-scope"]?t.push("- Prefer `type(scope): subject` and only omit scope when there is no clear dominant module, file, class, or subsystem."):t.push("- Prefer `type: subject` without a scope."),e["conventional-format"]&&t.push(`- Use this title format exactly: \`${e["conventional-format"]}\`.`),e["conventional-types"]&&t.push("- Use these conventional type definitions:","```json",e["conventional-types"],"```"),t.join(`
69
- `)},Wa=e=>{if(!e.details)return["## Body","- Return only the title line with no body."].join(`
72
+ `)},oc=e=>{if(!e.details)return["## Body","- Return only the title line with no body."].join(`
70
73
  `);const t=["## Body","- Include a body only when the title alone is not sufficient."];return e["details-style"]==="list"?t.push("- When a body is needed, use concise bullet points.",`- Wrap bullet lines around column ${e["detail-column-guide"]} when practical.`):e["details-style"]==="markdown"?t.push("- When a body is needed, use concise markdown without fenced code blocks."):t.push("- When a body is needed, write concise prose paragraphs.",`- Wrap body text around column ${e["detail-column-guide"]} when practical.`),t.join(`
71
- `)},Ua=e=>["# Commit Message Instructions","","## Language",`- Write the commit message strictly in ${e.locale}.`,"",za(e),"","## Title","- Use concise imperative wording.","- Focus on the dominant user-facing, product-facing, or operational outcome first.","- Prefer the end result over the implementation mechanism.",`- Keep the title around ${e["title-length-guide"]} characters when practical.`,"",Wa(e),"","## Style","- Describe what the change enables, fixes, prevents, or improves.",'- Avoid vague subjects like "update", "improve", "refactor", or "cleanup" unless the diff is genuinely dominated by maintenance work.',...e.instructions?["","## Additional Instructions",e.instructions]:[]].join(`
72
- `),qa=async e=>{await $.mkdir(N.dirname(e),{recursive:!0})},Ha=async(e,t)=>{let u;try{u=await $.lstat(e)}catch(n){throw n.code==="ENOENT"?new m(`${t} was not created: ${e}`):n}if(!u.isFile())throw new m(`${t} must point to a file: ${e}`)},Ka=async(e,t)=>{try{if(!(await $.lstat(e)).isFile())throw new m(`Migrated message Markdown file must point to a file: ${e}`);return}catch(u){if(u.code!=="ENOENT")throw u}await qa(e),await $.writeFile(e,`${t.trimEnd()}
73
- `,"utf8"),await Ha(e,"Migrated message Markdown file")},Va=e=>({locale:V.locale(H(e,"locale")),type:V.type(H(e,"type")),details:V.details(H(e,"details")),"details-style":V["details-style"](H(e,"details-style")),instructions:V.instructions(H(e,"instructions")),"conventional-format":V["conventional-format"](H(e,"conventional-format")),"conventional-types":V["conventional-types"](H(e,"conventional-types")),"conventional-scope":V["conventional-scope"](H(e,"conventional-scope")),"title-length-guide":V["title-length-guide"](H(e,"title-length-guide")),"detail-column-guide":V["detail-column-guide"](H(e,"detail-column-guide"))}),Ja=e=>{for(const t of Ut){delete e[t];const u=Jn[t]||[];for(const n of u)delete e[n]}},Xn=async(e,t,u,n)=>{if(!La(e))return!1;const r=Va(e),o=qt(e["message-path"]),D=typeof o=="string"&&o.trim()?o.trim():u,i=Ke(t,D,u);return await Ka(i,Ua(r)),n&&(e["message-path"]=D),Ja(e),!0},Ht=async({backupConfig:e,config:t,configDirectoryPath:u,normalizeLegacyConfigKeys:n,writeConfig:r})=>{let o=!1;o=await Xn(t,u,Oa,!1)||o;const{profiles:D}=t;if(Yn(D))for(const[i,s]of Object.entries(D)){if(!Yn(s))continue;const c=`message.${Ga(i)}.md`;o=await Xn(s,u,c,!0)||o}o&&(n(t),await e?.(),await r(t))},Ya=e=>{const t=e.trim();if(Ia.has(t))return`Config property "${t}" has moved to your message Markdown file. Edit ~/.aicommits/message.md or set message-path instead.`},Za=["responses","chat"],Xa=["none","low","medium","high","xhigh"],{hasOwnProperty:Qa}=Object.prototype,Qn=(e,t)=>Qa.call(e,t),k=(e,t,u)=>{if(!t)throw new m(`Invalid config property ${e}: ${u}`)},ye=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),X=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:void 0,ec=(e,t,u)=>{if(t==null||t==="")return u;if(typeof t=="boolean")return t;if(typeof t=="number"){if(t===1)return!0;if(t===0)return!1}if(typeof t=="string"){const n=t.trim().toLowerCase();if(["true","1","yes","on"].includes(n))return!0;if(["false","0","no","off"].includes(n))return!1}throw new m(`Invalid config property ${e}: Must be a boolean (true/false)`)},tc=e=>{let t;try{t=JSON.parse(e)}catch{throw new m("Invalid config property request-options: Must be valid JSON")}return k("request-options",typeof t=="object"&&t!==null&&!Array.isArray(t),"Must be a JSON object"),JSON.stringify(t)},uc=e=>{if(typeof e=="number")return k("context-window",Number.isInteger(e),"Must be an integer or use K/M suffix"),e;const u=e.trim().match(/^([+-]?\d+)([kKmM])?$/);if(k("context-window",!!u,"Must be an integer or use K/M suffix"),!u?.[1])return Number.NaN;const n=Number(u[1]),r=u[2]?.toLowerCase();let o=1;return r==="k"?o=1024:r==="m"&&(o=1024*1024),n*o},eD=(e,t="")=>{if(e==null)return t;if(typeof e!="string")throw new m("Path values must be strings");return e.trim()||t},nc=/^[A-Za-z_]\w*$/,Dc=e=>{if(typeof e!="string")return;const t=e.trim();if(!t)return;if(t.startsWith("env:")){const n=t.slice(4).trim();return nc.test(n)?n:void 0}return t.match(/^\$\{([A-Za-z_]\w*)\}$/)?.[1]},rc=(e,t)=>{if(e!=="api-key")return t;const u=Dc(t);if(!u)return t;const n=process.env[u];if(n===void 0)throw new m(`Invalid config property api-key: Environment variable ${u} is not set`);return n},Be={"api-key"(e){if(!e)throw new m("Please set your API key via `aicommits config set api-key=<your token>`");if(typeof e!="string")throw new m("Invalid config property api-key: Must be a string");const t=e.trim();return k("api-key",t.length>0,"Cannot be empty"),t},"base-url"(e){if(e==null||e==="")throw new m("Please set your API base URL via `aicommits config set base-url=<https://...>`");if(typeof e!="string")throw new m("Invalid config property base-url: Must be a valid URL");const t=e.trim();let u;try{u=new URL(t)}catch{throw new m("Invalid config property base-url: Must be a valid URL")}k("base-url",u.protocol==="https:","Must be an HTTPS URL"),k("base-url",u.hash==="","Must not include URL fragments"),k("base-url",u.search==="","Must not include query parameters");const n=u.pathname.replace(/\/+$/,"");return`${u.origin}${n}`},profile(e){if(e==null)return"";if(typeof e!="string")throw new m("Invalid config property profile: Must be a string");return e.trim()},generate(e){if(!e)return 1;k("generate",typeof e=="string"||typeof e=="number","Must be an integer");const t=Number(e);return k("generate",Number.isInteger(t),"Must be an integer"),k("generate",t>0,"Must be greater than 0"),k("generate",t<=5,"Must be less or equal to 5"),t},proxy(e){if(!(e==null||e==="")){if(typeof e!="string")throw new m("Invalid config property proxy: Must be a valid URL");return k("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 m("Invalid config property model: Must be a string");return e},timeout(e){if(!e)return 1e4;k("timeout",typeof e=="string"||typeof e=="number","Must be an integer");const t=Number(e);return k("timeout",Number.isInteger(t),"Must be an integer"),k("timeout",t>=500,"Must be greater than 500ms"),t},"context-window"(e){if(!e)return 0;if(typeof e!="string"&&typeof e!="number")throw new m("Invalid config property context-window: Must be an integer or use K/M suffix");const t=uc(e);return k("context-window",Number.isInteger(t),"Must be an integer"),k("context-window",t===0||t>=1024,"Must be 0 (auto) or greater than or equal to 1024 tokens"),t},"show-reasoning"(e){return ec("show-reasoning",e,!1)},"reasoning-effort"(e){if(e==null||e==="")return"";if(typeof e!="string")throw new m("Invalid config property reasoning-effort: Must be one of: none, low, medium, high, xhigh");const t=e.trim().toLowerCase();return k("reasoning-effort",Xa.includes(t),"Must be one of: none, low, medium, high, xhigh"),t},"api-mode"(e){if(e==null||e==="")return"responses";if(typeof e!="string")throw new m('Invalid config property api-mode: Must be "responses" or "chat"');const t=e.trim().toLowerCase();return k("api-mode",Za.includes(t),"Must be one of: responses, chat"),t},"request-options"(e){if(e==null||e==="")return"";if(typeof e!="string")throw new m("Invalid config property request-options: Must be valid JSON");return tc(e)},"message-path"(e){try{return eD(e,"message.md")}catch{throw new m("Invalid config property message-path: Must be a string")}},"post-response-script"(e){try{return eD(e,"")}catch{throw new m("Invalid config property post-response-script: Must be a string")}}},oc={},Kt={"api-key":["openai-key","OPENAI_KEY","OPENAI_API_KEY"],"base-url":["openai-base-url","OPENAI_BASE_URL"],model:["OPENAI_MODEL"]},J=N.join(Oe.homedir(),".aicommits"),tD=N.join(J,"config.toml"),sc=[N.join(Oe.homedir(),"aicommits.toml"),N.join(Oe.homedir(),".aicommits")],ic=e=>{let t=!1,u=!1,n=!1;for(let r=0;r<e.length;r+=1){const o=e[r];if(o==="\\"&&u&&!n){n=!0;continue}if(o==='"'&&!t&&!n)u=!u;else if(o==="'"&&!u)t=!t;else if(o==="#"&&!t&&!u)return e.slice(0,r);n=!1}return e},uD=e=>{const t=e.trim();return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t},ac=e=>{const t=e.trim();if(t==="")return"";if(t.startsWith('"')&&t.endsWith('"'))try{return JSON.parse(t)}catch{return t.slice(1,-1)}return t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):/^(?:true|false)$/i.test(t)?t.toLowerCase()==="true":/^[+-]?\d+$/.test(t)||/^[+-]?\d+\.\d+$/.test(t)?Number(t):t},cc=(e,t)=>{let u=e;for(const n of t){const r=u[n];if(!ye(r)){const o=Object.create(null);u[n]=o,u=o;continue}u=r}return u},lc=e=>{const t=Object.create(null);let u=t;for(const n of e.split(/\r?\n/)){const r=ic(n).trim();if(!r)continue;if(r.startsWith("[")&&r.endsWith("]")){const s=r.slice(1,-1).trim();if(!s){u=t;continue}const c=s.split(".").map(uD).map(f=>f.trim()).filter(Boolean);if(c.length===0){u=t;continue}u=cc(t,c);continue}const o=r.indexOf("=");if(o<=0)continue;const D=uD(r.slice(0,o));if(!D)continue;const i=ac(r.slice(o+1));u[D]=i}return t},nD=e=>typeof e=="string"?JSON.stringify(e):String(e),fc=e=>{const t=[],u=[],n=(r,o)=>{const D=[],i=[];for(const[s,c]of Object.entries(o)){const f=X(c);if(f!==void 0){D.push(`${s} = ${nD(f)}`);continue}ye(c)&&i.push([s,c])}r.length>0&&D.length>0&&u.push(`[${r.join(".")}]`,...D,"");for(const[s,c]of i)n([...r,s],c)};for(const[r,o]of Object.entries(e)){const D=X(o);if(D!==void 0){t.push(`${r} = ${nD(D)}`);continue}ye(o)&&n([r],o)}for(;u[u.length-1]==="";)u.pop();return[...t,...t.length>0&&u.length>0?[""]:[],...u].join(`
74
- `)},be=async e=>{await $.mkdir(J,{recursive:!0});const t=fc(e);await $.writeFile(tD,`${t}
75
- `,"utf8")},dc=async(e,t)=>{try{if((await $.lstat(e)).isFile())return;throw new m(`Backup path must point to a file: ${e}`)}catch(u){if(u.code!=="ENOENT")throw u}await $.mkdir(N.dirname(e),{recursive:!0}),await $.writeFile(e,t,"utf8")},Vt=async(e,t)=>{!e||t===void 0||await dc(`${e}.bak`,t)},DD=async(e,t,u)=>{await Vt(t,u),await $.rm(t),await $.mkdir(J,{recursive:!0}),await Ht({config:e,configDirectoryPath:J,normalizeLegacyConfigKeys:we,writeConfig:be}),await be(e)},rD=async e=>{try{if(!(await $.lstat(e)).isFile())return;const u=await $.readFile(e,"utf8");return{config:lc(u),content:u,path:e}}catch{return}},oD=async()=>{const e=await rD(tD);if(e)return{config:e.config,sourceContent:e.content,sourcePath:e.path};for(const t of sc){const u=await rD(t);if(u)return{config:u.config,sourceContent:u.content,sourcePath:u.path}}return{config:Object.create(null)}},Fc=(e,t)=>{const u=Kt[e];if(!(!u||u.length===0))for(const n of u){const r=X(t[n]);if(r!==void 0)return r}},we=e=>{for(const[t,u]of Object.entries(Kt)){if(X(e[t])===void 0)for(const n of u){const r=X(e[n]);if(r!==void 0){e[t]=r;break}}for(const n of u)delete e[n]}},pc=(e,t,u)=>{if(!t)return;const{profiles:n}=e;if(!ye(n))return;const r=n[t];if(ye(r))return X(r[u])},sD=e=>{const t=e.trim();return Qn(Be,t)?t:oc[t]},Jt=async(e,t)=>{const{config:u,sourceContent:n,sourcePath:r}=await oD(),o=r===J;we(u),o&&r?await DD(u,r,n):await Ht({backupConfig:async()=>Vt(r,n),config:u,configDirectoryPath:J,normalizeLegacyConfigKeys:we,writeConfig:be});const D={},i=e?.profile??X(u.profile);let s="";try{s=Be.profile(i)}catch{if(!t)throw new m("Invalid config property profile: Must be a string")}for(const a of Object.keys(Be)){const d=Be[a],F=rc(a,e?.[a]??(a==="profile"?void 0:pc(u,s,a))??X(u[a])??Fc(a,u));if(t)try{D[a]=d(F)}catch{}else D[a]=d(F)}const c=D["message-path"]||"message.md",f=D["post-response-script"]||"",l=await xa({configDirectoryPath:J,messagePathValue:c,postResponseScriptValue:f,suppressErrors:t});return{...D,configDirectoryPath:J,...l}},Cc=async e=>{const{config:t,sourceContent:u,sourcePath:n}=await oD(),r=n===J;we(t),r&&n?await DD(t,n,u):await Ht({backupConfig:async()=>Vt(n,u),config:t,configDirectoryPath:J,normalizeLegacyConfigKeys:we,writeConfig:be});for(const[o,D]of e){const i=Ya(o);if(i)throw new m(i);const s=sD(o);if(!s)throw new m(`Invalid config property: ${o}`);const c=Be[s](D);t[s]=c;const f=Kt[s]||[];for(const l of f)delete t[l]}await be(t)};var Yt={},Zt={exports:{}},Ae={exports:{}},Xt,iD;function mc(){if(iD)return Xt;iD=1;var e=1e3,t=e*60,u=t*60,n=u*24,r=n*7,o=n*365.25;Xt=function(f,l){l=l||{};var a=typeof f;if(a==="string"&&f.length>0)return D(f);if(a==="number"&&isFinite(f))return l.long?s(f):i(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function D(f){if(f=String(f),!(f.length>100)){var l=/^(-?(?:\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(l){var a=parseFloat(l[1]),d=(l[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return a*o;case"weeks":case"week":case"w":return a*r;case"days":case"day":case"d":return a*n;case"hours":case"hour":case"hrs":case"hr":case"h":return a*u;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}function i(f){var l=Math.abs(f);return l>=n?Math.round(f/n)+"d":l>=u?Math.round(f/u)+"h":l>=t?Math.round(f/t)+"m":l>=e?Math.round(f/e)+"s":f+"ms"}function s(f){var l=Math.abs(f);return l>=n?c(f,l,n,"day"):l>=u?c(f,l,u,"hour"):l>=t?c(f,l,t,"minute"):l>=e?c(f,l,e,"second"):f+" ms"}function c(f,l,a,d){var F=l>=a*1.5;return Math.round(f/a)+" "+d+(F?"s":"")}return Xt}var Qt,aD;function cD(){if(aD)return Qt;aD=1;function e(t){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=s,n.humanize=mc(),n.destroy=f,Object.keys(t).forEach(l=>{n[l]=t[l]}),n.names=[],n.skips=[],n.formatters={};function u(l){let a=0;for(let d=0;d<l.length;d++)a=(a<<5)-a+l.charCodeAt(d),a|=0;return n.colors[Math.abs(a)%n.colors.length]}n.selectColor=u;function n(l){let a,d=null,F,p;function C(...h){if(!C.enabled)return;const y=C,A=Number(new Date),_=A-(a||A);y.diff=_,y.prev=a,y.curr=A,a=A,h[0]=n.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let j=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(v,B)=>{if(v==="%%")return"%";j++;const x=n.formatters[B];if(typeof x=="function"){const g=h[j];v=x.call(y,g),h.splice(j,1),j--}return v}),n.formatArgs.call(y,h),(y.log||n.log).apply(y,h)}return C.namespace=l,C.useColors=n.useColors(),C.color=n.selectColor(l),C.extend=r,C.destroy=n.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(F!==n.namespaces&&(F=n.namespaces,p=n.enabled(l)),p),set:h=>{d=h}}),typeof n.init=="function"&&n.init(C),C}function r(l,a){const d=n(this.namespace+(typeof a>"u"?":":a)+l);return d.log=this.log,d}function o(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];const a=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const d of a)d[0]==="-"?n.skips.push(d.slice(1)):n.names.push(d)}function D(l,a){let d=0,F=0,p=-1,C=0;for(;d<l.length;)if(F<a.length&&(a[F]===l[d]||a[F]==="*"))a[F]==="*"?(p=F,C=d,F++):(d++,F++);else if(p!==-1)F=p+1,C++,d=C;else return!1;for(;F<a.length&&a[F]==="*";)F++;return F===a.length}function i(){const l=[...n.names,...n.skips.map(a=>"-"+a)].join(",");return n.enable(""),l}function s(l){for(const a of n.skips)if(D(l,a))return!1;for(const a of n.names)if(D(l,a))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}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 n.enable(n.load()),n}return Qt=e,Qt}Ae.exports;var lD;function hc(){return lD||(lD=1,function(e,t){t.formatArgs=n,t.save=r,t.load=o,t.useColors=u,t.storage=D(),t.destroy=(()=>{let s=!1;return()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function u(){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 s;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&&(s=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(s[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;s.splice(1,0,c,"color: inherit");let f=0,l=0;s[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(f++,a==="%c"&&(l=f))}),s.splice(l,0,c)}t.log=console.debug||console.log||(()=>{});function r(s){try{s?t.storage.setItem("debug",s):t.storage.removeItem("debug")}catch{}}function o(){let s;try{s=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!s&&typeof process<"u"&&"env"in process&&(s=process.env.DEBUG),s}function D(){try{return localStorage}catch{}}e.exports=cD()(t);const{formatters:i}=e.exports;i.j=function(s){try{return JSON.stringify(s)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}(Ae,Ae.exports)),Ae.exports}var ve={exports:{}},eu,fD;function gc(){return fD||(fD=1,eu=(e,t=process.argv)=>{const u=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(u+e),r=t.indexOf("--");return n!==-1&&(r===-1||n<r)}),eu}var tu,dD;function Ec(){if(dD)return tu;dD=1;const e=Oe,t=Qe,u=gc(),{env:n}=process;let r;u("no-color")||u("no-colors")||u("color=false")||u("color=never")?r=0:(u("color")||u("colors")||u("color=true")||u("color=always"))&&(r=1),"FORCE_COLOR"in n&&(n.FORCE_COLOR==="true"?r=1:n.FORCE_COLOR==="false"?r=0:r=n.FORCE_COLOR.length===0?1:Math.min(parseInt(n.FORCE_COLOR,10),3));function o(s){return s===0?!1:{level:s,hasBasic:!0,has256:s>=2,has16m:s>=3}}function D(s,c){if(r===0)return 0;if(u("color=16m")||u("color=full")||u("color=truecolor"))return 3;if(u("color=256"))return 2;if(s&&!c&&r===void 0)return 0;const f=r||0;if(n.TERM==="dumb")return f;if(process.platform==="win32"){const l=e.release().split(".");return Number(l[0])>=10&&Number(l[2])>=10586?Number(l[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(l=>l in n)||n.CI_NAME==="codeship"?1:f;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if(n.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in n){const l=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return l>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:f}function i(s){const c=D(s,s&&s.isTTY);return o(c)}return tu={supportsColor:i,stdout:o(D(!0,t.isatty(1))),stderr:o(D(!0,t.isatty(2)))},tu}ve.exports;var FD;function yc(){return FD||(FD=1,function(e,t){const u=Qe,n=Cu;t.init=f,t.log=i,t.formatArgs=o,t.save=s,t.load=c,t.useColors=r,t.destroy=n.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const a=Ec();a&&(a.stderr||a).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(a=>/^debug_/i.test(a)).reduce((a,d)=>{const F=d.substring(6).toLowerCase().replace(/_([a-z])/g,(C,h)=>h.toUpperCase());let p=process.env[d];return/^(yes|on|true|enabled)$/i.test(p)?p=!0:/^(no|off|false|disabled)$/i.test(p)?p=!1:p==="null"?p=null:p=Number(p),a[F]=p,a},{});function r(){return"colors"in t.inspectOpts?!!t.inspectOpts.colors:u.isatty(process.stderr.fd)}function o(a){const{namespace:d,useColors:F}=this;if(F){const p=this.color,C="\x1B[3"+(p<8?p:"8;5;"+p),h=` ${C};1m${d} \x1B[0m`;a[0]=h+a[0].split(`
74
+ `)},sc=e=>["# Commit Message Instructions","","## Language",`- Write the commit message strictly in ${e.locale}.`,"",Dc(e),"","## Title","- Use concise imperative wording.","- Focus on the dominant user-facing, product-facing, or operational outcome first.","- Prefer the end result over the implementation mechanism.",`- Keep the title around ${e["title-length-guide"]} characters when practical.`,"",oc(e),"","## Style","- Describe what the change enables, fixes, prevents, or improves.",'- Avoid vague subjects like "update", "improve", "refactor", or "cleanup" unless the diff is genuinely dominated by maintenance work.',...e.instructions?["","## Additional Instructions",e.instructions]:[]].join(`
75
+ `),ic=async e=>{await A.mkdir(N.dirname(e),{recursive:!0})},ac=async(e,t)=>{let u;try{u=await A.lstat(e)}catch(n){throw n.code==="ENOENT"?new m(`${t} was not created: ${e}`):n}if(!u.isFile())throw new m(`${t} must point to a file: ${e}`)},cc=async(e,t)=>{try{if(!(await A.lstat(e)).isFile())throw new m(`Migrated message Markdown file must point to a file: ${e}`);return}catch(u){if(u.code!=="ENOENT")throw u}await ic(e),await A.writeFile(e,`${t.trimEnd()}
76
+ `,"utf8"),await ac(e,"Migrated message Markdown file")},lc=e=>({locale:Y.locale(q(e,"locale")),type:Y.type(q(e,"type")),details:Y.details(q(e,"details")),"details-style":Y["details-style"](q(e,"details-style")),instructions:Y.instructions(q(e,"instructions")),"conventional-format":Y["conventional-format"](q(e,"conventional-format")),"conventional-types":Y["conventional-types"](q(e,"conventional-types")),"conventional-scope":Y["conventional-scope"](q(e,"conventional-scope")),"title-length-guide":Y["title-length-guide"](q(e,"title-length-guide")),"detail-column-guide":Y["detail-column-guide"](q(e,"detail-column-guide"))}),fc=e=>{for(const t of Vt){delete e[t];const u=Qn[t]||[];for(const n of u)delete e[n]}},ur=async(e,t,u,n)=>{if(!nc(e))return!1;const D=lc(e),o=Kt(e["message-path"]),r=typeof o=="string"&&o.trim()?o.trim():u,i=Ze(t,r,u);return await cc(i,sc(D)),n&&(e["message-path"]=r),fc(e),!0},Jt=async({backupConfig:e,config:t,configDirectoryPath:u,normalizeLegacyConfigKeys:n,writeConfig:D})=>{let o=!1;o=await ur(t,u,Va,!1)||o;const{profiles:r}=t;if(er(r))for(const[i,s]of Object.entries(r)){if(!er(s))continue;const c=`message.${rc(i)}.md`;o=await ur(s,u,c,!0)||o}o&&(n(t),await e?.(),await D(t))},dc=e=>{const t=e.trim();if(Ka.has(t))return`Config property "${t}" has moved to your message Markdown file. Edit ~/.aicommits/message.md or set message-path instead.`},Fc=["responses","chat"],pc=["none","low","medium","high","xhigh"],{hasOwnProperty:Cc}=Object.prototype,nr=(e,t)=>Cc.call(e,t),R=(e,t,u)=>{if(!t)throw new m(`Invalid config property ${e}: ${u}`)},we=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),te=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:void 0,mc=(e,t,u)=>{if(t==null||t==="")return u;if(typeof t=="boolean")return t;if(typeof t=="number"){if(t===1)return!0;if(t===0)return!1}if(typeof t=="string"){const n=t.trim().toLowerCase();if(["true","1","yes","on"].includes(n))return!0;if(["false","0","no","off"].includes(n))return!1}throw new m(`Invalid config property ${e}: Must be a boolean (true/false)`)},hc=e=>{let t;try{t=JSON.parse(e)}catch{throw new m("Invalid config property request-options: Must be valid JSON")}return R("request-options",typeof t=="object"&&t!==null&&!Array.isArray(t),"Must be a JSON object"),JSON.stringify(t)},gc=e=>{if(typeof e=="number")return R("context-window",Number.isInteger(e),"Must be an integer or use K/M suffix"),e;const u=e.trim().match(/^([+-]?\d+)([kKmM])?$/);if(R("context-window",!!u,"Must be an integer or use K/M suffix"),!u?.[1])return Number.NaN;const n=Number(u[1]),D=u[2]?.toLowerCase();let o=1;return D==="k"?o=1024:D==="m"&&(o=1024*1024),n*o},rr=(e,t="")=>{if(e==null)return t;if(typeof e!="string")throw new m("Path values must be strings");return e.trim()||t},Ec=/^[A-Za-z_]\w*$/,yc=e=>{if(typeof e!="string")return;const t=e.trim();if(!t)return;if(t.startsWith("env:")){const n=t.slice(4).trim();return Ec.test(n)?n:void 0}return t.match(/^\$\{([A-Za-z_]\w*)\}$/)?.[1]},bc=(e,t)=>{if(e!=="api-key")return t;const u=yc(t);if(!u)return t;const n=process.env[u];if(n===void 0)throw new m(`Invalid config property api-key: Environment variable ${u} is not set`);return n},Be={"api-key"(e){if(!e)throw new m("Please set your API key via `aicommits config set api-key=<your token>`");if(typeof e!="string")throw new m("Invalid config property api-key: Must be a string");const t=e.trim();return R("api-key",t.length>0,"Cannot be empty"),t},"base-url"(e){if(e==null||e==="")throw new m("Please set your API base URL via `aicommits config set base-url=<https://...>`");if(typeof e!="string")throw new m("Invalid config property base-url: Must be a valid URL");const t=e.trim();let u;try{u=new URL(t)}catch{throw new m("Invalid config property base-url: Must be a valid URL")}R("base-url",u.protocol==="https:","Must be an HTTPS URL"),R("base-url",u.hash==="","Must not include URL fragments"),R("base-url",u.search==="","Must not include query parameters");const n=u.pathname.replace(/\/+$/,"");return`${u.origin}${n}`},profile(e){if(e==null)return"";if(typeof e!="string")throw new m("Invalid config property profile: Must be a string");return e.trim()},generate(e){if(!e)return 1;R("generate",typeof e=="string"||typeof e=="number","Must be an integer");const t=Number(e);return R("generate",Number.isInteger(t),"Must be an integer"),R("generate",t>0,"Must be greater than 0"),R("generate",t<=5,"Must be less or equal to 5"),t},proxy(e){if(!(e==null||e==="")){if(typeof e!="string")throw new m("Invalid config property proxy: Must be a valid URL");return R("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 m("Invalid config property model: Must be a string");return e},timeout(e){if(!e)return 1e4;R("timeout",typeof e=="string"||typeof e=="number","Must be an integer");const t=Number(e);return R("timeout",Number.isInteger(t),"Must be an integer"),R("timeout",t>=500,"Must be greater than 500ms"),t},"context-window"(e){if(!e)return 0;if(typeof e!="string"&&typeof e!="number")throw new m("Invalid config property context-window: Must be an integer or use K/M suffix");const t=gc(e);return R("context-window",Number.isInteger(t),"Must be an integer"),R("context-window",t===0||t>=1024,"Must be 0 (auto) or greater than or equal to 1024 tokens"),t},"show-reasoning"(e){return mc("show-reasoning",e,!1)},"reasoning-effort"(e){if(e==null||e==="")return"";if(typeof e!="string")throw new m("Invalid config property reasoning-effort: Must be one of: none, low, medium, high, xhigh");const t=e.trim().toLowerCase();return R("reasoning-effort",pc.includes(t),"Must be one of: none, low, medium, high, xhigh"),t},"api-mode"(e){if(e==null||e==="")return"responses";if(typeof e!="string")throw new m('Invalid config property api-mode: Must be "responses" or "chat"');const t=e.trim().toLowerCase();return R("api-mode",Fc.includes(t),"Must be one of: responses, chat"),t},"request-options"(e){if(e==null||e==="")return"";if(typeof e!="string")throw new m("Invalid config property request-options: Must be valid JSON");return hc(e)},"message-path"(e){try{return rr(e,"message.md")}catch{throw new m("Invalid config property message-path: Must be a string")}},"post-response-script"(e){try{return rr(e,"")}catch{throw new m("Invalid config property post-response-script: Must be a string")}}},wc={},Yt={"api-key":["openai-key","OPENAI_KEY","OPENAI_API_KEY"],"base-url":["openai-base-url","OPENAI_BASE_URL"],model:["OPENAI_MODEL"]},Z=N.join(Oe.homedir(),".aicommits"),Dr=N.join(Z,"config.toml"),Bc=[N.join(Oe.homedir(),"aicommits.toml"),N.join(Oe.homedir(),".aicommits")],vc=e=>{let t=!1,u=!1,n=!1;for(let D=0;D<e.length;D+=1){const o=e[D];if(o==="\\"&&u&&!n){n=!0;continue}if(o==='"'&&!t&&!n)u=!u;else if(o==="'"&&!u)t=!t;else if(o==="#"&&!t&&!u)return e.slice(0,D);n=!1}return e},or=e=>{const t=e.trim();return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t},Ac=e=>{const t=e.trim();if(t==="")return"";if(t.startsWith('"')&&t.endsWith('"'))try{return JSON.parse(t)}catch{return t.slice(1,-1)}return t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):/^(?:true|false)$/i.test(t)?t.toLowerCase()==="true":/^[+-]?\d+$/.test(t)||/^[+-]?\d+\.\d+$/.test(t)?Number(t):t},$c=(e,t)=>{let u=e;for(const n of t){const D=u[n];if(!we(D)){const o=Object.create(null);u[n]=o,u=o;continue}u=D}return u},xc=e=>{const t=Object.create(null);let u=t;for(const n of e.split(/\r?\n/)){const D=vc(n).trim();if(!D)continue;if(D.startsWith("[")&&D.endsWith("]")){const s=D.slice(1,-1).trim();if(!s){u=t;continue}const c=s.split(".").map(or).map(f=>f.trim()).filter(Boolean);if(c.length===0){u=t;continue}u=$c(t,c);continue}const o=D.indexOf("=");if(o<=0)continue;const r=or(D.slice(0,o));if(!r)continue;const i=Ac(D.slice(o+1));u[r]=i}return t},sr=e=>typeof e=="string"?JSON.stringify(e):String(e),Sc=e=>{const t=[],u=[],n=(D,o)=>{const r=[],i=[];for(const[s,c]of Object.entries(o)){const f=te(c);if(f!==void 0){r.push(`${s} = ${sr(f)}`);continue}we(c)&&i.push([s,c])}D.length>0&&r.length>0&&u.push(`[${D.join(".")}]`,...r,"");for(const[s,c]of i)n([...D,s],c)};for(const[D,o]of Object.entries(e)){const r=te(o);if(r!==void 0){t.push(`${D} = ${sr(r)}`);continue}we(o)&&n([D],o)}for(;u[u.length-1]==="";)u.pop();return[...t,...t.length>0&&u.length>0?[""]:[],...u].join(`
77
+ `)},ve=async e=>{await A.mkdir(Z,{recursive:!0});const t=Sc(e);await A.writeFile(Dr,`${t}
78
+ `,"utf8")},kc=async(e,t)=>{try{if((await A.lstat(e)).isFile())return;throw new m(`Backup path must point to a file: ${e}`)}catch(u){if(u.code!=="ENOENT")throw u}await A.mkdir(N.dirname(e),{recursive:!0}),await A.writeFile(e,t,"utf8")},Zt=async(e,t)=>{!e||t===void 0||await kc(`${e}.bak`,t)},ir=async(e,t,u)=>{await Zt(t,u),await A.rm(t),await A.mkdir(Z,{recursive:!0}),await Jt({config:e,configDirectoryPath:Z,normalizeLegacyConfigKeys:Ae,writeConfig:ve}),await ve(e)},ar=async e=>{try{if(!(await A.lstat(e)).isFile())return;const u=await A.readFile(e,"utf8");return{config:xc(u),content:u,path:e}}catch{return}},cr=async()=>{const e=await ar(Dr);if(e)return{config:e.config,sourceContent:e.content,sourcePath:e.path};for(const t of Bc){const u=await ar(t);if(u)return{config:u.config,sourceContent:u.content,sourcePath:u.path}}return{config:Object.create(null)}},Mc=(e,t)=>{const u=Yt[e];if(!(!u||u.length===0))for(const n of u){const D=te(t[n]);if(D!==void 0)return D}},Ae=e=>{for(const[t,u]of Object.entries(Yt)){if(te(e[t])===void 0)for(const n of u){const D=te(e[n]);if(D!==void 0){e[t]=D;break}}for(const n of u)delete e[n]}},Ic=(e,t,u)=>{if(!t)return;const{profiles:n}=e;if(!we(n))return;const D=n[t];if(we(D))return te(D[u])},lr=e=>{const t=e.trim();return nr(Be,t)?t:wc[t]},Xt=async(e,t)=>{const{config:u,sourceContent:n,sourcePath:D}=await cr(),o=D===Z;Ae(u),o&&D?await ir(u,D,n):await Jt({backupConfig:async()=>Zt(D,n),config:u,configDirectoryPath:Z,normalizeLegacyConfigKeys:Ae,writeConfig:ve});const r={},i=e?.profile??te(u.profile);let s="";try{s=Be.profile(i)}catch{if(!t)throw new m("Invalid config property profile: Must be a string")}for(const a of Object.keys(Be)){const d=Be[a],F=bc(a,e?.[a]??(a==="profile"?void 0:Ic(u,s,a))??te(u[a])??Mc(a,u));if(t)try{r[a]=d(F)}catch{}else r[a]=d(F)}const c=r["message-path"]||"message.md",f=r["post-response-script"]||"",l=await qa({configDirectoryPath:Z,messagePathValue:c,postResponseScriptValue:f,suppressErrors:t});return{...r,configDirectoryPath:Z,...l}},Oc=async e=>{const{config:t,sourceContent:u,sourcePath:n}=await cr(),D=n===Z;Ae(t),D&&n?await ir(t,n,u):await Jt({backupConfig:async()=>Zt(n,u),config:t,configDirectoryPath:Z,normalizeLegacyConfigKeys:Ae,writeConfig:ve});for(const[o,r]of e){const i=dc(o);if(i)throw new m(i);const s=lr(o);if(!s)throw new m(`Invalid config property: ${o}`);const c=Be[s](r);t[s]=c;const f=Yt[s]||[];for(const l of f)delete t[l]}await ve(t)};var Qt={},eu={exports:{}},$e={exports:{}},tu,fr;function Tc(){if(fr)return tu;fr=1;var e=1e3,t=e*60,u=t*60,n=u*24,D=n*7,o=n*365.25;tu=function(f,l){l=l||{};var a=typeof f;if(a==="string"&&f.length>0)return r(f);if(a==="number"&&isFinite(f))return l.long?s(f):i(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function r(f){if(f=String(f),!(f.length>100)){var l=/^(-?(?:\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(l){var a=parseFloat(l[1]),d=(l[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return a*o;case"weeks":case"week":case"w":return a*D;case"days":case"day":case"d":return a*n;case"hours":case"hour":case"hrs":case"hr":case"h":return a*u;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}function i(f){var l=Math.abs(f);return l>=n?Math.round(f/n)+"d":l>=u?Math.round(f/u)+"h":l>=t?Math.round(f/t)+"m":l>=e?Math.round(f/e)+"s":f+"ms"}function s(f){var l=Math.abs(f);return l>=n?c(f,l,n,"day"):l>=u?c(f,l,u,"hour"):l>=t?c(f,l,t,"minute"):l>=e?c(f,l,e,"second"):f+" ms"}function c(f,l,a,d){var F=l>=a*1.5;return Math.round(f/a)+" "+d+(F?"s":"")}return tu}var uu,dr;function Fr(){if(dr)return uu;dr=1;function e(t){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=s,n.humanize=Tc(),n.destroy=f,Object.keys(t).forEach(l=>{n[l]=t[l]}),n.names=[],n.skips=[],n.formatters={};function u(l){let a=0;for(let d=0;d<l.length;d++)a=(a<<5)-a+l.charCodeAt(d),a|=0;return n.colors[Math.abs(a)%n.colors.length]}n.selectColor=u;function n(l){let a,d=null,F,h;function p(...C){if(!p.enabled)return;const b=p,v=Number(new Date),M=v-(a||v);b.diff=M,b.prev=a,b.curr=v,a=v,C[0]=n.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let O=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(E,w)=>{if(E==="%%")return"%";O++;const I=n.formatters[w];if(typeof I=="function"){const B=C[O];E=I.call(b,B),C.splice(O,1),O--}return E}),n.formatArgs.call(b,C),(b.log||n.log).apply(b,C)}return p.namespace=l,p.useColors=n.useColors(),p.color=n.selectColor(l),p.extend=D,p.destroy=n.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(F!==n.namespaces&&(F=n.namespaces,h=n.enabled(l)),h),set:C=>{d=C}}),typeof n.init=="function"&&n.init(p),p}function D(l,a){const d=n(this.namespace+(typeof a>"u"?":":a)+l);return d.log=this.log,d}function o(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];const a=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const d of a)d[0]==="-"?n.skips.push(d.slice(1)):n.names.push(d)}function r(l,a){let d=0,F=0,h=-1,p=0;for(;d<l.length;)if(F<a.length&&(a[F]===l[d]||a[F]==="*"))a[F]==="*"?(h=F,p=d,F++):(d++,F++);else if(h!==-1)F=h+1,p++,d=p;else return!1;for(;F<a.length&&a[F]==="*";)F++;return F===a.length}function i(){const l=[...n.names,...n.skips.map(a=>"-"+a)].join(",");return n.enable(""),l}function s(l){for(const a of n.skips)if(r(l,a))return!1;for(const a of n.names)if(r(l,a))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}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 n.enable(n.load()),n}return uu=e,uu}$e.exports;var pr;function Pc(){return pr||(pr=1,function(e,t){t.formatArgs=n,t.save=D,t.load=o,t.useColors=u,t.storage=r(),t.destroy=(()=>{let s=!1;return()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function u(){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 s;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&&(s=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(s[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;s.splice(1,0,c,"color: inherit");let f=0,l=0;s[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(f++,a==="%c"&&(l=f))}),s.splice(l,0,c)}t.log=console.debug||console.log||(()=>{});function D(s){try{s?t.storage.setItem("debug",s):t.storage.removeItem("debug")}catch{}}function o(){let s;try{s=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!s&&typeof process<"u"&&"env"in process&&(s=process.env.DEBUG),s}function r(){try{return localStorage}catch{}}e.exports=Fr()(t);const{formatters:i}=e.exports;i.j=function(s){try{return JSON.stringify(s)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}($e,$e.exports)),$e.exports}var xe={exports:{}},nu,Cr;function Rc(){return Cr||(Cr=1,nu=(e,t=process.argv)=>{const u=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(u+e),D=t.indexOf("--");return n!==-1&&(D===-1||n<D)}),nu}var ru,mr;function _c(){if(mr)return ru;mr=1;const e=Oe,t=Dt,u=Rc(),{env:n}=process;let D;u("no-color")||u("no-colors")||u("color=false")||u("color=never")?D=0:(u("color")||u("colors")||u("color=true")||u("color=always"))&&(D=1),"FORCE_COLOR"in n&&(n.FORCE_COLOR==="true"?D=1:n.FORCE_COLOR==="false"?D=0:D=n.FORCE_COLOR.length===0?1:Math.min(parseInt(n.FORCE_COLOR,10),3));function o(s){return s===0?!1:{level:s,hasBasic:!0,has256:s>=2,has16m:s>=3}}function r(s,c){if(D===0)return 0;if(u("color=16m")||u("color=full")||u("color=truecolor"))return 3;if(u("color=256"))return 2;if(s&&!c&&D===void 0)return 0;const f=D||0;if(n.TERM==="dumb")return f;if(process.platform==="win32"){const l=e.release().split(".");return Number(l[0])>=10&&Number(l[2])>=10586?Number(l[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(l=>l in n)||n.CI_NAME==="codeship"?1:f;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if(n.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in n){const l=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return l>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:f}function i(s){const c=r(s,s&&s.isTTY);return o(c)}return ru={supportsColor:i,stdout:o(r(!0,t.isatty(1))),stderr:o(r(!0,t.isatty(2)))},ru}xe.exports;var hr;function jc(){return hr||(hr=1,function(e,t){const u=Dt,n=yu;t.init=f,t.log=i,t.formatArgs=o,t.save=s,t.load=c,t.useColors=D,t.destroy=n.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const a=_c();a&&(a.stderr||a).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(a=>/^debug_/i.test(a)).reduce((a,d)=>{const F=d.substring(6).toLowerCase().replace(/_([a-z])/g,(p,C)=>C.toUpperCase());let h=process.env[d];return/^(yes|on|true|enabled)$/i.test(h)?h=!0:/^(no|off|false|disabled)$/i.test(h)?h=!1:h==="null"?h=null:h=Number(h),a[F]=h,a},{});function D(){return"colors"in t.inspectOpts?!!t.inspectOpts.colors:u.isatty(process.stderr.fd)}function o(a){const{namespace:d,useColors:F}=this;if(F){const h=this.color,p="\x1B[3"+(h<8?h:"8;5;"+h),C=` ${p};1m${d} \x1B[0m`;a[0]=C+a[0].split(`
76
79
  `).join(`
77
- `+h),a.push(C+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else a[0]=D()+d+" "+a[0]}function D(){return t.inspectOpts.hideDate?"":new Date().toISOString()+" "}function i(...a){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...a)+`
78
- `)}function s(a){a?process.env.DEBUG=a:delete process.env.DEBUG}function c(){return process.env.DEBUG}function f(a){a.inspectOpts={};const d=Object.keys(t.inspectOpts);for(let F=0;F<d.length;F++)a.inspectOpts[d[F]]=t.inspectOpts[d[F]]}e.exports=cD()(t);const{formatters:l}=e.exports;l.o=function(a){return this.inspectOpts.colors=this.useColors,n.inspect(a,this.inspectOpts).split(`
79
- `).map(d=>d.trim()).join(" ")},l.O=function(a){return this.inspectOpts.colors=this.useColors,n.inspect(a,this.inspectOpts)}}(ve,ve.exports)),ve.exports}typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Zt.exports=hc():Zt.exports=yc();var uu=Zt.exports,nu={};Object.defineProperty(nu,"__esModule",{value:!0});function Bc(e){return function(t,u){return new Promise((n,r)=>{e.call(this,t,u,(o,D)=>{o?r(o):n(D)})})}}nu.default=Bc;var pD=T&&T.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const bc=pu,wc=pD(uu),Ac=pD(nu),$e=wc.default("agent-base");function vc(e){return!!e&&typeof e.addRequest=="function"}function Du(){const{stack:e}=new Error;return typeof e!="string"?!1:e.split(`
80
- `).some(t=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function Ve(e,t){return new Ve.Agent(e,t)}(function(e){class t extends bc.EventEmitter{constructor(n,r){super();let o=r;typeof n=="function"?this.callback=n:n&&(o=n),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:Du()?443:80}set defaultPort(n){this.explicitDefaultPort=n}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:Du()?"https:":"http:"}set protocol(n){this.explicitProtocol=n}callback(n,r,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(n,r){const o=Object.assign({},r);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=Du()),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,n._last=!0,n.shouldKeepAlive=!1;let D=!1,i=null;const s=o.timeout||this.timeout,c=d=>{n._hadError||(n.emit("error",d),n._hadError=!0)},f=()=>{i=null,D=!0;const d=new Error(`A "socket" was not created for HTTP request before ${s}ms`);d.code="ETIMEOUT",c(d)},l=d=>{D||(i!==null&&(clearTimeout(i),i=null),c(d))},a=d=>{if(D)return;if(i!=null&&(clearTimeout(i),i=null),vc(d)){$e("Callback returned another Agent instance %o",d.constructor.name),d.addRequest(n,o);return}if(d){d.once("free",()=>{this.freeSocket(d,o)}),n.onSocket(d);return}const F=new Error(`no Duplex stream was returned to agent-base for \`${n.method} ${n.path}\``);c(F)};if(typeof this.callback!="function"){c(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?($e("Converting legacy callback function to promise"),this.promisifiedCallback=Ac.default(this.callback)):this.promisifiedCallback=this.callback),typeof s=="number"&&s>0&&(i=setTimeout(f,s)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{$e("Resolving socket for %o request: %o",o.protocol,`${n.method} ${n.path}`),Promise.resolve(this.promisifiedCallback(n,o)).then(a,l)}catch(d){Promise.reject(d).catch(l)}}freeSocket(n,r){$e("Freeing socket %o %o",n.constructor.name,r),n.destroy()}destroy(){$e("Destroying agent %o",this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype})(Ve||(Ve={}));var $c=Ve,ru={},xc=T&&T.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ru,"__esModule",{value:!0});const Sc=xc(uu),xe=Sc.default("https-proxy-agent:parse-proxy-response");function Oc(e){return new Promise((t,u)=>{let n=0;const r=[];function o(){const l=e.read();l?f(l):e.once("readable",o)}function D(){e.removeListener("end",s),e.removeListener("error",c),e.removeListener("close",i),e.removeListener("readable",o)}function i(l){xe("onclose had error %o",l)}function s(){xe("onend")}function c(l){D(),xe("onerror %o",l),u(l)}function f(l){r.push(l),n+=l.length;const a=Buffer.concat(r,n);if(a.indexOf(`\r
80
+ `+C),a.push(p+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else a[0]=r()+d+" "+a[0]}function r(){return t.inspectOpts.hideDate?"":new Date().toISOString()+" "}function i(...a){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...a)+`
81
+ `)}function s(a){a?process.env.DEBUG=a:delete process.env.DEBUG}function c(){return process.env.DEBUG}function f(a){a.inspectOpts={};const d=Object.keys(t.inspectOpts);for(let F=0;F<d.length;F++)a.inspectOpts[d[F]]=t.inspectOpts[d[F]]}e.exports=Fr()(t);const{formatters:l}=e.exports;l.o=function(a){return this.inspectOpts.colors=this.useColors,n.inspect(a,this.inspectOpts).split(`
82
+ `).map(d=>d.trim()).join(" ")},l.O=function(a){return this.inspectOpts.colors=this.useColors,n.inspect(a,this.inspectOpts)}}(xe,xe.exports)),xe.exports}typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?eu.exports=Pc():eu.exports=jc();var Du=eu.exports,ou={};Object.defineProperty(ou,"__esModule",{value:!0});function Nc(e){return function(t,u){return new Promise((n,D)=>{e.call(this,t,u,(o,r)=>{o?D(o):n(r)})})}}ou.default=Nc;var gr=_&&_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const Lc=Eu,Gc=gr(Du),Wc=gr(ou),Se=Gc.default("agent-base");function zc(e){return!!e&&typeof e.addRequest=="function"}function su(){const{stack:e}=new Error;return typeof e!="string"?!1:e.split(`
83
+ `).some(t=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function Xe(e,t){return new Xe.Agent(e,t)}(function(e){class t extends Lc.EventEmitter{constructor(n,D){super();let o=D;typeof n=="function"?this.callback=n:n&&(o=n),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:su()?443:80}set defaultPort(n){this.explicitDefaultPort=n}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:su()?"https:":"http:"}set protocol(n){this.explicitProtocol=n}callback(n,D,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(n,D){const o=Object.assign({},D);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=su()),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,n._last=!0,n.shouldKeepAlive=!1;let r=!1,i=null;const s=o.timeout||this.timeout,c=d=>{n._hadError||(n.emit("error",d),n._hadError=!0)},f=()=>{i=null,r=!0;const d=new Error(`A "socket" was not created for HTTP request before ${s}ms`);d.code="ETIMEOUT",c(d)},l=d=>{r||(i!==null&&(clearTimeout(i),i=null),c(d))},a=d=>{if(r)return;if(i!=null&&(clearTimeout(i),i=null),zc(d)){Se("Callback returned another Agent instance %o",d.constructor.name),d.addRequest(n,o);return}if(d){d.once("free",()=>{this.freeSocket(d,o)}),n.onSocket(d);return}const F=new Error(`no Duplex stream was returned to agent-base for \`${n.method} ${n.path}\``);c(F)};if(typeof this.callback!="function"){c(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(Se("Converting legacy callback function to promise"),this.promisifiedCallback=Wc.default(this.callback)):this.promisifiedCallback=this.callback),typeof s=="number"&&s>0&&(i=setTimeout(f,s)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{Se("Resolving socket for %o request: %o",o.protocol,`${n.method} ${n.path}`),Promise.resolve(this.promisifiedCallback(n,o)).then(a,l)}catch(d){Promise.reject(d).catch(l)}}freeSocket(n,D){Se("Freeing socket %o %o",n.constructor.name,D),n.destroy()}destroy(){Se("Destroying agent %o",this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype})(Xe||(Xe={}));var Uc=Xe,iu={},qc=_&&_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(iu,"__esModule",{value:!0});const Hc=qc(Du),ke=Hc.default("https-proxy-agent:parse-proxy-response");function Vc(e){return new Promise((t,u)=>{let n=0;const D=[];function o(){const l=e.read();l?f(l):e.once("readable",o)}function r(){e.removeListener("end",s),e.removeListener("error",c),e.removeListener("close",i),e.removeListener("readable",o)}function i(l){ke("onclose had error %o",l)}function s(){ke("onend")}function c(l){r(),ke("onerror %o",l),u(l)}function f(l){D.push(l),n+=l.length;const a=Buffer.concat(D,n);if(a.indexOf(`\r
81
84
  \r
82
- `)===-1){xe("have not received end of HTTP headers yet..."),o();return}const F=a.toString("ascii",0,a.indexOf(`\r
83
- `)),p=+F.split(" ")[1];xe("got proxy server response: %o",F),t({statusCode:p,buffered:a})}e.on("error",c),e.on("close",i),e.on("end",s),o()})}ru.default=Oc;var Ic=T&&T.__awaiter||function(e,t,u,n){function r(o){return o instanceof u?o:new u(function(D){D(o)})}return new(u||(u=Promise))(function(o,D){function i(f){try{c(n.next(f))}catch(l){D(l)}}function s(f){try{c(n.throw(f))}catch(l){D(l)}}function c(f){f.done?o(f.value):r(f.value).then(i,s)}c((n=n.apply(e,t||[])).next())})},ce=T&&T.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yt,"__esModule",{value:!0});const CD=ce(KD),mD=ce(VD),Mc=ce(JD),kc=ce(Fu),Tc=ce(uu),Pc=$c,Rc=ce(ru),Se=Tc.default("https-proxy-agent:agent");class _c extends Pc.Agent{constructor(t){let u;if(typeof t=="string"?u=Mc.default.parse(t):u=t,!u)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Se("creating new HttpsProxyAgent instance: %o",u),super(u);const n=Object.assign({},u);this.secureProxy=u.secureProxy||Lc(n.protocol),n.host=n.hostname||n.host,typeof n.port=="string"&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in n)&&(n.ALPNProtocols=["http 1.1"]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(t,u){return Ic(this,void 0,void 0,function*(){const{proxy:n,secureProxy:r}=this;let o;r?(Se("Creating `tls.Socket`: %o",n),o=mD.default.connect(n)):(Se("Creating `net.Socket`: %o",n),o=CD.default.connect(n));const D=Object.assign({},n.headers);let s=`CONNECT ${`${u.host}:${u.port}`} HTTP/1.1\r
84
- `;n.auth&&(D["Proxy-Authorization"]=`Basic ${Buffer.from(n.auth).toString("base64")}`);let{host:c,port:f,secureEndpoint:l}=u;Nc(f,l)||(c+=`:${f}`),D.Host=c,D.Connection="close";for(const C of Object.keys(D))s+=`${C}: ${D[C]}\r
85
- `;const a=Rc.default(o);o.write(`${s}\r
86
- `);const{statusCode:d,buffered:F}=yield a;if(d===200){if(t.once("socket",jc),u.secureEndpoint){Se("Upgrading socket connection to TLS");const C=u.servername||u.host;return mD.default.connect(Object.assign(Object.assign({},Gc(u,"host","hostname","path","port")),{socket:o,servername:C}))}return o}o.destroy();const p=new CD.default.Socket({writable:!1});return p.readable=!0,t.once("socket",C=>{Se("replaying proxy buffer for failed request"),kc.default(C.listenerCount("data")>0),C.push(F),C.push(null)}),p})}}Yt.default=_c;function jc(e){e.resume()}function Nc(e,t){return!!(!t&&e===80||t&&e===443)}function Lc(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function Gc(e,...t){const u={};let n;for(n in e)t.includes(n)||(u[n]=e[n]);return u}var zc=T&&T.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const ou=zc(Yt);function su(e){return new ou.default(e)}(function(e){e.HttpsProxyAgent=ou.default,e.prototype=ou.default.prototype})(su||(su={}));var Wc=su,Uc=De(Wc);const qc=e=>{if(!e||e.length===0)return"";const t=e.map(r=>r.trim()).filter(Boolean);if(t.length===0)return"";const u=t.slice(0,12),n=t.length-u.length;return["Changed files:",...u.map(r=>`- ${r}`),...n>0?[`- ...and ${n} more file(s)`]:[]].join(`
87
- `)},Hc=e=>["Generate a git commit message for the provided code diff.","The output will be passed directly into git commit.","Return ONLY the final commit message text.","Do not add explanations, quotes, markdown fences, or surrounding commentary.","You may use the changed file list as supporting context, but the diff is the source of truth.",...e.diffWasCompacted?["The diff may be compacted to fit the model context. Infer the dominant outcome from the available patches without pretending to have seen omitted content."]:[],qc(e.changedFiles),"Markdown instructions:",e.messageInstructionsMarkdown.trim()].filter(Boolean).join(`
85
+ `)===-1){ke("have not received end of HTTP headers yet..."),o();return}const F=a.toString("ascii",0,a.indexOf(`\r
86
+ `)),h=+F.split(" ")[1];ke("got proxy server response: %o",F),t({statusCode:h,buffered:a})}e.on("error",c),e.on("close",i),e.on("end",s),o()})}iu.default=Vc;var Kc=_&&_.__awaiter||function(e,t,u,n){function D(o){return o instanceof u?o:new u(function(r){r(o)})}return new(u||(u=Promise))(function(o,r){function i(f){try{c(n.next(f))}catch(l){r(l)}}function s(f){try{c(n.throw(f))}catch(l){r(l)}}function c(f){f.done?o(f.value):D(f.value).then(i,s)}c((n=n.apply(e,t||[])).next())})},de=_&&_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qt,"__esModule",{value:!0});const Er=de(rD),yr=de(DD),Jc=de(oD),Yc=de(gu),Zc=de(Du),Xc=Uc,Qc=de(iu),Me=Zc.default("https-proxy-agent:agent");class el extends Xc.Agent{constructor(t){let u;if(typeof t=="string"?u=Jc.default.parse(t):u=t,!u)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Me("creating new HttpsProxyAgent instance: %o",u),super(u);const n=Object.assign({},u);this.secureProxy=u.secureProxy||nl(n.protocol),n.host=n.hostname||n.host,typeof n.port=="string"&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in n)&&(n.ALPNProtocols=["http 1.1"]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(t,u){return Kc(this,void 0,void 0,function*(){const{proxy:n,secureProxy:D}=this;let o;D?(Me("Creating `tls.Socket`: %o",n),o=yr.default.connect(n)):(Me("Creating `net.Socket`: %o",n),o=Er.default.connect(n));const r=Object.assign({},n.headers);let s=`CONNECT ${`${u.host}:${u.port}`} HTTP/1.1\r
87
+ `;n.auth&&(r["Proxy-Authorization"]=`Basic ${Buffer.from(n.auth).toString("base64")}`);let{host:c,port:f,secureEndpoint:l}=u;ul(f,l)||(c+=`:${f}`),r.Host=c,r.Connection="close";for(const p of Object.keys(r))s+=`${p}: ${r[p]}\r
88
+ `;const a=Qc.default(o);o.write(`${s}\r
89
+ `);const{statusCode:d,buffered:F}=yield a;if(d===200){if(t.once("socket",tl),u.secureEndpoint){Me("Upgrading socket connection to TLS");const p=u.servername||u.host;return yr.default.connect(Object.assign(Object.assign({},rl(u,"host","hostname","path","port")),{socket:o,servername:p}))}return o}o.destroy();const h=new Er.default.Socket({writable:!1});return h.readable=!0,t.once("socket",p=>{Me("replaying proxy buffer for failed request"),Yc.default(p.listenerCount("data")>0),p.push(F),p.push(null)}),h})}}Qt.default=el;function tl(e){e.resume()}function ul(e,t){return!!(!t&&e===80||t&&e===443)}function nl(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function rl(e,...t){const u={};let n;for(n in e)t.includes(n)||(u[n]=e[n]);return u}var Dl=_&&_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const au=Dl(Qt);function cu(e){return new au.default(e)}(function(e){e.HttpsProxyAgent=au.default,e.prototype=au.default.prototype})(cu||(cu={}));var ol=cu,sl=se(ol);const il=e=>{if(!e||e.length===0)return"";const t=e.map(D=>D.trim()).filter(Boolean);if(t.length===0)return"";const u=t.slice(0,12),n=t.length-u.length;return["Changed files:",...u.map(D=>`- ${D}`),...n>0?[`- ...and ${n} more file(s)`]:[]].join(`
90
+ `)},br=e=>{const t=(e.rewriteFeedbackHistory??[]).map(n=>n.trim()).filter(Boolean);if(t.length>0)return t;const u=e.rewriteFeedback?.trim();return u?[u]:[]},al=e=>["Generate a git commit message for the provided code diff.","The output will be passed directly into git commit.","Return ONLY the final commit message text.","Do not add explanations, quotes, markdown fences, or surrounding commentary.","You may use the changed file list as supporting context, but the diff is the source of truth.",...e.diffWasCompacted?["The diff may be compacted to fit the model context. Infer the dominant outcome from the available patches without pretending to have seen omitted content."]:[],il(e.changedFiles),...(e.rewriteConversation??[]).length>0?["This may be a revision request with prior assistant drafts and user feedback included in the conversation input.","Treat the conversation turns as the canonical rewrite history. Preserve prior accepted constraints unless a later user turn changes them.","Revise the latest assistant draft instead of drafting a completely new message from scratch."]:[],...e.rewriteFromMessage?.trim()&&br(e).length>0?["You already suggested a commit message and now need to revise it.",["Current suggested commit message:",e.rewriteFromMessage.trim()].join(`
91
+ `),["User rewrite feedback history:",...br(e).map((t,u)=>`${u+1}. ${t}`)].join(`
92
+ `),"For this revision, treat the user rewrite feedback as higher priority than the earlier style or formatting preferences.","Revise the existing commit message instead of drafting a completely new one from scratch. Preserve any parts that still fit the diff unless the feedback requires changing them.","Rewrite the commit message to address the feedback while staying faithful to the diff. If the feedback conflicts with the diff, prefer the diff and revise as closely as possible."]:[],"Markdown instructions:",e.messageInstructionsMarkdown.trim()].filter(Boolean).join(`
93
+
94
+ `),cl="<think>",ll="</think>",Qe=()=>({carry:"",inReasoningBlock:!1}),fl=(e,t)=>{const u=Math.min(e.length,t.length-1);for(let n=u;n>0;n-=1)if(t.startsWith(e.slice(-n)))return n;return 0},lu=(e,t)=>{let u=`${t.carry}${e}`;const n={carry:"",inReasoningBlock:t.inReasoningBlock};let D="",o="";for(;u.length>0;){const r=n.inReasoningBlock?ll:cl,i=u.indexOf(r);if(i===-1){const c=fl(u,r),f=u.slice(0,u.length-c);n.inReasoningBlock?o+=f:D+=f,n.carry=u.slice(u.length-c);break}const s=u.slice(0,i);n.inReasoningBlock?o+=s:D+=s,n.inReasoningBlock=!n.inReasoningBlock,u=u.slice(i+r.length)}return{content:D,reasoning:o,state:n}},wr=e=>({content:e.inReasoningBlock?"":e.carry,reasoning:e.inReasoningBlock?e.carry:"",state:Qe()}),dl=e=>{let t=Qe(),u="",n="";for(const o of e){const r=lu(o,t);u+=r.content,n+=r.reasoning,t=r.state}const D=wr(t);return u+=D.content,n+=D.reasoning,{content:u,reasoning:n}},Fl=e=>dl([e]).content,Br=async(e,t,u,n,D,o,r,i)=>new Promise((s,c)=>{const f=JSON.stringify(n),l={port:r??443,hostname:e,path:t,method:"POST",headers:{...u,"Content-Type":"application/json","Content-Length":Buffer.byteLength(f)},timeout:D,agent:o?sl(o):void 0},a=nD.request(l,d=>{const F=[];d.on("data",h=>{F.push(h),i?.(h.toString())}),d.on("end",()=>{s({request:a,response:d,data:Buffer.concat(F).toString()})})});a.on("error",c),a.on("timeout",()=>{a.destroy(),c(new m(`Time out error: request took over ${D}ms. Try increasing the \`timeout\` config, or checking your API provider status.`))}),a.write(f),a.end()}),vr=(e,t)=>{if(!e?.trim())throw new m("Please set your API base URL via `aicommits config set base-url=<https://...>`");const u=e.trim(),n=new URL(u),D=n.pathname.replace(/\/+$/,"");return{hostname:n.hostname,port:n.port?Number(n.port):443,path:`${D}${t}`}},pl=e=>vr(e,"/chat/completions"),Cl=e=>vr(e,"/responses"),ml=async(e,t,u,n,D,o,r)=>{const i={...t,...r,stream:!0};let s="";const c=new Map,f=g=>{if(!o)return;const E=Array.isArray(g.choices)?g.choices:[];for(const w of E){if(typeof w!="object"||w===null)continue;const{delta:I}=w;if(typeof I!="object"||I===null)continue;const B=I,$=typeof B.reasoning_content=="string"?B.reasoning_content:typeof B.reasoning=="string"?B.reasoning:"";if($&&o({kind:"reasoning",text:$}),typeof B.content=="string"&&B.content.length>0){const H=typeof w.index=="number"?w.index:0;if($){o({kind:"content",text:B.content});continue}const V=c.get(H)||Qe(),P=lu(B.content,V);c.set(H,P.state),P.reasoning&&o({kind:"reasoning",text:P.reasoning}),P.content&&o({kind:"content",text:P.content})}}},l=g=>{if(!o)return;s+=g.replace(/\r\n/g,`
95
+ `);let E=s.indexOf(`
88
96
 
89
- `),Kc="<think>",Vc="</think>",Je=()=>({carry:"",inReasoningBlock:!1}),Jc=(e,t)=>{const u=Math.min(e.length,t.length-1);for(let n=u;n>0;n-=1)if(t.startsWith(e.slice(-n)))return n;return 0},iu=(e,t)=>{let u=`${t.carry}${e}`;const n={carry:"",inReasoningBlock:t.inReasoningBlock};let r="",o="";for(;u.length>0;){const D=n.inReasoningBlock?Vc:Kc,i=u.indexOf(D);if(i===-1){const c=Jc(u,D),f=u.slice(0,u.length-c);n.inReasoningBlock?o+=f:r+=f,n.carry=u.slice(u.length-c);break}const s=u.slice(0,i);n.inReasoningBlock?o+=s:r+=s,n.inReasoningBlock=!n.inReasoningBlock,u=u.slice(i+D.length)}return{content:r,reasoning:o,state:n}},hD=e=>({content:e.inReasoningBlock?"":e.carry,reasoning:e.inReasoningBlock?e.carry:"",state:Je()}),Yc=e=>{let t=Je(),u="",n="";for(const o of e){const D=iu(o,t);u+=D.content,n+=D.reasoning,t=D.state}const r=hD(t);return u+=r.content,n+=r.reasoning,{content:u,reasoning:n}},Zc=e=>Yc([e]).content,gD=async(e,t,u,n,r,o,D,i)=>new Promise((s,c)=>{const f=JSON.stringify(n),l={port:D??443,hostname:e,path:t,method:"POST",headers:{...u,"Content-Type":"application/json","Content-Length":Buffer.byteLength(f)},timeout:r,agent:o?Uc(o):void 0},a=HD.request(l,d=>{const F=[];d.on("data",p=>{F.push(p),i?.(p.toString())}),d.on("end",()=>{s({request:a,response:d,data:Buffer.concat(F).toString()})})});a.on("error",c),a.on("timeout",()=>{a.destroy(),c(new m(`Time out error: request took over ${r}ms. Try increasing the \`timeout\` config, or checking your API provider status.`))}),a.write(f),a.end()}),ED=(e,t)=>{if(!e?.trim())throw new m("Please set your API base URL via `aicommits config set base-url=<https://...>`");const u=e.trim(),n=new URL(u),r=n.pathname.replace(/\/+$/,"");return{hostname:n.hostname,port:n.port?Number(n.port):443,path:`${r}${t}`}},Xc=e=>ED(e,"/chat/completions"),Qc=e=>ED(e,"/responses"),el=async(e,t,u,n,r,o,D)=>{const i={...t,...D,stream:!0};let s="";const c=new Map,f=E=>{if(!o)return;const v=Array.isArray(E.choices)?E.choices:[];for(const B of v){if(typeof B!="object"||B===null)continue;const{delta:x}=B;if(typeof x!="object"||x===null)continue;const g=x,w=typeof g.reasoning_content=="string"?g.reasoning_content:typeof g.reasoning=="string"?g.reasoning:"";if(w&&o({kind:"reasoning",text:w}),typeof g.content=="string"&&g.content.length>0){const Y=typeof B.index=="number"?B.index:0;if(w){o({kind:"content",text:g.content});continue}const le=c.get(Y)||Je(),P=iu(g.content,le);c.set(Y,P.state),P.reasoning&&o({kind:"reasoning",text:P.reasoning}),P.content&&o({kind:"content",text:P.content})}}},l=E=>{if(!o)return;s+=E.replace(/\r\n/g,`
90
- `);let v=s.indexOf(`
97
+ `);for(;E!==-1;){const w=s.slice(0,E);s=s.slice(E+2);for(const I of w.split(`
98
+ `)){const B=I.trim();if(!B.startsWith("data:"))continue;const $=B.slice(5).trim();if(!(!$||$==="[DONE]"))try{const H=JSON.parse($);f(H)}catch{}}E=s.indexOf(`
91
99
 
92
- `);for(;v!==-1;){const B=s.slice(0,v);s=s.slice(v+2);for(const x of B.split(`
93
- `)){const g=x.trim();if(!g.startsWith("data:"))continue;const w=g.slice(5).trim();if(!(!w||w==="[DONE]"))try{const Y=JSON.parse(w);f(Y)}catch{}}v=s.indexOf(`
100
+ `)}},a=pl(D),{response:d,data:F}=await Br(a.hostname,a.path,{Authorization:`Bearer ${e}`},i,u,n,a.port,l);if(!d.statusCode||d.statusCode<200||d.statusCode>299){let g=`API Error: ${d.statusCode} - ${d.statusMessage}`;throw F&&(g+=`
94
101
 
95
- `)}},a=Xc(r),{response:d,data:F}=await gD(a.hostname,a.path,{Authorization:`Bearer ${e}`},i,u,n,a.port,l);if(!d.statusCode||d.statusCode<200||d.statusCode>299){let E=`API Error: ${d.statusCode} - ${d.statusMessage}`;throw F&&(E+=`
102
+ ${F}`),new m(g)}const h=F.trim();if(!h)throw new m("API Error: Empty response body");if(h.startsWith("{")){const g=JSON.parse(h),E=Array.isArray(g.choices)?g.choices:[];return{model:typeof g.model=="string"?g.model:"",choices:E.map((w,I)=>{const B=typeof w=="object"&&w!==null?w:{},$=typeof B.message=="object"&&B.message!==null?B.message:{};return{index:typeof B.index=="number"?B.index:I,finish_reason:typeof B.finish_reason=="string"||B.finish_reason===null?B.finish_reason:void 0,message:{role:typeof $.role=="string"?$.role:"assistant",content:typeof $.content=="string"?$.content:"",...typeof $.reasoning_content=="string"?{reasoning_content:$.reasoning_content}:{}}}})}}const p=[];for(const g of h.split(/\r?\n/)){const E=g.trim();if(!E.startsWith("data:"))continue;const w=E.slice(5).trim();if(!(!w||w==="[DONE]"))try{p.push(JSON.parse(w))}catch{}}if(p.length===0)throw new m("API Error: Unable to parse streamed response");const C=p.find(g=>typeof g.error=="object"&&g.error!==null);if(C?.error&&typeof C.error=="object"&&C.error!==null){const g="message"in C.error&&typeof C.error.message=="string"?C.error.message:JSON.stringify(C.error);throw new m(`API Error: ${g}`)}const b=p.find(g=>typeof g.model=="string")||p[0],v=new Map,M=new Map;for(const g of p){const E=Array.isArray(g.choices)?g.choices:[];for(const w of E){if(typeof w!="object"||w===null)continue;const I=w,B=typeof I.index=="number"?I.index:0,$=v.get(B)||{index:B,contentParts:[],reasoningParts:[]},{delta:H}=I;if(typeof H=="object"&&H!==null){const P=H;if(typeof P.role=="string"&&($.role=P.role),typeof P.content=="string")if(typeof P.reasoning_content=="string"||typeof P.reasoning=="string")$.contentParts.push(P.content);else{const Fe=M.get(B)||Qe(),Q=lu(P.content,Fe);M.set(B,Q.state),Q.content&&$.contentParts.push(Q.content),Q.reasoning&&$.reasoningParts.push(Q.reasoning)}typeof P.reasoning_content=="string"&&$.reasoningParts.push(P.reasoning_content),typeof P.reasoning=="string"&&$.reasoningParts.push(P.reasoning)}const V=I.finish_reason;(typeof V=="string"||V===null)&&($.finishReason=V),v.set(B,$)}}for(const[g,E]of M.entries()){const w=v.get(g);if(!w)continue;const I=wr(E);I.content&&w.contentParts.push(I.content),I.reasoning&&w.reasoningParts.push(I.reasoning)}const O=Array.from(v.values()).sort((g,E)=>g.index-E.index).map(g=>{const E={role:g.role||"assistant",content:g.contentParts.join("")},w=g.reasoningParts.join("");return w&&(E.reasoning_content=w),{index:g.index,finish_reason:g.finishReason??"stop",message:E}});if(O.length===0)throw new m("API Error: Streamed response did not include any choices");return{model:typeof b.model=="string"?b.model:"",choices:O}},hl=(e,t)=>({model:e,messages:t}),Ar=e=>{const t=(e.rewriteFeedbackHistory??[]).map(n=>n.trim()).filter(Boolean);if(t.length>0)return t;const u=e.rewriteFeedback?.trim();return u?[u]:[]},fu=e=>{const t=(e.rewriteConversation??[]).flatMap(D=>{if(!D||D.role!=="assistant"&&D.role!=="user")return[];const o=D.content.trim();return o?[{role:D.role,content:o}]:[]});if(t.length>0)return t;const u=e.rewriteFromMessage?.trim(),n=Ar(e);return!u||n.length===0?[]:[{role:"assistant",content:u},{role:"user",content:gl(n)}]},gl=e=>["Revise your previous commit message instead of drafting a new one from scratch.","Keep the parts of your previous message that still fit the diff unless the feedback requires changing them.","Apply all of the following rewrite feedback, not just the latest item:",...e.map((t,u)=>`${u+1}. ${t}`),"Return only the revised final commit message text."].join(`
96
103
 
97
- ${F}`),new m(E)}const p=F.trim();if(!p)throw new m("API Error: Empty response body");if(p.startsWith("{")){const E=JSON.parse(p),v=Array.isArray(E.choices)?E.choices:[];return{model:typeof E.model=="string"?E.model:"",choices:v.map((B,x)=>{const g=typeof B=="object"&&B!==null?B:{},w=typeof g.message=="object"&&g.message!==null?g.message:{};return{index:typeof g.index=="number"?g.index:x,finish_reason:typeof g.finish_reason=="string"||g.finish_reason===null?g.finish_reason:void 0,message:{role:typeof w.role=="string"?w.role:"assistant",content:typeof w.content=="string"?w.content:"",...typeof w.reasoning_content=="string"?{reasoning_content:w.reasoning_content}:{}}}})}}const C=[];for(const E of p.split(/\r?\n/)){const v=E.trim();if(!v.startsWith("data:"))continue;const B=v.slice(5).trim();if(!(!B||B==="[DONE]"))try{C.push(JSON.parse(B))}catch{}}if(C.length===0)throw new m("API Error: Unable to parse streamed response");const h=C.find(E=>typeof E.error=="object"&&E.error!==null);if(h?.error&&typeof h.error=="object"&&h.error!==null){const E="message"in h.error&&typeof h.error.message=="string"?h.error.message:JSON.stringify(h.error);throw new m(`API Error: ${E}`)}const y=C.find(E=>typeof E.model=="string")||C[0],A=new Map,_=new Map;for(const E of C){const v=Array.isArray(E.choices)?E.choices:[];for(const B of v){if(typeof B!="object"||B===null)continue;const x=B,g=typeof x.index=="number"?x.index:0,w=A.get(g)||{index:g,contentParts:[],reasoningParts:[]},{delta:Y}=x;if(typeof Y=="object"&&Y!==null){const P=Y;if(typeof P.role=="string"&&(w.role=P.role),typeof P.content=="string")if(typeof P.reasoning_content=="string"||typeof P.reasoning=="string")w.contentParts.push(P.content);else{const TD=_.get(g)||Je(),fe=iu(P.content,TD);_.set(g,fe.state),fe.content&&w.contentParts.push(fe.content),fe.reasoning&&w.reasoningParts.push(fe.reasoning)}typeof P.reasoning_content=="string"&&w.reasoningParts.push(P.reasoning_content),typeof P.reasoning=="string"&&w.reasoningParts.push(P.reasoning)}const le=x.finish_reason;(typeof le=="string"||le===null)&&(w.finishReason=le),A.set(g,w)}}for(const[E,v]of _.entries()){const B=A.get(E);if(!B)continue;const x=hD(v);x.content&&B.contentParts.push(x.content),x.reasoning&&B.reasoningParts.push(x.reasoning)}const j=Array.from(A.values()).sort((E,v)=>E.index-v.index).map(E=>{const v={role:E.role||"assistant",content:E.contentParts.join("")},B=E.reasoningParts.join("");return B&&(v.reasoning_content=B),{index:E.index,finish_reason:E.finishReason??"stop",message:v}});if(j.length===0)throw new m("API Error: Streamed response did not include any choices");return{model:typeof y.model=="string"?y.model:"",choices:j}},tl=(e,t)=>({model:e,messages:t}),ul=(e,t,u)=>({model:e,instructions:t,input:u}),yD=e=>Array.isArray(e)?e.flatMap(t=>{if(typeof t!="object"||t===null)return[];const u="text"in t&&typeof t.text=="string"?t.text:"";return u?[u]:[]}).join(""):"",BD=e=>{const t=Array.isArray(e.output)?e.output:[],u=t.filter(r=>r?.type==="message"||r?.role==="assistant").map(r=>yD(r.content)).join(""),n=t.filter(r=>r?.type==="reasoning").map(r=>yD(r.summary)).join("");return{model:typeof e.model=="string"?e.model:"",choices:[{index:0,finish_reason:"stop",message:{role:"assistant",content:u,...n?{reasoning_content:n}:{}}}]}},nl=e=>{const t=e.find(r=>r.type==="response.completed");if(t&&typeof t.response=="object"&&t.response!==null)return BD(t.response);const u=e.filter(r=>typeof r.type=="string"&&r.type.includes("output_text")&&r.type.endsWith(".delta")&&typeof r.delta=="string").map(r=>r.delta).join(""),n=e.filter(r=>typeof r.type=="string"&&r.type.includes("reasoning")&&r.type.endsWith(".delta")&&typeof r.delta=="string").map(r=>r.delta).join("");return{model:"",choices:[{index:0,finish_reason:"stop",message:{role:"assistant",content:u,...n?{reasoning_content:n}:{}}}]}},Dl=async(e,t,u,n,r,o,D)=>{const i={...t,...D,stream:!0};let s="";const c=h=>{if(!(!o||typeof h.type!="string")){if(h.type.includes("reasoning")&&h.type.endsWith(".delta")&&typeof h.delta=="string"){o({kind:"reasoning",text:h.delta});return}h.type.includes("output_text")&&h.type.endsWith(".delta")&&typeof h.delta=="string"&&o({kind:"content",text:h.delta})}},f=h=>{if(!o)return;s+=h.replace(/\r\n/g,`
98
- `);let y=s.indexOf(`
104
+ `),El=(e,t,u)=>{const n=fu(u);return n.length===0?[{role:"system",content:e},{role:"user",content:t}]:[{role:"system",content:e},{role:"user",content:t},...n]},yl=(e,t,u)=>({model:e,instructions:t,input:u}),bl=(e,t)=>{const u=fu(t);return u.length===0?e:[{role:"user",content:e},...u]},$r=e=>Array.isArray(e)?e.flatMap(t=>{if(typeof t!="object"||t===null)return[];const u="text"in t&&typeof t.text=="string"?t.text:"";return u?[u]:[]}).join(""):"",xr=e=>{const t=Array.isArray(e.output)?e.output:[],u=t.filter(D=>D?.type==="message"||D?.role==="assistant").map(D=>$r(D.content)).join(""),n=t.filter(D=>D?.type==="reasoning").map(D=>$r(D.summary)).join("");return{model:typeof e.model=="string"?e.model:"",choices:[{index:0,finish_reason:"stop",message:{role:"assistant",content:u,...n?{reasoning_content:n}:{}}}]}},wl=e=>{const t=e.find(D=>D.type==="response.completed");if(t&&typeof t.response=="object"&&t.response!==null)return xr(t.response);const u=e.filter(D=>typeof D.type=="string"&&D.type.includes("output_text")&&D.type.endsWith(".delta")&&typeof D.delta=="string").map(D=>D.delta).join(""),n=e.filter(D=>typeof D.type=="string"&&D.type.includes("reasoning")&&D.type.endsWith(".delta")&&typeof D.delta=="string").map(D=>D.delta).join("");return{model:"",choices:[{index:0,finish_reason:"stop",message:{role:"assistant",content:u,...n?{reasoning_content:n}:{}}}]}},Bl=async(e,t,u,n,D,o,r)=>{const i={...t,...r,stream:!0};let s="";const c=C=>{if(!(!o||typeof C.type!="string")){if(C.type.includes("reasoning")&&C.type.endsWith(".delta")&&typeof C.delta=="string"){o({kind:"reasoning",text:C.delta});return}C.type.includes("output_text")&&C.type.endsWith(".delta")&&typeof C.delta=="string"&&o({kind:"content",text:C.delta})}},f=C=>{if(!o)return;s+=C.replace(/\r\n/g,`
105
+ `);let b=s.indexOf(`
99
106
 
100
- `);for(;y!==-1;){const A=s.slice(0,y);s=s.slice(y+2);for(const _ of A.split(`
101
- `)){const j=_.trim();if(!j.startsWith("data:"))continue;const E=j.slice(5).trim();if(!(!E||E==="[DONE]"))try{c(JSON.parse(E))}catch{}}y=s.indexOf(`
107
+ `);for(;b!==-1;){const v=s.slice(0,b);s=s.slice(b+2);for(const M of v.split(`
108
+ `)){const O=M.trim();if(!O.startsWith("data:"))continue;const g=O.slice(5).trim();if(!(!g||g==="[DONE]"))try{c(JSON.parse(g))}catch{}}b=s.indexOf(`
102
109
 
103
- `)}},l=Qc(r),{response:a,data:d}=await gD(l.hostname,l.path,{Authorization:`Bearer ${e}`},i,u,n,l.port,f);if(!a.statusCode||a.statusCode<200||a.statusCode>299){let h=`API Error: ${a.statusCode} - ${a.statusMessage}`;throw d&&(h+=`
110
+ `)}},l=Cl(D),{response:a,data:d}=await Br(l.hostname,l.path,{Authorization:`Bearer ${e}`},i,u,n,l.port,f);if(!a.statusCode||a.statusCode<200||a.statusCode>299){let C=`API Error: ${a.statusCode} - ${a.statusMessage}`;throw d&&(C+=`
104
111
 
105
- ${d}`),new m(h)}const F=d.trim();if(!F)throw new m("API Error: Empty response body");if(F.startsWith("{"))return BD(JSON.parse(F));const p=[];for(const h of F.split(/\r?\n/)){const y=h.trim();if(!y.startsWith("data:"))continue;const A=y.slice(5).trim();if(!(!A||A==="[DONE]"))try{p.push(JSON.parse(A))}catch{}}if(p.length===0)throw new m("API Error: Unable to parse streamed response");const C=p.find(h=>h.type==="error"||typeof h.error=="object"&&h.error!==null);if(C){if(typeof C.error=="object"&&C.error!==null){const h="message"in C.error&&typeof C.error.message=="string"?C.error.message:JSON.stringify(C.error);throw new m(`API Error: ${h}`)}if(typeof C.message=="string")throw new m(`API Error: ${C.message}`)}return nl(p)},au=e=>e.replace(/\r\n?/g,`
106
- `),rl=e=>{const t=e.match(/```[\w-]*\n([\s\S]*?)```/);return t?.[1]?t[1].trim():e.replace(/```/g,"").trim()},ol=e=>e.trim().replace(/^title:\s*/i,"").replace(/(\w)\.$/,"$1").replace(/^["'`]|["'`]$/g,""),sl=e=>{const t=au(e).trim();if(!t)return{title:"",body:""};const u=t.split(`
107
- `).map(o=>o.replace(/\s+$/g,""));for(;u[0]?.trim()==="";)u.shift();const n=ol(u.shift()||"");for(;u[0]?.trim()==="";)u.shift();u[0]?.trim().toLowerCase().startsWith("body:")&&(u[0]=u[0].replace(/^body:\s*/i,""));const r=u.join(`
108
- `).trim();return{title:n,body:r}},il=(e,t)=>t?`${e}
112
+ ${d}`),new m(C)}const F=d.trim();if(!F)throw new m("API Error: Empty response body");if(F.startsWith("{"))return xr(JSON.parse(F));const h=[];for(const C of F.split(/\r?\n/)){const b=C.trim();if(!b.startsWith("data:"))continue;const v=b.slice(5).trim();if(!(!v||v==="[DONE]"))try{h.push(JSON.parse(v))}catch{}}if(h.length===0)throw new m("API Error: Unable to parse streamed response");const p=h.find(C=>C.type==="error"||typeof C.error=="object"&&C.error!==null);if(p){if(typeof p.error=="object"&&p.error!==null){const C="message"in p.error&&typeof p.error.message=="string"?p.error.message:JSON.stringify(p.error);throw new m(`API Error: ${C}`)}if(typeof p.message=="string")throw new m(`API Error: ${p.message}`)}return wl(h)},du=e=>e.replace(/\r\n?/g,`
113
+ `),vl=e=>{const t=e.match(/```[\w-]*\n([\s\S]*?)```/);return t?.[1]?t[1].trim():e.replace(/```/g,"").trim()},Al=e=>e.trim().replace(/^title:\s*/i,"").replace(/(\w)\.$/,"$1").replace(/^["'`]|["'`]$/g,""),$l=e=>{const t=du(e).trim();if(!t)return{title:"",body:""};const u=t.split(`
114
+ `).map(o=>o.replace(/\s+$/g,""));for(;u[0]?.trim()==="";)u.shift();const n=Al(u.shift()||"");for(;u[0]?.trim()==="";)u.shift();u[0]?.trim().toLowerCase().startsWith("body:")&&(u[0]=u[0].replace(/^body:\s*/i,""));const D=u.join(`
115
+ `).trim();return{title:n,body:D}},xl=(e,t)=>t?`${e}
109
116
 
110
- ${t}`:e,al=(e,t,u,n)=>{const r=rl(e),{title:o,body:D}=sl(r);if(!o)return"";const i=au(D).split(`
117
+ ${t}`:e,Sl=(e,t,u,n)=>{const D=vl(e),{title:o,body:r}=$l(D);if(!o)return"";const i=du(r).split(`
111
118
  `).map(s=>s.replace(/\s+$/u,"")).join(`
112
- `).trim();return i?il(o,i):o},cl=["none","low","medium","high","xhigh"],Ye=e=>{if(typeof e!="string")return;const t=e.trim().toLowerCase();return cl.includes(t)?t:void 0},ll=(e,t)=>{if(!e?.trim())return{};let u;try{u=JSON.parse(e)}catch{throw new m("Invalid config property request-options: Must be valid JSON")}if(typeof u!="object"||u===null||Array.isArray(u))throw new m("Invalid config property request-options: Must be a JSON object");const n={...u};if(delete n.model,delete n.messages,delete n.input,delete n.instructions,delete n.stream,t==="responses"){const o=Ye(n.reasoning_effort);return o&&(typeof n.reasoning!="object"||n.reasoning===null||Array.isArray(n.reasoning))?n.reasoning={effort:o}:o&&typeof n.reasoning=="object"&&n.reasoning!==null&&!Array.isArray(n.reasoning)&&Ye(n.reasoning.effort)===void 0&&(n.reasoning={...n.reasoning,effort:o}),delete n.reasoning_effort,delete n.max_completion_tokens,n}const r=typeof n.reasoning=="object"&&n.reasoning!==null&&!Array.isArray(n.reasoning)?Ye(n.reasoning.effort):void 0;return r&&Ye(n.reasoning_effort)===void 0&&(n.reasoning_effort=r),delete n.reasoning,delete n.max_output_tokens,n},fl=(e,t,u)=>{const n=ll(e,t);if(!u)return n;if(t==="responses"){const r=typeof n.reasoning=="object"&&n.reasoning!==null&&!Array.isArray(n.reasoning)?n.reasoning:{};return{...n,reasoning:{...r,effort:u}}}return{...n,reasoning_effort:u}},dl=e=>Array.from(new Set(e)),bD=12e4,Fl=1024,pl=3,Cl=900,ml=700,hl=450,gl=.85,Ze="[Diff compacted to fit model context. Each file is represented with abbreviated hunks when needed.]",wD="@@ ... patch content truncated ... @@",El=(e=0)=>{if(!Number.isInteger(e)||e<=0)return bD;const t=Cl+ml+hl,u=Math.floor((e-t)*gl),n=Math.max(128,u);return Math.max(Fl,n*pl)},yl=e=>{const t=/^diff --git .+$/gm,u=Array.from(e.matchAll(t));if(u.length===0)return[e];const n=[],r=u[0]?.index??0;if(r>0){const o=e.slice(0,r).trim();o&&n.push(o)}for(const[o,D]of u.entries()){const i=D.index??0,s=u[o+1]?.index??e.length,c=e.slice(i,s).trim();c&&n.push(c)}return n},AD=(e,t)=>{if(t<=0)return"";if(e.length<=t)return e;const u=wD.length+2;if(t<=u)return e.slice(0,t);const n=t-u,r=Math.floor(n*.7),o=Math.min(60,n),D=Math.min(40,Math.max(0,n-o)),i=Math.max(o,Math.min(r,n-D)),s=n-i;if(s<=0)return e.slice(0,t);const c=e.slice(0,i).trimEnd(),f=e.slice(-s).trimStart();return f?`${c}
113
- ${wD}
114
- ${f}`.slice(0,t):e.slice(0,t)},Bl=(e,t=bD)=>{const u=au(e).trim();if(!u)return u;if(t<=0)return"";const n=Ze.length+2;if(u.length<=t)return u;if(t<=n)return u.slice(0,t);const r=t-n,o=yl(u);if(o.length<=1)return`${AD(u,r)}
119
+ `).trim();return i?xl(o,i):o},kl=["none","low","medium","high","xhigh"],et=e=>{if(typeof e!="string")return;const t=e.trim().toLowerCase();return kl.includes(t)?t:void 0},Ml=(e,t)=>{if(!e?.trim())return{};let u;try{u=JSON.parse(e)}catch{throw new m("Invalid config property request-options: Must be valid JSON")}if(typeof u!="object"||u===null||Array.isArray(u))throw new m("Invalid config property request-options: Must be a JSON object");const n={...u};if(delete n.model,delete n.messages,delete n.input,delete n.instructions,delete n.stream,t==="responses"){const o=et(n.reasoning_effort);return o&&(typeof n.reasoning!="object"||n.reasoning===null||Array.isArray(n.reasoning))?n.reasoning={effort:o}:o&&typeof n.reasoning=="object"&&n.reasoning!==null&&!Array.isArray(n.reasoning)&&et(n.reasoning.effort)===void 0&&(n.reasoning={...n.reasoning,effort:o}),delete n.reasoning_effort,delete n.max_completion_tokens,n}const D=typeof n.reasoning=="object"&&n.reasoning!==null&&!Array.isArray(n.reasoning)?et(n.reasoning.effort):void 0;return D&&et(n.reasoning_effort)===void 0&&(n.reasoning_effort=D),delete n.reasoning,delete n.max_output_tokens,n},Il=(e,t,u)=>{const n=Ml(e,t);if(!u)return n;if(t==="responses"){const D=typeof n.reasoning=="object"&&n.reasoning!==null&&!Array.isArray(n.reasoning)?n.reasoning:{};return{...n,reasoning:{...D,effort:u}}}return{...n,reasoning_effort:u}},Ol=e=>Array.from(new Set(e)),Sr=12e4,Tl=1024,Pl=3,Rl=900,_l=700,jl=450,Nl=.85,tt="[Diff compacted to fit model context. Each file is represented with abbreviated hunks when needed.]",kr="@@ ... patch content truncated ... @@",Ll=(e=0)=>{if(!Number.isInteger(e)||e<=0)return Sr;const t=Rl+_l+jl,u=Math.floor((e-t)*Nl),n=Math.max(128,u);return Math.max(Tl,n*Pl)},Gl=e=>{const t=/^diff --git .+$/gm,u=Array.from(e.matchAll(t));if(u.length===0)return[e];const n=[],D=u[0]?.index??0;if(D>0){const o=e.slice(0,D).trim();o&&n.push(o)}for(const[o,r]of u.entries()){const i=r.index??0,s=u[o+1]?.index??e.length,c=e.slice(i,s).trim();c&&n.push(c)}return n},Mr=(e,t)=>{if(t<=0)return"";if(e.length<=t)return e;const u=kr.length+2;if(t<=u)return e.slice(0,t);const n=t-u,D=Math.floor(n*.7),o=Math.min(60,n),r=Math.min(40,Math.max(0,n-o)),i=Math.max(o,Math.min(D,n-r)),s=n-i;if(s<=0)return e.slice(0,t);const c=e.slice(0,i).trimEnd(),f=e.slice(-s).trimStart();return f?`${c}
120
+ ${kr}
121
+ ${f}`.slice(0,t):e.slice(0,t)},Wl=(e,t=Sr)=>{const u=du(e).trim();if(!u)return u;if(t<=0)return"";const n=tt.length+2;if(u.length<=t)return u;if(t<=n)return u.slice(0,t);const D=t-n,o=Gl(u);if(o.length<=1)return`${Mr(u,D)}
115
122
 
116
- ${Ze}`;const D=`
123
+ ${tt}`;const r=`
117
124
 
118
- `,i=D.length*Math.max(0,o.length-1),s=Math.max(1,r-i),c=Math.max(1,Math.floor(s/o.length));return`${o.map(a=>AD(a,c)).filter(Boolean).join(D)}
125
+ `,i=r.length*Math.max(0,o.length-1),s=Math.max(1,D-i),c=Math.max(1,Math.floor(s/o.length));return`${o.map(a=>Mr(a,c)).filter(Boolean).join(r)}
119
126
 
120
- ${Ze}`},vD=async(e,t,u,n,r,o,D,i)=>{const s=D??{messageInstructionsMarkdown:""},c=s.apiMode??"responses",f=fl(s.requestOptionsJson,c,s.reasoningEffort),l=El(s.contextWindowTokens),a=Bl(u,l),d=a.includes(Ze);try{const F=Hc({messageInstructionsMarkdown:s.messageInstructionsMarkdown||"",changedFiles:s.changedFiles,diffWasCompacted:d}),p=Math.max(1,n),h=(await Promise.all(Array.from({length:p},()=>c==="responses"?Dl(e,ul(t,F,a),r,o,i,y=>s.onStreamEvent?.({phase:"message",...y}),f):el(e,tl(t,[{role:"system",content:F},{role:"user",content:a}]),r,o,i,y=>s.onStreamEvent?.({phase:"message",...y}),f)))).flatMap(y=>y.choices).flatMap(y=>{const A=y.message?.content;if(typeof A!="string")return[];const _=al(Zc(A));return _?[_]:[]});return dl(h)}catch(F){const p=F;throw p.code==="ENOTFOUND"?new m(`Error connecting to ${p.hostname} (${p.syscall}). Are you connected to the internet?`):p}},$D=()=>{const e=["|","/","-","\\"],t=process.stdout.isTTY?120:1e4;let u=0,n="",r=!1,o;const D=Ai("\u2502"),i=c=>{if(!process.stdout.isTTY){process.stdout.write(`${c}
121
- `);return}process.stdout.write(`\r\x1B[2K${c}`)},s=()=>{const c=e[u];i(`${wi("\u25C6")} ${c} ${n}`),u=(u+1)%e.length};return{start(c){if(n=c,r){s();return}if(r=!0,process.stdout.isTTY){process.stdout.write(`${D}
122
- `),s(),o=setInterval(s,t);return}i(n)},update(c){n=c,!(!r||!process.stdout.isTTY)&&s()},stop(c){if(r){if(r=!1,o&&(clearInterval(o),o=void 0),process.stdout.isTTY){const f=c.split(/\r?\n/),l=f.shift()??"";process.stdout.write(`\r\x1B[2K${Ge("\u25C6")} ${l}
123
- `);for(const a of f)process.stdout.write(`${D} ${a}
127
+ ${tt}`},Ir=async(e,t,u,n,D,o,r,i)=>{const s=r??{messageInstructionsMarkdown:""},c=s.apiMode??"responses",f=Il(s.requestOptionsJson,c,s.reasoningEffort),l=Ll(s.contextWindowTokens),a=Wl(u,l),d=a.includes(tt),F=Ar(s),h=fu(s);try{const p=zl({messageInstructionsMarkdown:s.messageInstructionsMarkdown||"",changedFiles:s.changedFiles,diffWasCompacted:d,rewriteFromMessage:s.rewriteFromMessage,rewriteFeedback:s.rewriteFeedback,rewriteFeedbackHistory:F,rewriteConversation:h}),C=Math.max(1,n),v=(await Promise.all(Array.from({length:C},()=>c==="responses"?Bl(e,yl(t,p,bl(a,{rewriteConversation:h,rewriteFromMessage:s.rewriteFromMessage,rewriteFeedback:s.rewriteFeedback,rewriteFeedbackHistory:F})),D,o,i,M=>s.onStreamEvent?.({phase:"message",...M}),f):ml(e,hl(t,El(p,a,{rewriteConversation:h,rewriteFromMessage:s.rewriteFromMessage,rewriteFeedback:s.rewriteFeedback,rewriteFeedbackHistory:F})),D,o,i,M=>s.onStreamEvent?.({phase:"message",...M}),f)))).flatMap(M=>M.choices).flatMap(M=>{const O=M.message?.content;if(typeof O!="string")return[];const g=Sl(Fl(O));return g?[g]:[]});return Ol(v)}catch(p){const C=p;throw C.code==="ENOTFOUND"?new m(`Error connecting to ${C.hostname} (${C.syscall}). Are you connected to the internet?`):C}},zl=e=>al({messageInstructionsMarkdown:e.messageInstructionsMarkdown||"",changedFiles:e.changedFiles,diffWasCompacted:e.diffWasCompacted,rewriteFromMessage:e.rewriteFromMessage,rewriteFeedback:e.rewriteFeedback,rewriteFeedbackHistory:e.rewriteFeedbackHistory,rewriteConversation:e.rewriteConversation}),Or=()=>{const e=["|","/","-","\\"],t=process.stdout.isTTY?120:1e4;let u=0,n="",D=!1,o;const r=Ri("\u2502"),i=c=>{if(!process.stdout.isTTY){process.stdout.write(`${c}
128
+ `);return}process.stdout.write(`\r\x1B[2K${c}`)},s=()=>{const c=e[u];i(`${Pi("\u25C6")} ${c} ${n}`),u=(u+1)%e.length};return{start(c){if(n=c,D){s();return}if(D=!0,process.stdout.isTTY){process.stdout.write(`${r}
129
+ `),s(),o=setInterval(s,t);return}i(n)},update(c){n=c,!(!D||!process.stdout.isTTY)&&s()},stop(c){if(D){if(D=!1,o&&(clearInterval(o),o=void 0),process.stdout.isTTY){const f=c.split(/\r?\n/),l=f.shift()??"";process.stdout.write(`\r\x1B[2K${ye("\u25C6")} ${l}
130
+ `);for(const a of f)process.stdout.write(`${r} ${a}
124
131
  `);return}process.stdout.write(`${c}
125
- `)}}}},bl=e=>e.replace(/\s+$/u,""),xD=async(e,t,u)=>{if(!t)return e;const n=await U(t,[],{cwd:u.cwd,input:e,reject:!1,env:{AICOMMITS_CWD:u.cwd,AICOMMITS_CONFIG_DIR:u.configDirectoryPath,AICOMMITS_MESSAGE_FILE:u.messageFilePath,AICOMMITS_CANDIDATE_INDEX:String(u.candidateIndex),AICOMMITS_CANDIDATE_COUNT:String(u.candidateCount),AICOMMITS_COMMIT_SOURCE:u.commitSource}});if(n.exitCode!==0){const o=n.stderr.trim();throw new m(o?`Post-response script failed: ${o}`:`Post-response script failed with exit code ${n.exitCode}.`)}const r=bl(n.stdout);if(!r)throw new m("Post-response script produced an empty commit message.");return r},wl=e=>{const t=Math.max(0,Math.floor(e/1e3)),u=Math.floor(t/3600),n=Math.floor(t%3600/60),r=t%60;return u>0?`${u}h ${n}m ${r}s`:n>0?`${n}m ${r}s`:`${r}s`},Al=(e,t)=>{const u=Date.now(),n=1e3,r=()=>e.update(`The AI (${t}) is thinking for ${wl(Date.now()-u)}`);r();const o=setInterval(r,n);return()=>clearInterval(o)};var vl=async(e,t,u,n,r,o,D,i,s,c,f)=>(async()=>{fa(vi(bi(" aicommits "))),await Ln();const l=$D();u&&await U("git",["add","--update"]),l.start("Detecting git changes");const a=await ba(t);if(!a)throw l.stop("Detecting git changes"),new m("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");l.stop(`${wa(a.files,a.source)}:
126
- ${a.files.map(g=>` ${g}`).join(`
127
- `)}`);const d=await Jt({generate:e?.toString(),"show-reasoning":n===!0?"true":void 0,"reasoning-effort":r,"api-mode":o,"message-path":D,"post-response-script":i,"base-url":s}),F={messageInstructionsMarkdown:d.messageInstructionsMarkdown,reasoningEffort:d["reasoning-effort"],requestOptionsJson:d["request-options"],apiMode:d["api-mode"],contextWindowTokens:d["context-window"],changedFiles:a.files},p=d["show-reasoning"]===!0,C=$D();C.start(`The AI (${d.model}) is analyzing your changes`);let h,y=!1,A=!0,_=!1,j;const E={message:"Message Generation"},v=g=>{if(!(g.kind!=="reasoning"||!g.text)){if(!p){y||(h=Al(C,d.model),y=!0);return}A&&(C.stop(`The AI (${d.model}) is thinking`),A=!1),_||(process.stdout.write(`${ge(`
128
- The AI (${d.model}) is thinking`)}
129
- `),_=!0),g.phase!==j&&(j=g.phase,process.stdout.write(`${ge(`[${E[g.phase]}]
130
- `)}`)),process.stdout.write(g.text)}};let B;try{B=await vD(d["api-key"],d.model,a.diff,d.generate,d.timeout,d.proxy,{...F,onStreamEvent:v},d["base-url"])}finally{h?.(),A?C.stop("Changes analyzed"):p&&process.stdout.write(`
131
- `)}if(B.length===0)throw new m("No commit messages were generated. Try again.");B=await Promise.all(B.map((g,w)=>xD(g,d.postResponseScriptPath,{candidateCount:B.length,candidateIndex:w,commitSource:"cli",configDirectoryPath:d.configDirectoryPath,cwd:process.cwd(),messageFilePath:d.messageFilePath})));let x;if(c)[x]=B;else try{if(B.length===1){[x]=B;const g=await ca({message:`Use this commit message?
132
-
133
- ${x}
134
- `});if(!g||Mn(g)){He("Commit cancelled");return}}else{const g=await la({message:`Pick a commit message to use: ${ge("(Ctrl+c to exit)")}`,options:B.map(w=>({label:w,value:w}))});if(Mn(g)){He("Commit cancelled");return}x=g}}catch(g){const w=g instanceof Error?g.message:"";throw w.includes("TTY initialization failed")||w.includes("uv_tty_init returned EINVAL")||w.includes("ERR_TTY_INIT_FAILED")?new m("Interactive terminal initialization failed in this environment. Re-run with `--confirm` or `--yes` to skip prompts."):g}a.source==="uncommitted"&&await U("git",["add","--all","--",...a.files]),await U("git",["commit","-m",x,...f]),He(`${Ge("\u2714")} Successfully committed!`)})().catch(l=>{He(`${St("\u2716")} ${l.message}`),Gt(l),process.exit(1)});const $l="prepare-commit-msg-hook",xl=()=>{const e=process.argv.slice(2);return e[0]===$l?e.slice(1):e},Sl=async()=>{const{stdout:e}=await U("git",["rev-parse","--git-path","COMMIT_EDITMSG"],{reject:!1}),t=e.trim();return t===""?void 0:t},Ol=async e=>$.readFile(e,"utf8").catch(t=>{if(t.code==="ENOENT")return"";throw t});var Il=()=>(async()=>{const[e,t]=xl(),u=e?.trim()||await Sl();if(!u)return;const n=await Ol(u);if(t==="message"&&n.trim()!=="")return;const o=await qn();if(!o)return;const D=await Jt({}),i={messageInstructionsMarkdown:D.messageInstructionsMarkdown,reasoningEffort:D["reasoning-effort"],requestOptionsJson:D["request-options"],apiMode:D["api-mode"],contextWindowTokens:D["context-window"],changedFiles:o.files},s=await vD(D["api-key"],D.model,o.diff,D.generate,D.timeout,D.proxy,i,D["base-url"]);if(s.length===0)return;const c=s[0]?.trim();if(!c)return;let f=c;try{f=await xD(c,D.postResponseScriptPath,{candidateCount:1,candidateIndex:0,commitSource:"hook",configDirectoryPath:D.configDirectoryPath,cwd:process.cwd(),messageFilePath:D.messageFilePath})}catch{}const l=`${f}
135
- `;await $.writeFile(u,l),process.stdout.write(l)})().catch(()=>{});const Ml=e=>{const t=e.indexOf("=");if(t<=0)throw new m(`Invalid config assignment: "${e}". Use <key>=<value>.`);return[e.slice(0,t),e.slice(t+1)]};var kl=Nu({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:t,keyValue:u}=e._;if(t==="get"){const n=await Jt({},!0);for(const r of u){const o=sD(r);o&&Qn(n,o)&&console.log(`${o}=${n[o]}`)}return}if(t==="set"){await Cc(u.map(Ml));return}throw new m(`Invalid mode: ${t}`)})().catch(t=>{console.error(`${St("\u2716")} ${t.message}`),Gt(t),process.exit(1)})});const Tl=e=>$.lstat(e).then(()=>!0,()=>!1),cu="prepare-commit-msg",Pl="prepare-commit-msg-hook",Rl=`/hooks/${cu}`,SD=new URL(import.meta.url.endsWith(".ts")?"../cli.ts":"../cli.mjs",import.meta.url),OD=hu(SD),_l=import.meta.url.endsWith(".ts")?new URL("../../node_modules/tsx/dist/cli.mjs",import.meta.url):SD,jl=hu(_l),ID=`
132
+ `)}}}},Ul=e=>e.replace(/\s+$/u,""),Tr=async(e,t,u)=>{if(!t)return e;const n=await U(t,[],{cwd:u.cwd,input:e,reject:!1,env:{AICOMMITS_CWD:u.cwd,AICOMMITS_CONFIG_DIR:u.configDirectoryPath,AICOMMITS_MESSAGE_FILE:u.messageFilePath,AICOMMITS_CANDIDATE_INDEX:String(u.candidateIndex),AICOMMITS_CANDIDATE_COUNT:String(u.candidateCount),AICOMMITS_COMMIT_SOURCE:u.commitSource}});if(n.exitCode!==0){const o=n.stderr.trim();throw new m(o?`Post-response script failed: ${o}`:`Post-response script failed with exit code ${n.exitCode}.`)}const D=Ul(n.stdout);if(!D)throw new m("Post-response script produced an empty commit message.");return D},Pr="\0use-commit-message",ql="\0rewrite-commit-message",ut="\0cancel",Rr="\0back",Hl=async(e,t)=>{const u=await e.text({message:"Tell the AI how to rewrite this commit message:",placeholder:"Example: keep it shorter, mention the scope, and use feat instead of refactor",validate(n){if(n.trim().length===0)return"Rewrite feedback is required."}});return e.isCancel(u)?{status:"cancelled"}:{status:"rewrite",message:t,feedback:u.trim()}},_r=async(e,t,u)=>{const n=await e.select({message:`Review this commit message:
133
+
134
+ ${t}
135
+ `,options:[{label:"Use this commit message",value:Pr},{label:"Ask AI to rewrite it",hint:"Give feedback and regenerate",value:ql},...u?[{label:"Back to suggestions",value:Rr}]:[],{label:"Cancel",value:ut}]});return e.isCancel(n)||n===ut?{status:"cancelled"}:n===Rr?{status:"back"}:n===Pr?{status:"submitted",message:t}:Hl(e,t)},Vl=async(e,t)=>{if(e.length===1){const[n]=e,D=await _r(t,n,!1);return D.status==="back"?{status:"cancelled"}:D}let u=!0;for(;u;){const n=await t.select({message:"Pick a commit message to review:",options:[...e.map(o=>({label:o,value:o})),{label:"Cancel",value:ut}]});if(t.isCancel(n)||n===ut)return{status:"cancelled"};const D=await _r(t,n,!0);if(D.status!=="back")return u=!1,D}return{status:"cancelled"}},Kl=e=>Vl(e,{select:xa,text:$a,isCancel:aa}),Jl=e=>{const t=Math.max(0,Math.floor(e/1e3)),u=Math.floor(t/3600),n=Math.floor(t%3600/60),D=t%60;return u>0?`${u}h ${n}m ${D}s`:n>0?`${n}m ${D}s`:`${D}s`},Yl=(e,t)=>{const u=Date.now(),n=1e3,D=()=>e.update(`The AI (${t}) is thinking for ${Jl(Date.now()-u)}`);D();const o=setInterval(D,n);return()=>clearInterval(o)};var Zl=async(e,t,u,n,D,o,r,i,s,c,f,l)=>(async()=>{Sa(_i(Ti(" aicommits "))),await Un();const a=Or();u&&await U("git",["add","--update"]),a.start("Detecting git changes");const d=await La(t);if(!d)throw a.stop("Detecting git changes"),new m("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");a.stop(`${Ga(d.files,d.source)}:
136
+ ${d.files.map(g=>` ${g}`).join(`
137
+ `)}`);const F=await Xt({generate:e?.toString(),"show-reasoning":n===!0?"true":void 0,"reasoning-effort":D,"api-mode":o,"message-path":r,"post-response-script":i,"base-url":s}),h={messageInstructionsMarkdown:F.messageInstructionsMarkdown,reasoningEffort:F["reasoning-effort"],requestOptionsJson:F["request-options"],apiMode:F["api-mode"],contextWindowTokens:F["context-window"],changedFiles:d.files},p=F["show-reasoning"]===!0,C=async({completions:g=F.generate,rewriteFromMessage:E,rewriteFeedback:w,rewriteFeedbackHistory:I,rewriteConversation:B,statusMessage:$=`The AI (${F.model}) is analyzing your changes`,finishedMessage:H="Changes analyzed"}={})=>{const V=Or();V.start($);let P,rt=!1,Fe=!0,Q=!1,pu;const zr={message:"Message Generation"},Ur=ee=>{if(!(ee.kind!=="reasoning"||!ee.text)){if(!p){rt||(P=Yl(V,F.model),rt=!0);return}Fe&&(V.stop(`The AI (${F.model}) is thinking`),Fe=!1),Q||(process.stdout.write(`${Ue(`
138
+ The AI (${F.model}) is thinking`)}
139
+ `),Q=!0),ee.phase!==pu&&(pu=ee.phase,process.stdout.write(`${Ue(`[${zr[ee.phase]}]
140
+ `)}`)),process.stdout.write(ee.text)}};let Ie;try{Ie=await Ir(F["api-key"],F.model,d.diff,g,F.timeout,F.proxy,{...h,rewriteFromMessage:E,rewriteFeedback:w,rewriteFeedbackHistory:I,rewriteConversation:B,onStreamEvent:Ur},F["base-url"])}finally{P?.(),Fe?V.stop(H):p&&process.stdout.write(`
141
+ `)}if(Ie.length===0)throw new m("No commit messages were generated. Try again.");return Promise.all(Ie.map((ee,qr)=>Tr(ee,F.postResponseScriptPath,{candidateCount:Ie.length,candidateIndex:qr,commitSource:"cli",configDirectoryPath:F.configDirectoryPath,cwd:process.cwd(),messageFilePath:F.messageFilePath})))};let b=await C(),v=[],M=[],O="";if(c)[O]=b;else try{let g=!0;for(;g;){const E=await Kl(b);if(E.status==="cancelled"){Ye("Commit cancelled");return}if(E.status==="submitted"){O=E.message,g=!1;break}v=[...v,E.feedback],M=[...M,{role:"assistant",content:E.message},{role:"user",content:E.feedback}],b=await C({completions:1,rewriteFromMessage:E.message,rewriteFeedback:E.feedback,rewriteFeedbackHistory:v,rewriteConversation:M,statusMessage:`The AI (${F.model}) is revising your commit message`,finishedMessage:"Commit message revised"})}}catch(g){const E=g instanceof Error?g.message:"";throw E.includes("TTY initialization failed")||E.includes("uv_tty_init returned EINVAL")||E.includes("ERR_TTY_INIT_FAILED")?new m("Interactive terminal initialization failed in this environment. Re-run with `--confirm` or `--yes` to skip prompts."):g}if(f){process.stdout.write(`${O}
142
+ `),Ye(`${ye("\u2714")} Commit message printed`);return}d.source==="uncommitted"&&await U("git",["add","--all","--",...d.files]),await U("git",["commit","-m",O,...l]),Ye(`${ye("\u2714")} Successfully committed!`)})().catch(a=>{Ye(`${Pt("\u2716")} ${a.message}`),Ut(a),process.exit(1)});const Xl="prepare-commit-msg-hook",Ql=()=>{const e=process.argv.slice(2);return e[0]===Xl?e.slice(1):e},ef=async()=>{const{stdout:e}=await U("git",["rev-parse","--git-path","COMMIT_EDITMSG"],{reject:!1}),t=e.trim();return t===""?void 0:t},tf=async e=>A.readFile(e,"utf8").catch(t=>{if(t.code==="ENOENT")return"";throw t});var uf=()=>(async()=>{const[e,t]=Ql(),u=e?.trim()||await ef();if(!u)return;const n=await tf(u);if(t==="message"&&n.trim()!=="")return;const o=await Jn();if(!o)return;const r=await Xt({}),i={messageInstructionsMarkdown:r.messageInstructionsMarkdown,reasoningEffort:r["reasoning-effort"],requestOptionsJson:r["request-options"],apiMode:r["api-mode"],contextWindowTokens:r["context-window"],changedFiles:o.files},s=await Ir(r["api-key"],r.model,o.diff,r.generate,r.timeout,r.proxy,i,r["base-url"]);if(s.length===0)return;const c=s[0]?.trim();if(!c)return;let f=c;try{f=await Tr(c,r.postResponseScriptPath,{candidateCount:1,candidateIndex:0,commitSource:"hook",configDirectoryPath:r.configDirectoryPath,cwd:process.cwd(),messageFilePath:r.messageFilePath})}catch{}const l=`${f}
143
+ `;await A.writeFile(u,l),process.stdout.write(l)})().catch(()=>{});const nf=e=>{const t=e.indexOf("=");if(t<=0)throw new m(`Invalid config assignment: "${e}". Use <key>=<value>.`);return[e.slice(0,t),e.slice(t+1)]};var rf=Uu({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:t,keyValue:u}=e._;if(t==="get"){const n=await Xt({},!0);for(const D of u){const o=lr(D);o&&nr(n,o)&&console.log(`${o}=${n[o]}`)}return}if(t==="set"){await Oc(u.map(nf));return}throw new m(`Invalid mode: ${t}`)})().catch(t=>{console.error(`${Pt("\u2716")} ${t.message}`),Ut(t),process.exit(1)})});const Df=e=>A.lstat(e).then(()=>!0,()=>!1),Fu="prepare-commit-msg",of="prepare-commit-msg-hook",sf=`/hooks/${Fu}`,jr=new URL(import.meta.url.endsWith(".ts")?"../cli.ts":"../cli.mjs",import.meta.url),Nr=wu(jr),af=import.meta.url.endsWith(".ts")?new URL("../../node_modules/tsx/dist/cli.mjs",import.meta.url):jr,cf=wu(af),Lr=`
136
144
  #!/usr/bin/env node
137
- process.argv.splice(2, 0, ${JSON.stringify(Pl)});
138
- ${import.meta.url.endsWith(".ts")?`process.argv.splice(2, 0, ${JSON.stringify(OD)});`:""}
139
- import(${JSON.stringify(YD(jl))})
140
- `.trim(),Nl=(process.argv[1]||"").replace(/\\/g,"/").endsWith(Rl),MD=async e=>await $.readFile(e,"utf8").catch(()=>{})===ID,kD=async e=>await $.realpath(e).catch(()=>{})===OD;var Ll=Nu({name:"hook",parameters:["<install/uninstall>"]},e=>{(async()=>{const t=await Ln(),{installUninstall:u}=e._,n=await ma("hooks",t),r=N.join(n,cu),o=await Tl(r);if(u==="install"){if(o){if(await MD(r)){console.warn("The hook is already installed");return}if(await kD(r))await $.rm(r);else throw new m(`A different ${cu} hook seems to be installed. Please remove it before installing aicommits.`)}await $.mkdir(N.dirname(r),{recursive:!0}),await $.writeFile(r,ID),await $.chmod(r,493),console.log(`${Ge("\u2714")} Hook installed`);return}if(u==="uninstall"){if(!o){console.warn("Hook is not installed");return}if(!(await MD(r)||await kD(r))){console.warn("Hook is not installed");return}await $.rm(r),console.log(`${Ge("\u2714")} Hook uninstalled`);return}throw new m(`Invalid mode: ${u}`)})().catch(t=>{console.error(`${St("\u2716")} ${t.message}`),Gt(t),process.exit(1)})});const Gl=_n(),Xe=process.argv.slice(2),zl=Xe[0]==="prepare-commit-msg-hook",Wl=[{flag:"--type",matches:["--type","-t"]},{flag:"--details",matches:["--details"]},{flag:"--details-style",matches:["--details-style"]},{flag:"--instructions",matches:["--instructions"]},{flag:"--conventional-format",matches:["--conventional-format"]},{flag:"--conventional-types",matches:["--conventional-types"]},{flag:"--conventional-scope",matches:["--conventional-scope"]}];Co({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"},reasoningEffort:{type:String,description:"Reasoning effort to request: none, low, medium, high, or xhigh"},apiMode:{type:String,description:"API mode to use: responses (default) or chat"},messageFile:{type:String,description:"Markdown file used to guide commit message generation"},postResponseScript:{type:String,description:"Executable script that can rewrite the AI response via stdin/stdout"},baseUrl:{type:String,description:"API base URL for Responses API (default) or Chat Completions (for example https://api.openai.com/v1)"},confirm:{type:Boolean,description:"Skip interactive confirmation/selection prompts and use the first generated message",alias:"y",default:!1},yes:{type:Boolean,description:"Alias for --confirm",default:!1},version:{type:Boolean,description:"Show version number",alias:"v"}},commands:[kl,Ll],help:{description:ho},ignoreArgv:e=>e==="unknown-flag"||e==="argument"},e=>{if(e.flags.type!==void 0)throw new m(Wt("--type"));if(e.flags.details!==void 0)throw new m(Wt("--details"));for(const{flag:t,matches:u}of Wl)if(Xe.some(n=>u.some(r=>n===r||n.startsWith(`${r}=`))))throw new m(Wt(t));e.flags.version&&(console.log(Gl),process.exit(0)),Nl||zl?Il():vl(e.flags.generate,e.flags.exclude,e.flags.all,e.flags.showReasoning,e.flags.reasoningEffort,e.flags.apiMode,e.flags.messageFile,e.flags.postResponseScript,e.flags.baseUrl,e.flags.confirm||e.flags.yes,Xe)},Xe);
145
+ process.argv.splice(2, 0, ${JSON.stringify(of)});
146
+ ${import.meta.url.endsWith(".ts")?`process.argv.splice(2, 0, ${JSON.stringify(Nr)});`:""}
147
+ import(${JSON.stringify(sD(cf))})
148
+ `.trim(),lf=(process.argv[1]||"").replace(/\\/g,"/").endsWith(sf),Gr=async e=>await A.readFile(e,"utf8").catch(()=>{})===Lr,Wr=async e=>await A.realpath(e).catch(()=>{})===Nr;var ff=Uu({name:"hook",parameters:["<install/uninstall>"]},e=>{(async()=>{const t=await Un(),{installUninstall:u}=e._,n=await Ta("hooks",t),D=N.join(n,Fu),o=await Df(D);if(u==="install"){if(o){if(await Gr(D)){console.warn("The hook is already installed");return}if(await Wr(D))await A.rm(D);else throw new m(`A different ${Fu} hook seems to be installed. Please remove it before installing aicommits.`)}await A.mkdir(N.dirname(D),{recursive:!0}),await A.writeFile(D,Lr),await A.chmod(D,493),console.log(`${ye("\u2714")} Hook installed`);return}if(u==="uninstall"){if(!o){console.warn("Hook is not installed");return}if(!(await Gr(D)||await Wr(D))){console.warn("Hook is not installed");return}await A.rm(D),console.log(`${ye("\u2714")} Hook uninstalled`);return}throw new m(`Invalid mode: ${u}`)})().catch(t=>{console.error(`${Pt("\u2716")} ${t.message}`),Ut(t),process.exit(1)})});const df=Gn(),nt=process.argv.slice(2),Ff=nt[0]==="prepare-commit-msg-hook",pf=[{flag:"--type",matches:["--type","-t"]},{flag:"--details",matches:["--details"]},{flag:"--details-style",matches:["--details-style"]},{flag:"--instructions",matches:["--instructions"]},{flag:"--conventional-format",matches:["--conventional-format"]},{flag:"--conventional-types",matches:["--conventional-types"]},{flag:"--conventional-scope",matches:["--conventional-scope"]}];$o({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"},reasoningEffort:{type:String,description:"Reasoning effort to request: none, low, medium, high, or xhigh"},apiMode:{type:String,description:"API mode to use: responses (default) or chat"},messageFile:{type:String,description:"Markdown file used to guide commit message generation"},postResponseScript:{type:String,description:"Executable script that can rewrite the AI response via stdin/stdout"},baseUrl:{type:String,description:"API base URL for Responses API (default) or Chat Completions (for example https://api.openai.com/v1)"},confirm:{type:Boolean,description:"Skip interactive confirmation/selection prompts and use the first generated message",alias:"y",default:!1},yes:{type:Boolean,description:"Alias for --confirm",default:!1},print:{type:Boolean,description:"Print the generated commit message and exit without committing",default:!1},noCommit:{type:Boolean,description:"Alias for --print",default:!1},version:{type:Boolean,description:"Show version number",alias:"v"}},commands:[rf,ff],help:{description:So},ignoreArgv:e=>e==="unknown-flag"||e==="argument"},e=>{if(e.flags.type!==void 0)throw new m(Ht("--type"));if(e.flags.details!==void 0)throw new m(Ht("--details"));for(const{flag:t,matches:u}of pf)if(nt.some(n=>u.some(D=>n===D||n.startsWith(`${D}=`))))throw new m(Ht(t));if(e.flags.version&&(console.log(df),process.exit(0)),lf||Ff)uf();else{const t=e.flags.print||e.flags.noCommit;Zl(e.flags.generate,e.flags.exclude,e.flags.all,e.flags.showReasoning,e.flags.reasoningEffort,e.flags.apiMode,e.flags.messageFile,e.flags.postResponseScript,e.flags.baseUrl,e.flags.confirm||e.flags.yes||t,t,nt)}},nt);