@negoziator/ai-commit 2.55.0 → 2.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{anthropic-CYcfNIDI.mjs → anthropic-Bflyvw43.mjs} +1 -1
- package/dist/{azure-openai-DMucJSpK.mjs → azure-openai-DherjF_r.mjs} +1 -1
- package/dist/{cli-CZgzl6A7.mjs → cli-BKUAQIcs.mjs} +29 -29
- package/dist/cli.mjs +1 -1
- package/dist/{custom-B934_Kq1.mjs → custom-BGtaR9LL.mjs} +1 -1
- package/dist/{ollama-B9nRnI8P.mjs → ollama-B_kUc-33.mjs} +1 -1
- package/dist/{openai-C_YPxOSJ.mjs → openai-Zu2hwLw7.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var y=Object.defineProperty;var u=(f,t)=>y(f,"name",{value:t,configurable:!0});import l from"https";import{d as w}from"./index-B3_BP8RZ.mjs";import{L as A,g as C}from"./prompt-BGI0PV0L.mjs";import{K as a}from"./cli-
|
|
1
|
+
var y=Object.defineProperty;var u=(f,t)=>y(f,"name",{value:t,configurable:!0});import l from"https";import{d as w}from"./index-B3_BP8RZ.mjs";import{L as A,g as C}from"./prompt-BGI0PV0L.mjs";import{K as a}from"./cli-BKUAQIcs.mjs";import"net";import"tls";import"assert";import"tty";import"util";import"os";import"http";import"url";import"node:url";import"node:child_process";import"node:string_decoder";import"node:util";import"node:process";import"node:tty";import"node:path";import"child_process";import"path";import"fs";import"node:timers/promises";import"node:os";import"node:events";import"node:v8";import"node:fs";import"node:stream";import"node:buffer";import"node:stream/promises";import"node:readline";import"fs/promises";const h=class h extends A{get name(){return"anthropic"}validateConfig(){const{apiKey:t}=this.config;if(!t)throw new a("Please set your Anthropic API key via `aicommit config set ANTHROPIC_KEY=<your token>`\nGet your API key from: https://console.anthropic.com/");if(!t.startsWith("sk-ant-"))throw new a('Invalid Anthropic API key: Must start with "sk-ant-"')}async generateCommitMessage(t){try{const i=C(this.config.locale,this.config.maxLength,this.config.type,t.projectConfig),o=[{role:"user",content:t.diff}],e=[];for(let s=0;s<t.completions;s++){const r=(await this.createMessage(i,o)).content[0]?.text;r&&e.push(this.sanitizeMessage(r))}return{messages:this.deduplicateMessages(e)}}catch(i){const o=i;throw o.code==="ENOTFOUND"?new a(`Error connecting to ${o.hostname} (${o.syscall}). Are you connected to the internet?`):o}}async createMessage(t,i){const o={model:this.config.model,max_tokens:this.config.maxCompletionTokens,temperature:this.config.temperature,system:t,messages:i},{response:e,data:n}=await this.httpsPost("api.anthropic.com","/v1/messages",{"x-api-key":this.config.apiKey,"anthropic-version":"2023-06-01"},o);if(!e.statusCode||e.statusCode<200||e.statusCode>299){let s=`Anthropic API Error: ${e.statusCode} - ${e.statusMessage}`;throw n&&(s+=`
|
|
2
2
|
|
|
3
3
|
${n}`),e.statusCode===500&&(s+=`
|
|
4
4
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var l=Object.defineProperty;var f=(u,t)=>l(u,"name",{value:t,configurable:!0});import y from"https";import{d as w}from"./index-B3_BP8RZ.mjs";import{L as C,g as A}from"./prompt-BGI0PV0L.mjs";import{K as a}from"./cli-
|
|
1
|
+
var l=Object.defineProperty;var f=(u,t)=>l(u,"name",{value:t,configurable:!0});import y from"https";import{d as w}from"./index-B3_BP8RZ.mjs";import{L as C,g as A}from"./prompt-BGI0PV0L.mjs";import{K as a}from"./cli-BKUAQIcs.mjs";import"net";import"tls";import"assert";import"tty";import"util";import"os";import"http";import"url";import"node:url";import"node:child_process";import"node:string_decoder";import"node:util";import"node:process";import"node:tty";import"node:path";import"child_process";import"path";import"fs";import"node:timers/promises";import"node:os";import"node:events";import"node:v8";import"node:fs";import"node:stream";import"node:buffer";import"node:stream/promises";import"node:readline";import"fs/promises";const g=class g extends C{get name(){return"azure-openai"}validateConfig(){const{apiKey:t,endpoint:i}=this.config;if(!t)throw new a("Please set your Azure OpenAI API key via `aicommit config set AZURE_OPENAI_KEY=<your token>`");if(!i)throw new a("Please set your Azure OpenAI endpoint via `aicommit config set AZURE_ENDPOINT=<your endpoint>`")}async generateCommitMessage(t){try{const i=await this.createChatCompletion({model:this.config.model,messages:[{role:"system",content:A(this.config.locale,this.config.maxLength,this.config.type,t.projectConfig)},{role:"user",content:t.diff}],temperature:this.config.temperature,top_p:1,frequency_penalty:0,presence_penalty:0,max_tokens:this.config.maxCompletionTokens,n:t.completions});return{messages:this.deduplicateMessages(i.choices.filter(r=>r.message?.content).map(r=>this.sanitizeMessage(r.message.content)))}}catch(i){const e=i;throw e.code==="ENOTFOUND"?new a(`Error connecting to ${e.hostname} (${e.syscall}). Are you connected to the internet?`):e}}async createChatCompletion(t){const e=new URL(this.config.endpoint).hostname,m=`/openai/deployments/${this.config.deploymentName||this.config.model}/chat/completions?api-version=2024-02-01`,{response:n,data:s}=await this.httpsPost(e,m,{"api-key":this.config.apiKey},t);if(!n.statusCode||n.statusCode<200||n.statusCode>299){let o=`Azure OpenAI API Error: ${n.statusCode} - ${n.statusMessage}`;throw s&&(o+=`
|
|
2
2
|
|
|
3
3
|
${s}`),new a(o)}return JSON.parse(s)}async httpsPost(t,i,e,r){return new Promise((m,n)=>{const s=JSON.stringify(r),o=y.request({hostname:t,path:i,method:"POST",headers:{...e,"Content-Type":"application/json","Content-Length":Buffer.byteLength(s)},timeout:this.config.timeout,agent:this.config.proxy?new w.HttpsProxyAgent(this.config.proxy):void 0},p=>{const h=[];p.on("data",d=>h.push(d)),p.on("end",()=>{m({request:o,response:p,data:Buffer.concat(h).toString()})})});o.on("error",n),o.on("timeout",()=>{o.destroy(),n(new a(`Time out error: request took over ${this.config.timeout}ms. Try increasing the \`timeout\` config`))}),o.write(s),o.end()})}sanitizeMessage(t){return t.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1")}deduplicateMessages(t){return Array.from(new Set(t))}};f(g,"AzureOpenAIProvider");let c=g;export{c as default};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var $c=Object.defineProperty;var o=(e,t)=>$c(e,"name",{value:t,configurable:!0});var He,Ye;import Bc from"tty";import{fileURLToPath as $o}from"node:url";import{ChildProcess as Bo,execFile as Tc,spawnSync as Ic,spawn as Oc}from"node:child_process";import{StringDecoder as To}from"node:string_decoder";import{debuglog as Rc,stripVTControlCharacters as Mc,inspect as Io,promisify as Oo,callbackify as Re,aborted as _c,styleText as C}from"node:util";import I,{platform as Pc,hrtime as Ro,execPath as Lc,execArgv as Nc,stdout as an,stdin as Mo}from"node:process";import _o,{ReadStream as Po}from"node:tty";import Y from"node:path";import kc from"child_process";import ce from"path";import un from"fs";import{setTimeout as Lo,scheduler as No,setImmediate as Uc}from"node:timers/promises";import{constants as me}from"node:os";import{once as G,addAbortListener as ko,EventEmitter as jc,on as Dt,setMaxListeners as Wc}from"node:events";import{serialize as Gc}from"node:v8";import{statSync as zc,readFileSync as cn,appendFileSync as Vc,writeFileSync as Hc,createWriteStream as Uo,createReadStream as jo}from"node:fs";import{Transform as Yc,getDefaultHighWaterMark as pt,Duplex as ln,Writable as dn,Readable as ge,PassThrough as Wo}from"node:stream";import{Buffer as fn}from"node:buffer";import{finished as le}from"node:stream/promises";import*as mt from"node:readline";import qc from"node:readline";import W from"fs/promises";import Kc from"os";import{fileURLToPath as Zc,pathToFileURL as Jc}from"url";var Xc=Object.defineProperty,N=o((e,t)=>Xc(e,"name",{value:t,configurable:!0}),"c$1");const Qc="known-flag",xc="unknown-flag",el="argument",tl=/\B([A-Z])/g,nl=N(e=>e.replaceAll(tl,"-$1").toLowerCase(),"camelToKebab"),{hasOwnProperty:rl}=Object.prototype,Me=N((e,t)=>rl.call(e,t),"hasOwn"),hn=N(e=>typeof e=="function"?[e,!1]:Array.isArray(e)?[e[0],!0]:hn(e.type),"parseFlagType"),Go=N((e,t)=>e===Boolean?t!=="false":t,"normalizeBoolean"),zo=N((e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),"applyParser"),ol=/[\s.:=]/,il=N(e=>{const t=`Flag name "${e}"`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const n=e.match(ol);if(n)throw new Error(`${t} cannot contain "${n?.[0]}"`)},"validateFlagName"),Dn=N((e,t,n)=>{if(Me(e,t))throw new Error(`Duplicate flags named "${t}"`);e[t]=n},"setFlag"),sl=N(e=>{const t={};for(const n in e){if(!Me(e,n))continue;il(n);const r=e[n],i=[[],...hn(r),r];Dn(t,n,i);const s=nl(n);if(n!==s&&Dn(t,s,i),"alias"in r&&typeof r.alias=="string"){const{alias:a}=r,u=`Flag alias "${a}" for flag "${n}"`;if(a.length===0)throw new Error(`${u} cannot be empty`);if(a.length>1)throw new Error(`${u} must be a single character`);Dn(t,a,i)}}return t},"createRegistry"),al=N((e,t)=>{const n={};for(const r in e){if(!Me(e,r))continue;const[i,,s,a]=t[r];if(i.length===0&&"default"in a){let{default:u}=a;typeof u=="function"&&(u=u()),n[r]=u}else n[r]=s?i:i.pop()}return n},"finalizeFlags"),gt="--",ul=3,cl=/^-{1,2}\w/,Vo=N(e=>{if(!cl.test(e))return;const t=!e.startsWith(gt);let n=e.slice(t?1:2),r,i=-1;for(const s of["=",":","."]){const a=n.indexOf(s);a!==-1&&(i===-1||a<i)&&(i=a)}return i!==-1&&(r=n.slice(i+1),n=n.slice(0,i)),[n,r,t]},"parseFlagArgv"),Ho=N((e,{onFlag:t,onArgument:n})=>{let r;const i=N((s,a)=>{if(typeof r!="function")return!0;r(s,a),r=void 0},"triggerValueCallback");for(let s=0;s<e.length;s+=1){const a=e[s];if(a===gt){i();const c=e.slice(s+1);n?.(c,[s],!0);break}const u=Vo(a);if(u){if(i(),!t)continue;const[c,d,l]=u;if(l)for(let f=0;f<c.length;f+=1){i();const h=f===c.length-1;r=t(c[f],h?d:void 0,[s,f+1,h])}else r=t(c,d,[s])}else i(a,[s])&&n?.([a],[s])}i()},"argvIterator"),Yo=N((e,t)=>{for(let n=t.length-1;n>=0;n-=1){const[r,i,s]=t[n];if(i){const a=e[r];let u=a.slice(0,i);if(s||(u+=a.slice(i+1)),u!=="-"){e[r]=u;continue}}e.splice(r,1)}},"spliceFromArgv"),ll=N((e,t=process.argv.slice(2),{ignore:n,booleanNegation:r}={})=>{const i=[],s=sl(e),a={},u=[];return u[gt]=[],Ho(t,{onFlag(c,d,l){const f=l.length===ul,h=(f||c.length>1)&&Me(s,c);let D;if(!h&&r&&!f&&c.length>3&&c.startsWith("no-")){const p=c.slice(3);Me(s,p)&&s[p][1]===Boolean&&(D=p)}if(!n?.(h||D?Qc:xc,c,d)){if(h){const[p,m]=s[c],F=Go(m,d),g=N((w,E)=>{i.push(l),E&&i.push(E),p.push(zo(m,w||""))},"getFollowingValue");return F===void 0?g:g(F)}if(D){s[D][0].push(!1),i.push(l);return}Me(a,c)||(a[c]=[]),a[c].push(d===void 0?!0:d),i.push(l)}},onArgument:N((c,d,l)=>{n?.(el,t[d[0]])||(u.push(...c),l?(u[gt]=c,t.splice(d[0])):i.push(d))},"onArgument")}),Yo(t,i),{flags:al(e,s),unknownFlags:a,_:u}},"typeFlag");N((e,t,n=process.argv.slice(2))=>{const r=new Set(e.split(",").map(c=>Vo(c)?.[0])),[i,s]=hn(t),a=[],u=[];return Ho(n,{onFlag:N((c,d,l)=>{if(!r.has(c)||!s&&a.length>0)return;const f=Go(i,d),h=N((D,p)=>{u.push(l),p&&u.push(p),a.push(zo(i,D||""))},"getFollowingValue");return f===void 0?h:h(f)},"onFlag")}),Yo(n,u),s?a:a[0]},"getFlag");var dl=Object.defineProperty,$=o((e,t)=>dl(e,"name",{value:t,configurable:!0}),"n$1");const fl=$(e=>{const t=process.stdout.columns??Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(t)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:t}:{columns:e.columns??[],stdoutColumns:e.stdoutColumns??t}},"getOptions");function qo({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")}o(qo,"j$1"),$(qo,"ansiRegex");const hl=qo();function pn(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(hl,"")}o(pn,"w$2"),$(pn,"stripAnsi");function Ko(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}o(Ko,"P$1"),$(Ko,"isAmbiguous");function Zo(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}o(Zo,"z$3"),$(Zo,"isFullWidth");function Jo(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}o(Jo,"G$1"),$(Jo,"isWide");function Xo(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}o(Xo,"Z$1"),$(Xo,"validate");function Qo(e,{ambiguousAsWide:t=!1}={}){return Xo(e),Zo(e)||Jo(e)||t&&Ko(e)?2:1}o(Qo,"V$3"),$(Qo,"eastAsianWidth");var Dl=$(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"emojiRegex");const pl=new Intl.Segmenter,ml=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function de(e,t={}){if(typeof e!="string"||e.length===0)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=pn(e)),e.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:a}of pl.segment(e)){const u=a.codePointAt(0);if(!(u<=31||u>=127&&u<=159)&&!(u>=8203&&u<=8207||u===65279)&&!(u>=768&&u<=879||u>=6832&&u<=6911||u>=7616&&u<=7679||u>=8400&&u<=8447||u>=65056&&u<=65071)&&!(u>=55296&&u<=57343)&&!(u>=65024&&u<=65039)&&!ml.test(a)){if(Dl().test(a)){i+=2;continue}i+=Qo(u,s)}}return i}o(de,"d$2"),$(de,"stringWidth");const xo=$(e=>Math.max(...e.split(`
|
|
2
|
-
`).map(t=>de(t))),"getLongestLineWidth"),gl=$(e=>{const t=[];for(const n of e){const{length:r}=n,i=r-t.length;for(let s=0;s<i;s+=1)t.push(0);for(let s=0;s<r;s+=1){const a=xo(n[s]);a>t[s]&&(t[s]=a)}}return t},"getColumnContentWidths"),ei=/^\d+%$/,ti={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Fl=$((e,t)=>{const n=[];for(let r=0;r<e.length;r+=1){const i=t[r]??"auto";if(typeof i=="number"||i==="auto"||i==="content-width"||typeof i=="string"&&ei.test(i)){n.push({...ti,width:i,contentWidth:e[r]});continue}if(i&&typeof i=="object"){const s={...ti,...i,contentWidth:e[r]};s.horizontalPadding=s.paddingLeft+s.paddingRight,n.push(s);continue}throw new Error(`Invalid column width: ${JSON.stringify(i)}`)}return n},"initColumns"),wl=$((e,t)=>{for(const n of e){const{width:r}=n;if(r==="content-width"&&(n.width=n.contentWidth),r==="auto"){const c=Math.min(20,n.contentWidth);n.width=c,n.autoOverflow=n.contentWidth-c}if(typeof r=="string"&&ei.test(r)){const c=Number.parseFloat(r.slice(0,-1))/100;n.width=Math.floor(t*c)-(n.paddingLeft+n.paddingRight)}const{horizontalPadding:i}=n,s=1,a=s+i;if(a>=t){const c=a-t,d=Math.ceil(n.paddingLeft/i*c),l=c-d;n.paddingLeft-=d,n.paddingRight-=l,n.horizontalPadding=n.paddingLeft+n.paddingRight}n.paddingLeftString=n.paddingLeft?" ".repeat(n.paddingLeft):"",n.paddingRightString=n.paddingRight?" ".repeat(n.paddingRight):"";const u=t-n.horizontalPadding;n.width=Math.max(Math.min(n.width,u),s)}},"resolveColumnWidths"),ni=$(()=>Object.assign([],{columns:0}),"makeRow"),yl=$((e,t)=>{const n=[ni()];let[r]=n;for(const i of e){const s=i.width+i.horizontalPadding;r.columns+s>t&&(r=ni(),n.push(r)),r.push(i),r.columns+=s}for(const i of n){const s=i.reduce((h,
|
|
3
|
-
`),d=[...c];let l=0;for(const[f,h]of d.entries()){if(r+=h,Ft.has(h)){const{groups:
|
|
4
|
-
`?(s&&(r+=li("")),i&&
|
|
5
|
-
`&&(i&&
|
|
1
|
+
var $c=Object.defineProperty;var o=(e,t)=>$c(e,"name",{value:t,configurable:!0});var He,Ye;import Bc from"tty";import{fileURLToPath as $o}from"node:url";import{ChildProcess as Bo,execFile as Tc,spawnSync as Ic,spawn as Oc}from"node:child_process";import{StringDecoder as To}from"node:string_decoder";import{debuglog as Rc,stripVTControlCharacters as Mc,inspect as Io,promisify as Oo,callbackify as Re,aborted as _c,styleText as C}from"node:util";import I,{platform as Pc,hrtime as Ro,execPath as Lc,execArgv as Nc,stdout as an,stdin as Mo}from"node:process";import _o,{ReadStream as Po}from"node:tty";import Y from"node:path";import kc from"child_process";import ce from"path";import un from"fs";import{setTimeout as Lo,scheduler as No,setImmediate as Uc}from"node:timers/promises";import{constants as me}from"node:os";import{once as G,addAbortListener as ko,EventEmitter as jc,on as Dt,setMaxListeners as Wc}from"node:events";import{serialize as Gc}from"node:v8";import{statSync as zc,readFileSync as cn,appendFileSync as Vc,writeFileSync as Hc,createWriteStream as Uo,createReadStream as jo}from"node:fs";import{Transform as Yc,getDefaultHighWaterMark as pt,Duplex as ln,Writable as dn,Readable as ge,PassThrough as Wo}from"node:stream";import{Buffer as fn}from"node:buffer";import{finished as le}from"node:stream/promises";import*as mt from"node:readline";import qc from"node:readline";import W from"fs/promises";import Kc from"os";import{fileURLToPath as Zc,pathToFileURL as Jc}from"url";var Xc=Object.defineProperty,N=o((e,t)=>Xc(e,"name",{value:t,configurable:!0}),"c$1");const Qc="known-flag",xc="unknown-flag",el="argument",tl=/\B([A-Z])/g,nl=N(e=>e.replaceAll(tl,"-$1").toLowerCase(),"camelToKebab"),{hasOwnProperty:rl}=Object.prototype,Me=N((e,t)=>rl.call(e,t),"hasOwn"),hn=N(e=>typeof e=="function"?[e,!1]:Array.isArray(e)?[e[0],!0]:hn(e.type),"parseFlagType"),Go=N((e,t)=>e===Boolean?t!=="false":t,"normalizeBoolean"),zo=N((e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),"applyParser"),ol=/[\s.:=]/,il=N(e=>{const t=`Flag name "${e}"`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const n=e.match(ol);if(n)throw new Error(`${t} cannot contain "${n?.[0]}"`)},"validateFlagName"),Dn=N((e,t,n)=>{if(Me(e,t))throw new Error(`Duplicate flags named "${t}"`);e[t]=n},"setFlag"),sl=N(e=>{const t={};for(const n in e){if(!Me(e,n))continue;il(n);const r=e[n],i=[[],...hn(r),r];Dn(t,n,i);const s=nl(n);if(n!==s&&Dn(t,s,i),"alias"in r&&typeof r.alias=="string"){const{alias:a}=r,u=`Flag alias "${a}" for flag "${n}"`;if(a.length===0)throw new Error(`${u} cannot be empty`);if(a.length>1)throw new Error(`${u} must be a single character`);Dn(t,a,i)}}return t},"createRegistry"),al=N((e,t)=>{const n={};for(const r in e){if(!Me(e,r))continue;const[i,,s,a]=t[r];if(i.length===0&&"default"in a){let{default:u}=a;typeof u=="function"&&(u=u()),n[r]=u}else n[r]=s?i:i.pop()}return n},"finalizeFlags"),gt="--",ul=3,cl=/^-{1,2}\w/,Vo=N(e=>{if(!cl.test(e))return;const t=!e.startsWith(gt);let n=e.slice(t?1:2),r,i=-1;for(const s of["=",":","."]){const a=n.indexOf(s);a!==-1&&(i===-1||a<i)&&(i=a)}return i!==-1&&(r=n.slice(i+1),n=n.slice(0,i)),[n,r,t]},"parseFlagArgv"),Ho=N((e,{onFlag:t,onArgument:n})=>{let r;const i=N((s,a)=>{if(typeof r!="function")return!0;r(s,a),r=void 0},"triggerValueCallback");for(let s=0;s<e.length;s+=1){const a=e[s];if(a===gt){i();const c=e.slice(s+1);n?.(c,[s],!0);break}const u=Vo(a);if(u){if(i(),!t)continue;const[c,d,l]=u;if(l)for(let f=0;f<c.length;f+=1){i();const h=f===c.length-1;r=t(c[f],h?d:void 0,[s,f+1,h])}else r=t(c,d,[s])}else i(a,[s])&&n?.([a],[s])}i()},"argvIterator"),Yo=N((e,t)=>{for(let n=t.length-1;n>=0;n-=1){const[r,i,s]=t[n];if(i){const a=e[r];let u=a.slice(0,i);if(s||(u+=a.slice(i+1)),u!=="-"){e[r]=u;continue}}e.splice(r,1)}},"spliceFromArgv"),ll=N((e,t=process.argv.slice(2),{ignore:n,booleanNegation:r}={})=>{const i=[],s=sl(e),a={},u=[];return u[gt]=[],Ho(t,{onFlag(c,d,l){const f=l.length===ul,h=(f||c.length>1)&&Me(s,c);let p;if(!h&&r&&!f&&c.length>3&&c.startsWith("no-")){const D=c.slice(3);Me(s,D)&&s[D][1]===Boolean&&(p=D)}if(!n?.(h||p?Qc:xc,c,d)){if(h){const[D,m]=s[c],F=Go(m,d),g=N((w,E)=>{i.push(l),E&&i.push(E),D.push(zo(m,w||""))},"getFollowingValue");return F===void 0?g:g(F)}if(p){s[p][0].push(!1),i.push(l);return}Me(a,c)||(a[c]=[]),a[c].push(d===void 0?!0:d),i.push(l)}},onArgument:N((c,d,l)=>{n?.(el,t[d[0]])||(u.push(...c),l?(u[gt]=c,t.splice(d[0])):i.push(d))},"onArgument")}),Yo(t,i),{flags:al(e,s),unknownFlags:a,_:u}},"typeFlag");N((e,t,n=process.argv.slice(2))=>{const r=new Set(e.split(",").map(c=>Vo(c)?.[0])),[i,s]=hn(t),a=[],u=[];return Ho(n,{onFlag:N((c,d,l)=>{if(!r.has(c)||!s&&a.length>0)return;const f=Go(i,d),h=N((p,D)=>{u.push(l),D&&u.push(D),a.push(zo(i,p||""))},"getFollowingValue");return f===void 0?h:h(f)},"onFlag")}),Yo(n,u),s?a:a[0]},"getFlag");var dl=Object.defineProperty,$=o((e,t)=>dl(e,"name",{value:t,configurable:!0}),"n$1");const fl=$(e=>{const t=process.stdout.columns??Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(t)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:t}:{columns:e.columns??[],stdoutColumns:e.stdoutColumns??t}},"getOptions");function qo({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")}o(qo,"j$1"),$(qo,"ansiRegex");const hl=qo();function pn(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(hl,"")}o(pn,"w$2"),$(pn,"stripAnsi");function Ko(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}o(Ko,"P$1"),$(Ko,"isAmbiguous");function Zo(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}o(Zo,"z$3"),$(Zo,"isFullWidth");function Jo(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}o(Jo,"G$1"),$(Jo,"isWide");function Xo(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}o(Xo,"Z$1"),$(Xo,"validate");function Qo(e,{ambiguousAsWide:t=!1}={}){return Xo(e),Zo(e)||Jo(e)||t&&Ko(e)?2:1}o(Qo,"V$3"),$(Qo,"eastAsianWidth");var Dl=$(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"emojiRegex");const pl=new Intl.Segmenter,ml=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function de(e,t={}){if(typeof e!="string"||e.length===0)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=pn(e)),e.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:a}of pl.segment(e)){const u=a.codePointAt(0);if(!(u<=31||u>=127&&u<=159)&&!(u>=8203&&u<=8207||u===65279)&&!(u>=768&&u<=879||u>=6832&&u<=6911||u>=7616&&u<=7679||u>=8400&&u<=8447||u>=65056&&u<=65071)&&!(u>=55296&&u<=57343)&&!(u>=65024&&u<=65039)&&!ml.test(a)){if(Dl().test(a)){i+=2;continue}i+=Qo(u,s)}}return i}o(de,"d$2"),$(de,"stringWidth");const xo=$(e=>Math.max(...e.split(`
|
|
2
|
+
`).map(t=>de(t))),"getLongestLineWidth"),gl=$(e=>{const t=[];for(const n of e){const{length:r}=n,i=r-t.length;for(let s=0;s<i;s+=1)t.push(0);for(let s=0;s<r;s+=1){const a=xo(n[s]);a>t[s]&&(t[s]=a)}}return t},"getColumnContentWidths"),ei=/^\d+%$/,ti={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Fl=$((e,t)=>{const n=[];for(let r=0;r<e.length;r+=1){const i=t[r]??"auto";if(typeof i=="number"||i==="auto"||i==="content-width"||typeof i=="string"&&ei.test(i)){n.push({...ti,width:i,contentWidth:e[r]});continue}if(i&&typeof i=="object"){const s={...ti,...i,contentWidth:e[r]};s.horizontalPadding=s.paddingLeft+s.paddingRight,n.push(s);continue}throw new Error(`Invalid column width: ${JSON.stringify(i)}`)}return n},"initColumns"),wl=$((e,t)=>{for(const n of e){const{width:r}=n;if(r==="content-width"&&(n.width=n.contentWidth),r==="auto"){const c=Math.min(20,n.contentWidth);n.width=c,n.autoOverflow=n.contentWidth-c}if(typeof r=="string"&&ei.test(r)){const c=Number.parseFloat(r.slice(0,-1))/100;n.width=Math.floor(t*c)-(n.paddingLeft+n.paddingRight)}const{horizontalPadding:i}=n,s=1,a=s+i;if(a>=t){const c=a-t,d=Math.ceil(n.paddingLeft/i*c),l=c-d;n.paddingLeft-=d,n.paddingRight-=l,n.horizontalPadding=n.paddingLeft+n.paddingRight}n.paddingLeftString=n.paddingLeft?" ".repeat(n.paddingLeft):"",n.paddingRightString=n.paddingRight?" ".repeat(n.paddingRight):"";const u=t-n.horizontalPadding;n.width=Math.max(Math.min(n.width,u),s)}},"resolveColumnWidths"),ni=$(()=>Object.assign([],{columns:0}),"makeRow"),yl=$((e,t)=>{const n=[ni()];let[r]=n;for(const i of e){const s=i.width+i.horizontalPadding;r.columns+s>t&&(r=ni(),n.push(r)),r.push(i),r.columns+=s}for(const i of n){const s=i.reduce((h,p)=>h+p.width+p.horizontalPadding,0);let a=t-s;if(a===0)continue;const u=i.filter(h=>"autoOverflow"in h),c=u.filter(h=>h.autoOverflow>0),d=c.reduce((h,p)=>h+p.autoOverflow,0),l=Math.min(d,a);for(const h of c){const p=Math.floor(h.autoOverflow/d*l);h.width+=p,a-=p}const f=Math.floor(a/u.length);for(let h=0;h<u.length;h+=1){const p=u[h];h===u.length-1?p.width+=a:p.width+=f,a-=f}}return n},"balanceAuto"),El=$((e,t,n)=>{const r=Fl(n,t);return wl(r,e),yl(r,e)},"computeColumnWidths"),mn=10,ri=$((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),oi=$((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"wrapAnsi256"),ii=$((e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,"wrapAnsi16m"),M={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(M.modifier);const bl=Object.keys(M.color),Cl=Object.keys(M.bgColor);[...bl,...Cl];function si(){const e=new Map;for(const[t,n]of Object.entries(M)){for(const[r,i]of Object.entries(n))M[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[r]=M[r],e.set(i[0],i[1]);Object.defineProperty(M,t,{value:n,enumerable:!1})}return Object.defineProperty(M,"codes",{value:e,enumerable:!1}),M.color.close="\x1B[39m",M.bgColor.close="\x1B[49m",M.color.ansi=ri(),M.color.ansi256=oi(),M.color.ansi16m=ii(),M.bgColor.ansi=ri(mn),M.bgColor.ansi256=oi(mn),M.bgColor.ansi16m=ii(mn),Object.defineProperties(M,{rgbToAnsi256:{value:$((t,n,r)=>t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5),"value"),enumerable:!1},hexToRgb:{value:$(t=>{const n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(s=>s+s).join(""));const i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},"value"),enumerable:!1},hexToAnsi256:{value:$(t=>M.rgbToAnsi256(...M.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value:$(t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,i;if(t>=232)n=((t-232)*10+8)/255,r=n,i=n;else{t-=16;const u=t%36;n=Math.floor(t/36)/5,r=Math.floor(u/6)/5,i=u%6/5}const s=Math.max(n,r,i)*2;if(s===0)return 30;let a=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(n));return s===2&&(a+=60),a},"value"),enumerable:!1},rgbToAnsi:{value:$((t,n,r)=>M.ansi256ToAnsi(M.rgbToAnsi256(t,n,r)),"value"),enumerable:!1},hexToAnsi:{value:$(t=>M.ansi256ToAnsi(M.hexToAnsi256(t)),"value"),enumerable:!1}}),M}o(si,"FD"),$(si,"assembleStyles");const Sl=si(),Ft=new Set(["\x1B","\x9B"]),vl=39,gn="\x07",ai="[",Al="]",ui="m",wt=`${Al}8;;`,ci=$(e=>`${Ft.values().next().value}${ai}${e}${ui}`,"wrapAnsiCode"),li=$(e=>`${Ft.values().next().value}${wt}${e}${gn}`,"wrapAnsiHyperlink"),$l=$(e=>e.split(" ").map(t=>de(t)),"wordLengths"),Fn=$((e,t,n)=>{const r=[...t];let i=!1,s=!1,a=de(pn(e.at(-1)));for(const[u,c]of r.entries()){const d=de(c);if(a+d<=n?e[e.length-1]+=c:(e.push(c),a=0),Ft.has(c)&&(i=!0,s=r.slice(u+1,u+1+wt.length).join("")===wt),i){s?c===gn&&(i=!1,s=!1):c===ui&&(i=!1);continue}a+=d,a===n&&u<r.length-1&&(e.push(""),a=0)}!a&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},"wrapWord"),Bl=$(e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(de(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},"stringVisibleTrimSpacesRight"),Tl=$((e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",i,s;const a=$l(e);let u=[""];for(const[f,h]of e.split(" ").entries()){n.trim!==!1&&(u[u.length-1]=u.at(-1).trimStart());let p=de(u.at(-1));if(f!==0&&(p>=t&&(n.wordWrap===!1||n.trim===!1)&&(u.push(""),p=0),(p>0||n.trim===!1)&&(u[u.length-1]+=" ",p++)),n.hard&&a[f]>t){const D=t-p,m=1+Math.floor((a[f]-D-1)/t);Math.floor((a[f]-1)/t)<m&&u.push(""),Fn(u,h,t);continue}if(p+a[f]>t&&p>0&&a[f]>0){if(n.wordWrap===!1&&p<t){Fn(u,h,t);continue}u.push("")}if(p+a[f]>t&&n.wordWrap===!1){Fn(u,h,t);continue}u[u.length-1]+=h}n.trim!==!1&&(u=u.map(f=>Bl(f)));const c=u.join(`
|
|
3
|
+
`),d=[...c];let l=0;for(const[f,h]of d.entries()){if(r+=h,Ft.has(h)){const{groups:D}=new RegExp(`(?:\\${ai}(?<code>\\d+)m|\\${wt}(?<uri>.*)${gn})`).exec(c.slice(l))||{groups:{}};if(D.code!==void 0){const m=Number.parseFloat(D.code);i=m===vl?void 0:m}else D.uri!==void 0&&(s=D.uri.length===0?void 0:D.uri)}const p=Sl.codes.get(Number(i));d[f+1]===`
|
|
4
|
+
`?(s&&(r+=li("")),i&&p&&(r+=ci(p))):h===`
|
|
5
|
+
`&&(i&&p&&(r+=ci(i)),s&&(r+=li(s))),l+=h.length}return r},"exec");function di(e,t,n){return String(e).normalize().replaceAll(`\r
|
|
6
6
|
`,`
|
|
7
7
|
`).split(`
|
|
8
8
|
`).map(r=>Tl(r,t,n)).join(`
|
|
9
9
|
`)}o(di,"BD"),$(di,"wrapAnsi");const fi=$(e=>Array.from({length:e}).fill(""),"emptyLines"),Il=$((e,t)=>{const n=[];let r=0;for(const i of e){let s=0;const a=i.map(c=>{let d=t[r]??"";r+=1,c.preprocess&&(d=c.preprocess(d)),xo(d)>c.width&&(d=di(d,c.width,{hard:!0}));let l=d.split(`
|
|
10
|
-
`);if(c.postprocess){const{postprocess:f}=c;l=l.map((h,
|
|
10
|
+
`);if(c.postprocess){const{postprocess:f}=c;l=l.map((h,p)=>f.call(c,h,p))}return c.paddingTop&&l.unshift(...fi(c.paddingTop)),c.paddingBottom&&l.push(...fi(c.paddingBottom)),l.length>s&&(s=l.length),{...c,lines:l}}),u=[];for(let c=0;c<s;c+=1){const d=a.map(l=>{const f=l.lines[c]??"",h=Number.isFinite(l.width)?" ".repeat(l.width-de(f)):"";let p=l.paddingLeftString;return l.align==="right"&&(p+=h),p+=f,l.align==="left"&&(p+=h),p+l.paddingRightString}).join("");u.push(d)}n.push(u.join(`
|
|
11
11
|
`))}return n.join(`
|
|
12
12
|
`)},"renderRow"),Ol=$((e,t)=>{if(!e||e.length===0)return"";const n=gl(e),r=n.length;if(r===0)return"";const{stdoutColumns:i,columns:s}=fl(t);if(s.length>r)throw new Error(`${s.length} columns defined, but only ${r} columns found`);const a=El(i,s,n);return e.map(u=>Il(a,u)).join(`
|
|
13
|
-
`)},"terminalColumns"),Rl=["<",">","=",">=","<="],Ml=$(e=>{if(!Rl.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)},"assertOperator"),_l=$(e=>{const t=Object.keys(e).map(n=>{const[r,i]=n.split(" ");Ml(r);const s=Number.parseInt(i,10);if(Number.isNaN(s))throw new TypeError(`Invalid breakpoint value: ${i}`);const a=e[n];return{operator:r,breakpoint:s,value:a}}).sort((n,r)=>r.breakpoint-n.breakpoint);return n=>t.find(({operator:r,breakpoint:i})=>r==="="&&n===i||r===">"&&n>i||r==="<"&&n<i||r===">="&&n>=i||r==="<="&&n<=i)?.value},"breakpoints");var Pl=Object.defineProperty,T=o((e,t)=>Pl(e,"name",{value:t,configurable:!0}),"o$1");const ie=new Uint32Array(65536),Ll=T((e,t)=>{const n=e.length,r=t.length,i=1<<n-1;let s=-1,a=0,u=n,c=n;for(;c--;)ie[e.charCodeAt(c)]|=1<<c;for(c=0;c<r;c++){let d=ie[t.charCodeAt(c)];const l=d|a;d|=(d&s)+s^s,a|=~(d|s),s&=d,a&i&&u++,s&i&&u--,a=a<<1|1,s=s<<1|~(l|a),a&=l}for(c=n;c--;)ie[e.charCodeAt(c)]=0;return u},"myers_32"),Nl=T((e,t)=>{const n=t.length,r=e.length,i=[],s=[],a=Math.ceil(n/32),u=Math.ceil(r/32);for(let
|
|
13
|
+
`)},"terminalColumns"),Rl=["<",">","=",">=","<="],Ml=$(e=>{if(!Rl.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)},"assertOperator"),_l=$(e=>{const t=Object.keys(e).map(n=>{const[r,i]=n.split(" ");Ml(r);const s=Number.parseInt(i,10);if(Number.isNaN(s))throw new TypeError(`Invalid breakpoint value: ${i}`);const a=e[n];return{operator:r,breakpoint:s,value:a}}).sort((n,r)=>r.breakpoint-n.breakpoint);return n=>t.find(({operator:r,breakpoint:i})=>r==="="&&n===i||r===">"&&n>i||r==="<"&&n<i||r===">="&&n>=i||r==="<="&&n<=i)?.value},"breakpoints");var Pl=Object.defineProperty,T=o((e,t)=>Pl(e,"name",{value:t,configurable:!0}),"o$1");const ie=new Uint32Array(65536),Ll=T((e,t)=>{const n=e.length,r=t.length,i=1<<n-1;let s=-1,a=0,u=n,c=n;for(;c--;)ie[e.charCodeAt(c)]|=1<<c;for(c=0;c<r;c++){let d=ie[t.charCodeAt(c)];const l=d|a;d|=(d&s)+s^s,a|=~(d|s),s&=d,a&i&&u++,s&i&&u--,a=a<<1|1,s=s<<1|~(l|a),a&=l}for(c=n;c--;)ie[e.charCodeAt(c)]=0;return u},"myers_32"),Nl=T((e,t)=>{const n=t.length,r=e.length,i=[],s=[],a=Math.ceil(n/32),u=Math.ceil(r/32);for(let D=0;D<a;D++)s[D]=-1,i[D]=0;let c=0;for(;c<u-1;c++){let D=0,m=-1;const F=c*32,g=Math.min(32,r)+F;for(let w=F;w<g;w++)ie[e.charCodeAt(w)]|=1<<w;for(let w=0;w<n;w++){const E=ie[t.charCodeAt(w)],y=s[w/32|0]>>>w&1,b=i[w/32|0]>>>w&1,v=E|D,S=((E|b)&m)+m^m|E|b;let A=D|~(S|m),_=m&S;A>>>31^y&&(s[w/32|0]^=1<<w),_>>>31^b&&(i[w/32|0]^=1<<w),A=A<<1|y,_=_<<1|b,m=_|~(v|A),D=A&v}for(let w=F;w<g;w++)ie[e.charCodeAt(w)]=0}let d=0,l=-1;const f=c*32,h=Math.min(32,r-f)+f;for(let D=f;D<h;D++)ie[e.charCodeAt(D)]|=1<<D;let p=r;for(let D=0;D<n;D++){const m=ie[t.charCodeAt(D)],F=s[D/32|0]>>>D&1,g=i[D/32|0]>>>D&1,w=m|d,E=((m|g)&l)+l^l|m|g;let y=d|~(E|l),b=l&E;p+=y>>>r-1&1,p-=b>>>r-1&1,y>>>31^F&&(s[D/32|0]^=1<<D),b>>>31^g&&(i[D/32|0]^=1<<D),y=y<<1|F,b=b<<1|g,l=b|~(w|y),d=y&w}for(let D=f;D<h;D++)ie[e.charCodeAt(D)]=0;return p},"myers_x"),hi=T((e,t)=>{if(e.length<t.length){const n=t;t=e,e=n}return t.length===0?e.length:e.length<=32?Ll(e,t):Nl(e,t)},"distance"),kl=T((e,t)=>{let n=1/0,r=0;for(let i=0;i<t.length;i++){const s=hi(e,t[i]);s<n&&(n=s,r=i)}return t[r]},"closest"),Ul=T(e=>e.replaceAll(/[\W_]([a-z\d])?/gi,(t,n)=>n?n.toUpperCase():""),"camelCase"),jl=T(e=>e.replaceAll(/\B([A-Z])/g,"-$1").toLowerCase(),"kebabCase"),Wl={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:T(e=>e.trim(),"preprocess")},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function Di(e){let t=!1;return{type:"table",data:{tableData:Object.keys(e).sort((n,r)=>n.localeCompare(r)).map(n=>{const r=e[n],i="alias"in r;return i&&(t=!0),{name:n,flag:r,flagFormatted:`--${jl(n)}`,aliasesEnabled:t,aliasFormatted:i?`-${r.alias}`:void 0}}).map(n=>(n.aliasesEnabled=t,[{type:"flagName",data:n},{type:"flagDescription",data:n}])),tableBreakpoints:Wl}}}o(Di,"z$2"),T(Di,"renderFlags");const pi=T(e=>!e||(e.version??(e.help?e.help.version:void 0)),"getVersion"),mi=T(e=>{const t="parent"in e&&e.parent?.name;return(t?`${t} `:"")+e.name},"getName");function gi(e){const t=[];e.name&&t.push(mi(e));const n=pi(e)??("parent"in e&&pi(e.parent));if(n&&t.push(`v${n}`),t.length!==0)return{id:"name",type:"text",data:`${t.join(" ")}
|
|
14
14
|
`}}o(gi,"K"),T(gi,"getNameAndVersion");function Fi(e){const{help:t}=e;if(!(!t||!t.description))return{id:"description",type:"text",data:`${t.description}
|
|
15
15
|
`}}o(Fi,"Z"),T(Fi,"getDescription");function wi(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
16
|
`):t.usage}}:void 0;if(e.name){const n=[],r=[mi(e)];if(e.flags&&Object.keys(e.flags).length>0&&r.push("[flags...]"),e.parameters&&e.parameters.length>0){const{parameters:i}=e,s=i.indexOf("--"),a=s!==-1&&i.slice(s+1).some(u=>u.startsWith("<"));r.push(i.map(u=>u!=="--"?u:a?"--":"[--]").join(" "))}if(r.length>1&&n.push(r.join(" ")),"commands"in e&&e.commands?.length&&n.push(`${e.name} <command>`),n.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:n.join(`
|
|
@@ -19,7 +19,7 @@ var $c=Object.defineProperty;var o=(e,t)=>$c(e,"name",{value:t,configurable:!0})
|
|
|
19
19
|
`:"")+(n?this.indentText({text:this.render(n),spaces:r}):"")}
|
|
20
20
|
`}table({tableData:t,tableOptions:n,tableBreakpoints:r}){return Ol(t.map(i=>i.map(s=>this.render(s))),r?_l(r):n)}flagParameter(t){return t===Boolean?"":t===String?"<string>":t===Number?"<number>":Array.isArray(t)?this.flagParameter(t[0]):"<value>"}flagOperator(t){return" "}flagName(t){const{flag:n,flagFormatted:r,aliasesEnabled:i,aliasFormatted:s}=t;let a="";if(s?a+=`${s}, `:i&&(a+=" "),a+=r,"placeholder"in n&&typeof n.placeholder=="string")a+=`${this.flagOperator(t)}${n.placeholder}`;else{const u=this.flagParameter("type"in n?n.type:n);u&&(a+=`${this.flagOperator(t)}${u}`)}return a}flagDefault(t){return JSON.stringify(t)}flagDescription({flag:t}){let n="description"in t?t.description??"":"";if("default"in t){let{default:r}=t;typeof r=="function"&&(r=r()),r&&(n+=` (default: ${this.flagDefault(r)})`)}return n}render(t){if(typeof t=="string")return t;if(Array.isArray(t))return t.map(n=>this.render(n)).join(`
|
|
21
21
|
`);if("type"in t&&this[t.type]){const n=this[t.type];if(typeof n=="function")return n.call(this,t.data)}throw new Error(`Invalid node type: ${JSON.stringify(t)}`)}},o(He,"_ne"),He);T(Si,"Renderers");let Vl=Si;const wn=T(e=>e.length>0&&!e.includes(" "),"isValidScriptName"),{stringify:x}=JSON,Hl=/[|\\{}()[\]^$+*?.]/;function yn(e){const t=[];let n,r;for(const i of e){if(r)throw new Error(`Invalid parameter: Spread parameter ${x(r)} must be last`);const s=i[0],a=i.at(-1);let u;if(s==="<"&&a===">"&&(u=!0,n))throw new Error(`Invalid parameter: Required parameter ${x(i)} cannot come after optional parameter ${x(n)}`);if(s==="["&&a==="]"&&(u=!1,n=i),u===void 0)throw new Error(`Invalid parameter: ${x(i)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let c=i.slice(1,-1);const d=c.slice(-3)==="...";d&&(r=i,c=c.slice(0,-3));const l=c.match(Hl);if(l)throw new Error(`Invalid parameter: ${x(i)}. Invalid character found ${x(l[0])}`);t.push({name:c,required:u,spread:d})}return t}o(yn,"P"),T(yn,"parseParameters");function En(e,t,n,r){for(let i=0;i<t.length;i+=1){const{name:s,required:a,spread:u}=t[i],c=Ul(s);if(c in e)throw new Error(`Invalid parameter: ${x(s)} is used more than once.`);const d=u?n.slice(i):n[i];if(u&&(i=t.length),a&&(!d||u&&d.length===0))return console.error(`Error: Missing required parameter ${x(s)}
|
|
22
|
-
`),r(),process.exit(1);e[c]=d}}o(En,"S"),T(En,"mapParametersToArguments");function vi(e){return e!==!1}o(vi,"se"),T(vi,"helpEnabled");const Yl=T(e=>{const t=[];for(const[n,r]of Object.entries(e))if(t.push(n),r&&typeof r=="object"&&"alias"in r){const{alias:i}=r;typeof i=="string"&&i?t.push(i):Array.isArray(i)&&t.push(...i.filter(Boolean))}return t},"getKnownFlagNames"),ql=T((e,t)=>{if(e.length<3||t.length===0)return;const n=kl(e,t);return hi(e,n)<=2?n:void 0},"findClosestFlag"),Kl=T((e,t)=>{const n=Object.keys(e);if(n.length!==0){for(const r of n){const i=ql(r,t),s=i?` (Did you mean --${i}?)`:"";console.error(`Error: Unknown flag: --${r}.${s}`)}process.exit(1)}},"handleUnknownFlags");function bn(e,t,n,r){const i={...t.flags},s=t.version&&!("version"in i);s&&(i.version={type:Boolean,description:"Show version"});const{help:a}=t,u=vi(a);u&&!("help"in i)&&(i.help={type:Boolean,alias:"h",description:"Show help"});const c=ll(i,r,{ignore:t.ignoreArgv,booleanNegation:t.booleanFlagNegation??t.parent?.booleanFlagNegation}),d=T(()=>{console.log(t.version)},"showVersion");if(s&&c.flags.version===!0)return d(),process.exit(0);const l=new Vl,f=u&&a?.render?a.render:m=>l.render(m),h=T(m=>{const F=Gl({...t,...m?{help:m}:{},flags:i});console.log(f(F,l))},"showHelp");if(u&&c.flags.help===!0)return h(),process.exit(0);if((t.strictFlags??t.parent?.strictFlags)&&Kl(c.unknownFlags,Yl(i)),t.parameters){let{parameters:m}=t,F=c._;const g=m.indexOf("--"),w=m.slice(g+1),E=Object.create(null);let y=[];g>-1&&w.length>0&&(m=m.slice(0,g),y=c._["--"],F=F.slice(0,-y.length||void 0)),En(E,yn(m),F,h),g>-1&&w.length>0&&En(E,yn(w),y,h),Object.assign(c._,E)}const
|
|
22
|
+
`),r(),process.exit(1);e[c]=d}}o(En,"S"),T(En,"mapParametersToArguments");function vi(e){return e!==!1}o(vi,"se"),T(vi,"helpEnabled");const Yl=T(e=>{const t=[];for(const[n,r]of Object.entries(e))if(t.push(n),r&&typeof r=="object"&&"alias"in r){const{alias:i}=r;typeof i=="string"&&i?t.push(i):Array.isArray(i)&&t.push(...i.filter(Boolean))}return t},"getKnownFlagNames"),ql=T((e,t)=>{if(e.length<3||t.length===0)return;const n=kl(e,t);return hi(e,n)<=2?n:void 0},"findClosestFlag"),Kl=T((e,t)=>{const n=Object.keys(e);if(n.length!==0){for(const r of n){const i=ql(r,t),s=i?` (Did you mean --${i}?)`:"";console.error(`Error: Unknown flag: --${r}.${s}`)}process.exit(1)}},"handleUnknownFlags");function bn(e,t,n,r){const i={...t.flags},s=t.version&&!("version"in i);s&&(i.version={type:Boolean,description:"Show version"});const{help:a}=t,u=vi(a);u&&!("help"in i)&&(i.help={type:Boolean,alias:"h",description:"Show help"});const c=ll(i,r,{ignore:t.ignoreArgv,booleanNegation:t.booleanFlagNegation??t.parent?.booleanFlagNegation}),d=T(()=>{console.log(t.version)},"showVersion");if(s&&c.flags.version===!0)return d(),process.exit(0);const l=new Vl,f=u&&a?.render?a.render:m=>l.render(m),h=T(m=>{const F=Gl({...t,...m?{help:m}:{},flags:i});console.log(f(F,l))},"showHelp");if(u&&c.flags.help===!0)return h(),process.exit(0);if((t.strictFlags??t.parent?.strictFlags)&&Kl(c.unknownFlags,Yl(i)),t.parameters){let{parameters:m}=t,F=c._;const g=m.indexOf("--"),w=m.slice(g+1),E=Object.create(null);let y=[];g>-1&&w.length>0&&(m=m.slice(0,g),y=c._["--"],F=F.slice(0,-y.length||void 0)),En(E,yn(m),F,h),g>-1&&w.length>0&&En(E,yn(w),y,h),Object.assign(c._,E)}const p={...c,showVersion:d,showHelp:h},D={command:e,...p};if(typeof n=="function"){const m=n(p);if(m&&"then"in m)return Object.assign(Promise.resolve(m),D)}return D}o(bn,"I"),T(bn,"cliBase");function Ai(e,t){const n=new Map;for(const r of t){const i=[r.options.name],{alias:s}=r.options;s&&(Array.isArray(s)?i.push(...s):i.push(s));for(const a of i){if(n.has(a))throw new Error(`Duplicate command name found: ${x(a)}`);n.set(a,r)}}return n.get(e)}o(Ai,"ce"),T(Ai,"getCommand");function $i(e,t,n=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!wn(e.name)))throw new Error(`Invalid script name: ${x(e.name)}`);const r=n[0];if(e.commands&&r&&wn(r)){const i=Ai(r,e.commands);if(i)return bn(i.options.name,{...i.options,parent:e},i.callback,n.slice(1))}return bn(void 0,e,t,n)}o($i,"fe$1"),T($i,"cli");function Cn(e,t){if(!e)throw new Error("Command options are required");const{name:n}=e;if(n===void 0)throw new Error("Command name is required");if(!wn(n))throw new Error(`Invalid command name ${JSON.stringify(n)}. Command names must be one word.`);return{options:e,callback:t}}o(Cn,"de"),T(Cn,"command");var Zl="2.56.0",Jl="Writes your git commit messages for you with AI",Sn={version:Zl,description:Jl};function K(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}o(K,"isPlainObject");const vn=o((e,t)=>{const n=Ti(Xl(e));if(typeof n!="string")throw new TypeError(`${t} must be a string or a file URL: ${n}.`);return n},"safeNormalizeFileUrl"),Xl=o(e=>Bi(e)?e.toString():e,"normalizeDenoExecPath"),Bi=o(e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,"isDenoExecPath"),Ti=o(e=>e instanceof URL?$o(e):e,"normalizeFileUrl"),Ii=o((e,t=[],n={})=>{const r=vn(e,"First argument"),[i,s]=K(t)?[[],t]:[t,n];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);const a=i.map(String),u=a.find(c=>c.includes("\0"));if(u!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${u}`);if(!K(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,a,s]},"normalizeParameters"),{toString:Oi}=Object.prototype,Ql=o(e=>Oi.call(e)==="[object ArrayBuffer]","isArrayBuffer"),X=o(e=>Oi.call(e)==="[object Uint8Array]","isUint8Array"),Ke=o(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"bufferToUint8Array"),xl=new TextEncoder,Ri=o(e=>xl.encode(e),"stringToUint8Array"),ed=new TextDecoder,Mi=o(e=>ed.decode(e),"uint8ArrayToString"),td=o((e,t)=>nd(e,t).join(""),"joinToString"),nd=o((e,t)=>{if(t==="utf8"&&e.every(s=>typeof s=="string"))return e;const n=new To(t),r=e.map(s=>typeof s=="string"?Ri(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},"uint8ArraysToStrings"),An=o(e=>e.length===1&&X(e[0])?e[0]:_i(rd(e)),"joinToUint8Array"),rd=o(e=>e.map(t=>typeof t=="string"?Ri(t):t),"stringsToUint8Arrays"),_i=o(e=>{const t=new Uint8Array(od(e));let n=0;for(const r of e)t.set(r,n),n+=r.length;return t},"concatUint8Arrays"),od=o(e=>{let t=0;for(const n of e)t+=n.length;return t},"getJoinLength"),id=o(e=>Array.isArray(e)&&Array.isArray(e.raw),"isTemplateString"),sd=o((e,t)=>{let n=[];for(const[s,a]of e.entries())n=ad({templates:e,expressions:t,tokens:n,index:s,template:a});if(n.length===0)throw new TypeError("Template script must not be empty");const[r,...i]=n;return[r,i,{}]},"parseTemplates"),ad=o(({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[r]}`);const{nextTokens:s,leadingWhitespaces:a,trailingWhitespaces:u}=ud(i,e.raw[r]),c=Li(n,s,a);if(r===t.length)return c;const d=t[r],l=Array.isArray(d)?d.map(f=>Ni(f)):[Ni(d)];return Li(c,l,u)},"parseTemplate"),ud=o((e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=Pi.has(t[0]);for(let a=0,u=0;a<e.length;a+=1,u+=1){const c=t[u];if(Pi.has(c))r!==a&&n.push(e.slice(r,a)),r=a+1;else if(c==="\\"){const d=t[u+1];d===`
|
|
23
23
|
`?(a-=1,u+=1):d==="u"&&t[u+2]==="{"?u=t.indexOf("}",u+3):u+=cd[d]??1}}const s=r===e.length;return s||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},"splitByWhitespaces"),Pi=new Set([" "," ","\r",`
|
|
24
24
|
`]),cd={x:3,u:5},Li=o((e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],"concatTokens"),Ni=o(e=>{const t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(K(e)&&("stdout"in e||"isMaxBuffer"in e))return ld(e);throw e instanceof Bo||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},"parseExpression"),ld=o(({stdout:e})=>{if(typeof e=="string")return e;if(X(e))return Mi(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)},"getSubprocessResult"),Fe=o(e=>$n.includes(e),"isStandardStream"),$n=[I.stdin,I.stdout,I.stderr],ee=["stdin","stdout","stderr"],ki=o(e=>ee[e]??`stdio[${e}]`,"getStreamName"),dd=o(e=>{const t={...e};for(const n of Gi)t[n]=Ui(e,n);return t},"normalizeFdSpecificOptions"),Ui=o((e,t)=>{const n=Array.from({length:fd(e)+1}),r=hd(e[t],n,t);return Fd(r,t)},"normalizeFdSpecificOption"),fd=o(({stdio:e})=>Array.isArray(e)?Math.max(e.length,ee.length):ee.length,"getStdioLength"),hd=o((e,t,n)=>K(e)?Dd(e,t,n):t.fill(e),"normalizeFdSpecificValue"),Dd=o((e,t,n)=>{for(const r of Object.keys(e).sort(pd))for(const i of md(r,n,t))t[i]=e[r];return t},"normalizeOptionObject"),pd=o((e,t)=>ji(e)<ji(t)?1:-1,"compareFdName"),ji=o(e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,"getFdNameOrder"),md=o((e,t,n)=>{if(e==="ipc")return[n.length-1];const r=Wi(e);if(r===void 0||r===0)throw new TypeError(`"${t}.${e}" is invalid.
|
|
25
25
|
It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
|
|
@@ -28,7 +28,7 @@ Please set the "stdio" option to ensure that file descriptor exists.`);return r=
|
|
|
28
28
|
`),"escapeLines"),zi=o(e=>e.replaceAll(Ad,t=>Sd(t)),"escapeControlCharacters"),Sd=o(e=>{const t=$d[e];if(t!==void 0)return t;const n=e.codePointAt(0),r=n.toString(16);return n<=Bd?`\\u${r.padStart(4,"0")}`:`\\U${r}`},"escapeControlCharacter"),vd=o(()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},"getSpecialCharRegExp"),Ad=vd(),$d={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Bd=65535,Td=o(e=>Id.test(e)?e:Pc==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,"quoteString"),Id=/^[\w./-]+$/;function Od(){const{env:e}=I,{TERM:t,TERM_PROGRAM:n}=e;return I.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}o(Od,"isUnicodeSupported");const Vi={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Rd={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Md={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},_d={...Vi,...Rd},Pd={...Vi,...Md},Ld=Od(),_n=Ld?_d:Pd,Nd=_o?.WriteStream?.prototype?.hasColors?.()??!1,yt=o((e,t)=>{if(!Nd)return i=>i;const n=`\x1B[${e}m`,r=`\x1B[${t}m`;return i=>{const s=i+"";let a=s.indexOf(r);if(a===-1)return n+s+r;let u=n,c=0;const l=(t===22?r:"")+n;for(;a!==-1;)u+=s.slice(c,a)+l,c=a+r.length,a=s.indexOf(r,c);return u+=s.slice(c)+r,u}},"format"),kd=yt(1,22),Pn=yt(90,39),Ud=yt(91,39),jd=yt(93,39),Wd=o(({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:s=!1}={},options:{reject:a=!0}})=>{const u=Gd(n),c=zd[e]({failed:s,reject:a,piped:r}),d=Vd[e]({reject:a});return`${Pn(`[${u}]`)} ${Pn(`[${i}]`)} ${d(c)} ${d(t)}`},"defaultVerboseFunction"),Gd=o(e=>`${Et(e.getHours(),2)}:${Et(e.getMinutes(),2)}:${Et(e.getSeconds(),2)}.${Et(e.getMilliseconds(),3)}`,"serializeTimestamp"),Et=o((e,t)=>String(e).padStart(t,"0"),"padField"),Hi=o(({failed:e,reject:t})=>e?t?_n.cross:_n.warning:_n.tick,"getFinalIcon"),zd={command:o(({piped:e})=>e?"|":"$","command"),output:o(()=>" ","output"),ipc:o(()=>"*","ipc"),error:Hi,duration:Hi},Yi=o(e=>e,"identity$1"),Vd={command:o(()=>kd,"command"),output:o(()=>Yi,"output"),ipc:o(()=>Yi,"ipc"),error:o(({reject:e})=>e?Ud:jd,"error"),duration:o(()=>Pn,"duration")},Hd=o((e,t,n)=>{const r=Ed(t,n);return e.map(({verboseLine:i,verboseObject:s})=>Yd(i,s,r)).filter(i=>i!==void 0).map(i=>qd(i)).join("")},"applyVerboseOnLines"),Yd=o((e,t,n)=>{if(n===void 0)return e;const r=n(e,t);if(typeof r=="string")return r},"applyVerboseFunction"),qd=o(e=>e.endsWith(`
|
|
29
29
|
`)?e:`${e}
|
|
30
30
|
`,"appendNewline"),Je=o(({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{const s=Kd({type:e,result:i,verboseInfo:r}),a=Zd(t,s),u=Hd(a,r,n);u!==""&&console.warn(u.slice(0,-1))},"verboseLog"),Kd=o(({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...s}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:t,options:s}),"getVerboseObject"),Zd=o((e,t)=>e.split(`
|
|
31
|
-
`).map(n=>Jd({...t,message:n})),"getPrintedLines"),Jd=o(e=>({verboseLine:Wd(e),verboseObject:e}),"getPrintedLine"),qi=o(e=>{const t=typeof e=="string"?e:Io(e);return Mn(t).replaceAll(" "," ".repeat(Xd))},"serializeVerboseMessage"),Xd=2,Qd=o((e,t)=>{Bn(t)&&Je({type:"command",verboseMessage:e,verboseInfo:t})},"logCommand"),xd=o((e,t,n)=>{nf(e);const r=ef(e);return{verbose:e,escapedCommand:t,commandId:r,rawOptions:n}},"getVerboseInfo"),ef=o(e=>Bn({verbose:e})?tf++:void 0,"getCommandId");let tf=0n;const nf=o(e=>{for(const t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Rn.includes(t)&&!On(t)){const n=Rn.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${n} or a function.`)}}},"validateVerbose"),Ki=o(()=>Ro.bigint(),"getStartTime"),Zi=o(e=>Number(Ro.bigint()-e)/1e6,"getDurationMs"),Ji=o((e,t,n)=>{const r=Ki(),{command:i,escapedCommand:s}=Cd(e,t),a=Ui(n,"verbose"),u=xd(a,s,{...n});return Qd(s,u),{command:i,escapedCommand:s,startTime:r,verboseInfo:u}},"handleCommand");var rf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(Xi,"getDefaultExportFromCjs");var we={exports:{}},Ln,Qi;function of(){if(Qi)return Ln;Qi=1,Ln=r,r.sync=i;var e=un;function t(s,a){var u=a.pathExt!==void 0?a.pathExt:process.env.PATHEXT;if(!u||(u=u.split(";"),u.indexOf("")!==-1))return!0;for(var c=0;c<u.length;c++){var d=u[c].toLowerCase();if(d&&s.substr(-d.length).toLowerCase()===d)return!0}return!1}o(t,"checkPathExt");function n(s,a,u){return!s.isSymbolicLink()&&!s.isFile()?!1:t(a,u)}o(n,"checkStat");function r(s,a,u){e.stat(s,function(c,d){u(c,c?!1:n(d,s,a))})}o(r,"isexe");function i(s,a){return n(e.statSync(s),s,a)}return o(i,"sync"),Ln}o(of,"requireWindows");var Nn,xi;function sf(){if(xi)return Nn;xi=1,Nn=t,t.sync=n;var e=un;function t(s,a,u){e.stat(s,function(c,d){u(c,c?!1:r(d,a))})}o(t,"isexe");function n(s,a){return r(e.statSync(s),a)}o(n,"sync");function r(s,a){return s.isFile()&&i(s,a)}o(r,"checkStat");function i(s,a){var u=s.mode,c=s.uid,d=s.gid,l=a.uid!==void 0?a.uid:process.getuid&&process.getuid(),f=a.gid!==void 0?a.gid:process.getgid&&process.getgid(),h=parseInt("100",8),D=parseInt("010",8),p=parseInt("001",8),m=h|D,F=u&p||u&D&&d===f||u&h&&c===l||u&m&&l===0;return F}return o(i,"checkMode"),Nn}o(sf,"requireMode");var kn,es;function af(){if(es)return kn;es=1;var e;process.platform==="win32"||rf.TESTING_WINDOWS?e=of():e=sf(),kn=t,t.sync=n;function t(r,i,s){if(typeof i=="function"&&(s=i,i={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(a,u){t(r,i||{},function(c,d){c?u(c):a(d)})})}e(r,i||{},function(a,u){a&&(a.code==="EACCES"||i&&i.ignoreErrors)&&(a=null,u=!1),s(a,u)})}o(t,"isexe");function n(r,i){try{return e.sync(r,i||{})}catch(s){if(i&&i.ignoreErrors||s.code==="EACCES")return!1;throw s}}return o(n,"sync"),kn}o(af,"requireIsexe");var Un,ts;function uf(){if(ts)return Un;ts=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",t=ce,n=e?";":":",r=af(),i=o(c=>Object.assign(new Error(`not found: ${c}`),{code:"ENOENT"}),"getNotFoundError"),s=o((c,d)=>{const l=d.colon||n,f=c.match(/\//)||e&&c.match(/\\/)?[""]:[...e?[process.cwd()]:[],...(d.path||process.env.PATH||"").split(l)],h=e?d.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",D=e?h.split(l):[""];return e&&c.indexOf(".")!==-1&&D[0]!==""&&D.unshift(""),{pathEnv:f,pathExt:D,pathExtExe:h}},"getPathInfo"),a=o((c,d,l)=>{typeof d=="function"&&(l=d,d={}),d||(d={});const{pathEnv:f,pathExt:h,pathExtExe:D}=s(c,d),p=[],m=o(g=>new Promise((w,E)=>{if(g===f.length)return d.all&&p.length?w(p):E(i(c));const y=f[g],b=/^".*"$/.test(y)?y.slice(1,-1):y,v=t.join(b,c),S=!b&&/^\.[\\\/]/.test(c)?c.slice(0,2)+v:v;w(F(S,g,0))}),"step"),F=o((g,w,E)=>new Promise((y,b)=>{if(E===h.length)return y(m(w+1));const v=h[E];r(g+v,{pathExt:D},(S,A)=>{if(!S&&A)if(d.all)p.push(g+v);else return y(g+v);return y(F(g,w,E+1))})}),"subStep");return l?m(0).then(g=>l(null,g),l):m(0)},"which"),u=o((c,d)=>{d=d||{};const{pathEnv:l,pathExt:f,pathExtExe:h}=s(c,d),D=[];for(let p=0;p<l.length;p++){const m=l[p],F=/^".*"$/.test(m)?m.slice(1,-1):m,g=t.join(F,c),w=!F&&/^\.[\\\/]/.test(c)?c.slice(0,2)+g:g;for(let E=0;E<f.length;E++){const y=w+f[E];try{if(r.sync(y,{pathExt:h}))if(d.all)D.push(y);else return y}catch{}}}if(d.all&&D.length)return D;if(d.nothrow)return null;throw i(c)},"whichSync");return Un=a,a.sync=u,Un}o(uf,"requireWhich");var bt={exports:{}},ns;function cf(){if(ns)return bt.exports;ns=1;const e=o((t={})=>{const n=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"},"pathKey");return bt.exports=e,bt.exports.default=e,bt.exports}o(cf,"requirePathKey");var jn,rs;function lf(){if(rs)return jn;rs=1;const e=ce,t=uf(),n=cf();function r(s,a){const u=s.options.env||process.env,c=process.cwd(),d=s.options.cwd!=null,l=d&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(s.options.cwd)}catch{}let f;try{f=t.sync(s.command,{path:u[n({env:u})],pathExt:a?e.delimiter:void 0})}catch{}finally{l&&process.chdir(c)}return f&&(f=e.resolve(d?s.options.cwd:"",f)),f}o(r,"resolveCommandAttempt");function i(s){return r(s)||r(s,!0)}return o(i,"resolveCommand"),jn=i,jn}o(lf,"requireResolveCommand");var Ct={},os;function df(){if(os)return Ct;os=1;const e=/([()\][%!^"`<>&|;, *?])/g;function t(r){return r=r.replace(e,"^$1"),r}o(t,"escapeCommand");function n(r,i){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(e,"^$1"),i&&(r=r.replace(e,"^$1")),r}return o(n,"escapeArgument"),Ct.command=t,Ct.argument=n,Ct}o(df,"require_escape");var Wn,is;function ff(){return is||(is=1,Wn=/^#!(.*)/),Wn}o(ff,"requireShebangRegex");var Gn,ss;function hf(){if(ss)return Gn;ss=1;const e=ff();return Gn=o((t="")=>{const n=t.match(e);if(!n)return null;const[r,i]=n[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?i:i?`${s} ${i}`:s},"shebangCommand"),Gn}o(hf,"requireShebangCommand");var zn,as;function Df(){if(as)return zn;as=1;const e=un,t=hf();function n(r){const s=Buffer.alloc(150);let a;try{a=e.openSync(r,"r"),e.readSync(a,s,0,150,0),e.closeSync(a)}catch{}return t(s.toString())}return o(n,"readShebang"),zn=n,zn}o(Df,"requireReadShebang");var Vn,us;function pf(){if(us)return Vn;us=1;const e=ce,t=lf(),n=df(),r=Df(),i=process.platform==="win32",s=/\.(?:com|exe)$/i,a=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function u(l){l.file=t(l);const f=l.file&&r(l.file);return f?(l.args.unshift(l.file),l.command=f,t(l)):l.file}o(u,"detectShebang");function c(l){if(!i)return l;const f=u(l),h=!s.test(f);if(l.options.forceShell||h){const D=a.test(f);l.command=e.normalize(l.command),l.command=n.command(l.command),l.args=l.args.map(m=>n.argument(m,D));const p=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${p}"`],l.command=process.env.comspec||"cmd.exe",l.options.windowsVerbatimArguments=!0}return l}o(c,"parseNonShell");function d(l,f,h){f&&!Array.isArray(f)&&(h=f,f=null),f=f?f.slice(0):[],h=Object.assign({},h);const D={command:l,args:f,options:h,file:void 0,original:{command:l,args:f}};return h.shell?D:c(D)}return o(d,"parse"),Vn=d,Vn}o(pf,"requireParse");var Hn,cs;function mf(){if(cs)return Hn;cs=1;const e=process.platform==="win32";function t(s,a){return Object.assign(new Error(`${a} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${a} ${s.command}`,path:s.command,spawnargs:s.args})}o(t,"notFoundError");function n(s,a){if(!e)return;const u=s.emit;s.emit=function(c,d){if(c==="exit"){const l=r(d,a);if(l)return u.call(s,"error",l)}return u.apply(s,arguments)}}o(n,"hookChildProcess");function r(s,a){return e&&s===1&&!a.file?t(a.original,"spawn"):null}o(r,"verifyENOENT");function i(s,a){return e&&s===1&&!a.file?t(a.original,"spawnSync"):null}return o(i,"verifyENOENTSync"),Hn={hookChildProcess:n,verifyENOENT:r,verifyENOENTSync:i,notFoundError:t},Hn}o(mf,"requireEnoent");var ls;function gf(){if(ls)return we.exports;ls=1;const e=kc,t=pf(),n=mf();function r(s,a,u){const c=t(s,a,u),d=e.spawn(c.command,c.args,c.options);return n.hookChildProcess(d,c),d}o(r,"spawn");function i(s,a,u){const c=t(s,a,u),d=e.spawnSync(c.command,c.args,c.options);return d.error=d.error||n.verifyENOENTSync(d.status,c),d}return o(i,"spawnSync"),we.exports=r,we.exports.spawn=r,we.exports.sync=i,we.exports._parse=t,we.exports._enoent=n,we.exports}o(gf,"requireCrossSpawn");var Ff=gf(),wf=Xi(Ff);function ds(e={}){const{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}o(ds,"pathKey"),Oo(Tc);function Yn(e){return e instanceof URL?$o(e):e}o(Yn,"toPath");function yf(e){return{*[Symbol.iterator](){let t=Y.resolve(Yn(e)),n;for(;n!==t;)yield t,n=t,t=Y.resolve(t,"..")}}}o(yf,"traversePathUp");const Ef=o(({cwd:e=I.cwd(),path:t=I.env[ds()],preferLocal:n=!0,execPath:r=I.execPath,addExecPath:i=!0}={})=>{const s=Y.resolve(Yn(e)),a=[],u=t.split(Y.delimiter);return n&&bf(a,u,s),i&&Cf(a,u,r,s),t===""||t===Y.delimiter?`${a.join(Y.delimiter)}${t}`:[...a,t].join(Y.delimiter)},"npmRunPath"),bf=o((e,t,n)=>{for(const r of yf(n)){const i=Y.join(r,"node_modules/.bin");t.includes(i)||e.push(i)}},"applyPreferLocal"),Cf=o((e,t,n,r)=>{const i=Y.resolve(r,Yn(n),"..");t.includes(i)||e.push(i)},"applyExecPath"),Sf=o(({env:e=I.env,...t}={})=>{e={...e};const n=ds({env:e});return t.path=e[n],e[n]=Ef(t),e},"npmRunPathEnv"),vf=o((e,t,n)=>{const r=n?Qe:Xe,i=e instanceof ye?{}:{cause:e};return new r(t,i)},"getFinalError"),Do=class Do extends Error{};o(Do,"DiscardedError");let ye=Do;const fs=o((e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,hs,{value:!0,writable:!1,enumerable:!1,configurable:!1})},"setErrorName"),Af=o(e=>qn(e)&&hs in e,"isExecaError"),hs=Symbol("isExecaError"),qn=o(e=>Object.prototype.toString.call(e)==="[object Error]","isErrorInstance"),po=class po extends Error{};o(po,"ExecaError");let Xe=po;fs(Xe,Xe.name);const mo=class mo extends Error{};o(mo,"ExecaSyncError");let Qe=mo;fs(Qe,Qe.name);const $f=o(()=>{const e=ps-Ds+1;return Array.from({length:e},Bf)},"getRealtimeSignals"),Bf=o((e,t)=>({name:`SIGRT${t+1}`,number:Ds+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),"getRealtimeSignal"),Ds=34,ps=64,Tf=[{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"}],ms=o(()=>{const e=$f();return[...Tf,...e].map(If)},"getSignals"),If=o(({name:e,number:t,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[e]:a}}=me,u=a!==void 0;return{name:e,number:u?a:t,description:n,supported:u,action:r,forced:i,standard:s}},"normalizeSignal$1"),Of=o(()=>{const e=ms();return Object.fromEntries(e.map(Rf))},"getSignalsByName"),Rf=o(({name:e,number:t,description:n,supported:r,action:i,forced:s,standard:a})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:s,standard:a}],"getSignalByName"),Mf=Of(),_f=o(()=>{const e=ms(),t=ps+1,n=Array.from({length:t},(r,i)=>Pf(i,e));return Object.assign({},...n)},"getSignalsByNumber"),Pf=o((e,t)=>{const n=Lf(e,t);if(n===void 0)return{};const{name:r,description:i,supported:s,action:a,forced:u,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:s,action:a,forced:u,standard:c}}},"getSignalByNumber"),Lf=o((e,t)=>{const n=t.find(({name:r})=>me.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},"findSignalByNumber");_f();const Nf=o(e=>{const t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return gs(e,t)},"normalizeKillSignal"),kf=o(e=>e===0?e:gs(e,"`subprocess.kill()`'s argument"),"normalizeSignalArgument"),gs=o((e,t)=>{if(Number.isInteger(e))return Uf(e,t);if(typeof e=="string")return Wf(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
|
|
31
|
+
`).map(n=>Jd({...t,message:n})),"getPrintedLines"),Jd=o(e=>({verboseLine:Wd(e),verboseObject:e}),"getPrintedLine"),qi=o(e=>{const t=typeof e=="string"?e:Io(e);return Mn(t).replaceAll(" "," ".repeat(Xd))},"serializeVerboseMessage"),Xd=2,Qd=o((e,t)=>{Bn(t)&&Je({type:"command",verboseMessage:e,verboseInfo:t})},"logCommand"),xd=o((e,t,n)=>{nf(e);const r=ef(e);return{verbose:e,escapedCommand:t,commandId:r,rawOptions:n}},"getVerboseInfo"),ef=o(e=>Bn({verbose:e})?tf++:void 0,"getCommandId");let tf=0n;const nf=o(e=>{for(const t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Rn.includes(t)&&!On(t)){const n=Rn.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${n} or a function.`)}}},"validateVerbose"),Ki=o(()=>Ro.bigint(),"getStartTime"),Zi=o(e=>Number(Ro.bigint()-e)/1e6,"getDurationMs"),Ji=o((e,t,n)=>{const r=Ki(),{command:i,escapedCommand:s}=Cd(e,t),a=Ui(n,"verbose"),u=xd(a,s,{...n});return Qd(s,u),{command:i,escapedCommand:s,startTime:r,verboseInfo:u}},"handleCommand");var rf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(Xi,"getDefaultExportFromCjs");var we={exports:{}},Ln,Qi;function of(){if(Qi)return Ln;Qi=1,Ln=r,r.sync=i;var e=un;function t(s,a){var u=a.pathExt!==void 0?a.pathExt:process.env.PATHEXT;if(!u||(u=u.split(";"),u.indexOf("")!==-1))return!0;for(var c=0;c<u.length;c++){var d=u[c].toLowerCase();if(d&&s.substr(-d.length).toLowerCase()===d)return!0}return!1}o(t,"checkPathExt");function n(s,a,u){return!s.isSymbolicLink()&&!s.isFile()?!1:t(a,u)}o(n,"checkStat");function r(s,a,u){e.stat(s,function(c,d){u(c,c?!1:n(d,s,a))})}o(r,"isexe");function i(s,a){return n(e.statSync(s),s,a)}return o(i,"sync"),Ln}o(of,"requireWindows");var Nn,xi;function sf(){if(xi)return Nn;xi=1,Nn=t,t.sync=n;var e=un;function t(s,a,u){e.stat(s,function(c,d){u(c,c?!1:r(d,a))})}o(t,"isexe");function n(s,a){return r(e.statSync(s),a)}o(n,"sync");function r(s,a){return s.isFile()&&i(s,a)}o(r,"checkStat");function i(s,a){var u=s.mode,c=s.uid,d=s.gid,l=a.uid!==void 0?a.uid:process.getuid&&process.getuid(),f=a.gid!==void 0?a.gid:process.getgid&&process.getgid(),h=parseInt("100",8),p=parseInt("010",8),D=parseInt("001",8),m=h|p,F=u&D||u&p&&d===f||u&h&&c===l||u&m&&l===0;return F}return o(i,"checkMode"),Nn}o(sf,"requireMode");var kn,es;function af(){if(es)return kn;es=1;var e;process.platform==="win32"||rf.TESTING_WINDOWS?e=of():e=sf(),kn=t,t.sync=n;function t(r,i,s){if(typeof i=="function"&&(s=i,i={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(a,u){t(r,i||{},function(c,d){c?u(c):a(d)})})}e(r,i||{},function(a,u){a&&(a.code==="EACCES"||i&&i.ignoreErrors)&&(a=null,u=!1),s(a,u)})}o(t,"isexe");function n(r,i){try{return e.sync(r,i||{})}catch(s){if(i&&i.ignoreErrors||s.code==="EACCES")return!1;throw s}}return o(n,"sync"),kn}o(af,"requireIsexe");var Un,ts;function uf(){if(ts)return Un;ts=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",t=ce,n=e?";":":",r=af(),i=o(c=>Object.assign(new Error(`not found: ${c}`),{code:"ENOENT"}),"getNotFoundError"),s=o((c,d)=>{const l=d.colon||n,f=c.match(/\//)||e&&c.match(/\\/)?[""]:[...e?[process.cwd()]:[],...(d.path||process.env.PATH||"").split(l)],h=e?d.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",p=e?h.split(l):[""];return e&&c.indexOf(".")!==-1&&p[0]!==""&&p.unshift(""),{pathEnv:f,pathExt:p,pathExtExe:h}},"getPathInfo"),a=o((c,d,l)=>{typeof d=="function"&&(l=d,d={}),d||(d={});const{pathEnv:f,pathExt:h,pathExtExe:p}=s(c,d),D=[],m=o(g=>new Promise((w,E)=>{if(g===f.length)return d.all&&D.length?w(D):E(i(c));const y=f[g],b=/^".*"$/.test(y)?y.slice(1,-1):y,v=t.join(b,c),S=!b&&/^\.[\\\/]/.test(c)?c.slice(0,2)+v:v;w(F(S,g,0))}),"step"),F=o((g,w,E)=>new Promise((y,b)=>{if(E===h.length)return y(m(w+1));const v=h[E];r(g+v,{pathExt:p},(S,A)=>{if(!S&&A)if(d.all)D.push(g+v);else return y(g+v);return y(F(g,w,E+1))})}),"subStep");return l?m(0).then(g=>l(null,g),l):m(0)},"which"),u=o((c,d)=>{d=d||{};const{pathEnv:l,pathExt:f,pathExtExe:h}=s(c,d),p=[];for(let D=0;D<l.length;D++){const m=l[D],F=/^".*"$/.test(m)?m.slice(1,-1):m,g=t.join(F,c),w=!F&&/^\.[\\\/]/.test(c)?c.slice(0,2)+g:g;for(let E=0;E<f.length;E++){const y=w+f[E];try{if(r.sync(y,{pathExt:h}))if(d.all)p.push(y);else return y}catch{}}}if(d.all&&p.length)return p;if(d.nothrow)return null;throw i(c)},"whichSync");return Un=a,a.sync=u,Un}o(uf,"requireWhich");var bt={exports:{}},ns;function cf(){if(ns)return bt.exports;ns=1;const e=o((t={})=>{const n=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"},"pathKey");return bt.exports=e,bt.exports.default=e,bt.exports}o(cf,"requirePathKey");var jn,rs;function lf(){if(rs)return jn;rs=1;const e=ce,t=uf(),n=cf();function r(s,a){const u=s.options.env||process.env,c=process.cwd(),d=s.options.cwd!=null,l=d&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(s.options.cwd)}catch{}let f;try{f=t.sync(s.command,{path:u[n({env:u})],pathExt:a?e.delimiter:void 0})}catch{}finally{l&&process.chdir(c)}return f&&(f=e.resolve(d?s.options.cwd:"",f)),f}o(r,"resolveCommandAttempt");function i(s){return r(s)||r(s,!0)}return o(i,"resolveCommand"),jn=i,jn}o(lf,"requireResolveCommand");var Ct={},os;function df(){if(os)return Ct;os=1;const e=/([()\][%!^"`<>&|;, *?])/g;function t(r){return r=r.replace(e,"^$1"),r}o(t,"escapeCommand");function n(r,i){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(e,"^$1"),i&&(r=r.replace(e,"^$1")),r}return o(n,"escapeArgument"),Ct.command=t,Ct.argument=n,Ct}o(df,"require_escape");var Wn,is;function ff(){return is||(is=1,Wn=/^#!(.*)/),Wn}o(ff,"requireShebangRegex");var Gn,ss;function hf(){if(ss)return Gn;ss=1;const e=ff();return Gn=o((t="")=>{const n=t.match(e);if(!n)return null;const[r,i]=n[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?i:i?`${s} ${i}`:s},"shebangCommand"),Gn}o(hf,"requireShebangCommand");var zn,as;function Df(){if(as)return zn;as=1;const e=un,t=hf();function n(r){const s=Buffer.alloc(150);let a;try{a=e.openSync(r,"r"),e.readSync(a,s,0,150,0),e.closeSync(a)}catch{}return t(s.toString())}return o(n,"readShebang"),zn=n,zn}o(Df,"requireReadShebang");var Vn,us;function pf(){if(us)return Vn;us=1;const e=ce,t=lf(),n=df(),r=Df(),i=process.platform==="win32",s=/\.(?:com|exe)$/i,a=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function u(l){l.file=t(l);const f=l.file&&r(l.file);return f?(l.args.unshift(l.file),l.command=f,t(l)):l.file}o(u,"detectShebang");function c(l){if(!i)return l;const f=u(l),h=!s.test(f);if(l.options.forceShell||h){const p=a.test(f);l.command=e.normalize(l.command),l.command=n.command(l.command),l.args=l.args.map(m=>n.argument(m,p));const D=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${D}"`],l.command=process.env.comspec||"cmd.exe",l.options.windowsVerbatimArguments=!0}return l}o(c,"parseNonShell");function d(l,f,h){f&&!Array.isArray(f)&&(h=f,f=null),f=f?f.slice(0):[],h=Object.assign({},h);const p={command:l,args:f,options:h,file:void 0,original:{command:l,args:f}};return h.shell?p:c(p)}return o(d,"parse"),Vn=d,Vn}o(pf,"requireParse");var Hn,cs;function mf(){if(cs)return Hn;cs=1;const e=process.platform==="win32";function t(s,a){return Object.assign(new Error(`${a} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${a} ${s.command}`,path:s.command,spawnargs:s.args})}o(t,"notFoundError");function n(s,a){if(!e)return;const u=s.emit;s.emit=function(c,d){if(c==="exit"){const l=r(d,a);if(l)return u.call(s,"error",l)}return u.apply(s,arguments)}}o(n,"hookChildProcess");function r(s,a){return e&&s===1&&!a.file?t(a.original,"spawn"):null}o(r,"verifyENOENT");function i(s,a){return e&&s===1&&!a.file?t(a.original,"spawnSync"):null}return o(i,"verifyENOENTSync"),Hn={hookChildProcess:n,verifyENOENT:r,verifyENOENTSync:i,notFoundError:t},Hn}o(mf,"requireEnoent");var ls;function gf(){if(ls)return we.exports;ls=1;const e=kc,t=pf(),n=mf();function r(s,a,u){const c=t(s,a,u),d=e.spawn(c.command,c.args,c.options);return n.hookChildProcess(d,c),d}o(r,"spawn");function i(s,a,u){const c=t(s,a,u),d=e.spawnSync(c.command,c.args,c.options);return d.error=d.error||n.verifyENOENTSync(d.status,c),d}return o(i,"spawnSync"),we.exports=r,we.exports.spawn=r,we.exports.sync=i,we.exports._parse=t,we.exports._enoent=n,we.exports}o(gf,"requireCrossSpawn");var Ff=gf(),wf=Xi(Ff);function ds(e={}){const{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}o(ds,"pathKey"),Oo(Tc);function Yn(e){return e instanceof URL?$o(e):e}o(Yn,"toPath");function yf(e){return{*[Symbol.iterator](){let t=Y.resolve(Yn(e)),n;for(;n!==t;)yield t,n=t,t=Y.resolve(t,"..")}}}o(yf,"traversePathUp");const Ef=o(({cwd:e=I.cwd(),path:t=I.env[ds()],preferLocal:n=!0,execPath:r=I.execPath,addExecPath:i=!0}={})=>{const s=Y.resolve(Yn(e)),a=[],u=t.split(Y.delimiter);return n&&bf(a,u,s),i&&Cf(a,u,r,s),t===""||t===Y.delimiter?`${a.join(Y.delimiter)}${t}`:[...a,t].join(Y.delimiter)},"npmRunPath"),bf=o((e,t,n)=>{for(const r of yf(n)){const i=Y.join(r,"node_modules/.bin");t.includes(i)||e.push(i)}},"applyPreferLocal"),Cf=o((e,t,n,r)=>{const i=Y.resolve(r,Yn(n),"..");t.includes(i)||e.push(i)},"applyExecPath"),Sf=o(({env:e=I.env,...t}={})=>{e={...e};const n=ds({env:e});return t.path=e[n],e[n]=Ef(t),e},"npmRunPathEnv"),vf=o((e,t,n)=>{const r=n?Qe:Xe,i=e instanceof ye?{}:{cause:e};return new r(t,i)},"getFinalError"),Do=class Do extends Error{};o(Do,"DiscardedError");let ye=Do;const fs=o((e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,hs,{value:!0,writable:!1,enumerable:!1,configurable:!1})},"setErrorName"),Af=o(e=>qn(e)&&hs in e,"isExecaError"),hs=Symbol("isExecaError"),qn=o(e=>Object.prototype.toString.call(e)==="[object Error]","isErrorInstance"),po=class po extends Error{};o(po,"ExecaError");let Xe=po;fs(Xe,Xe.name);const mo=class mo extends Error{};o(mo,"ExecaSyncError");let Qe=mo;fs(Qe,Qe.name);const $f=o(()=>{const e=ps-Ds+1;return Array.from({length:e},Bf)},"getRealtimeSignals"),Bf=o((e,t)=>({name:`SIGRT${t+1}`,number:Ds+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),"getRealtimeSignal"),Ds=34,ps=64,Tf=[{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"}],ms=o(()=>{const e=$f();return[...Tf,...e].map(If)},"getSignals"),If=o(({name:e,number:t,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[e]:a}}=me,u=a!==void 0;return{name:e,number:u?a:t,description:n,supported:u,action:r,forced:i,standard:s}},"normalizeSignal$1"),Of=o(()=>{const e=ms();return Object.fromEntries(e.map(Rf))},"getSignalsByName"),Rf=o(({name:e,number:t,description:n,supported:r,action:i,forced:s,standard:a})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:s,standard:a}],"getSignalByName"),Mf=Of(),_f=o(()=>{const e=ms(),t=ps+1,n=Array.from({length:t},(r,i)=>Pf(i,e));return Object.assign({},...n)},"getSignalsByNumber"),Pf=o((e,t)=>{const n=Lf(e,t);if(n===void 0)return{};const{name:r,description:i,supported:s,action:a,forced:u,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:s,action:a,forced:u,standard:c}}},"getSignalByNumber"),Lf=o((e,t)=>{const n=t.find(({name:r})=>me.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},"findSignalByNumber");_f();const Nf=o(e=>{const t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return gs(e,t)},"normalizeKillSignal"),kf=o(e=>e===0?e:gs(e,"`subprocess.kill()`'s argument"),"normalizeSignalArgument"),gs=o((e,t)=>{if(Number.isInteger(e))return Uf(e,t);if(typeof e=="string")return Wf(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
|
|
32
32
|
${Kn()}`)},"normalizeSignal"),Uf=o((e,t)=>{if(Fs.has(e))return Fs.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
|
|
33
33
|
${Kn()}`)},"normalizeSignalInteger"),jf=o(()=>new Map(Object.entries(me.signals).reverse().map(([e,t])=>[t,e])),"getSignalsIntegerToName"),Fs=jf(),Wf=o((e,t)=>{if(e in me.signals)return e;throw e.toUpperCase()in me.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
|
|
34
34
|
${Kn()}`)},"normalizeSignalName"),Kn=o(()=>`Available signal names: ${Gf()}.
|
|
@@ -48,22 +48,22 @@ Please rename it to one of: ${n}.`)},"validateEncoding"),Qh=new Set(["utf8","utf
|
|
|
48
48
|
${e.message}`,e}},"getDefaultCwd"),tD=o((e,t)=>{if(t===ks())return e;let n;try{n=zc(t)}catch(r){return`The "cwd" option is invalid: ${t}.
|
|
49
49
|
${r.message}
|
|
50
50
|
${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
|
|
51
|
-
${e}`},"fixCwdError"),Us=o((e,t,n)=>{n.cwd=eD(n.cwd);const[r,i,s]=Hh(e,t,n),{command:a,args:u,options:c}=wf._parse(r,i,s),d=dd(c),l=nD(d);return Wh(l),Xh(l),Yh(l),Jf(l),Nh(l),l.shell=Ti(l.shell),l.env=rD(l),l.killSignal=Nf(l.killSignal),l.forceKillAfterDelay=Vf(l.forceKillAfterDelay),l.lines=l.lines.map((f,h)=>f&&!be.has(l.encoding)&&l.buffer[h]),I.platform==="win32"&&Y.basename(a,".exe")==="cmd"&&u.unshift("/q"),{file:a,commandArguments:u,options:l}},"normalizeOptions"),nD=o(({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i="utf8",reject:s=!0,cleanup:a=!0,all:u=!1,windowsHide:c=!0,killSignal:d="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:f=!1,ipcInput:h,ipc:
|
|
52
|
-
`,sD=Ws.codePointAt(0),Gs="\r",aD=Gs.codePointAt(0);function Ce(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}o(Ce,"isStream");function zs(e,{checkOpen:t=!0}={}){return Ce(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}o(zs,"isWritableStream$1");function Ot(e,{checkOpen:t=!0}={}){return Ce(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}o(Ot,"isReadableStream$1");function Vs(e,t){return zs(e,t)&&Ot(e,t)}o(Vs,"isDuplexStream");var Hs=o(e=>{throw TypeError(e)},"__typeError$2"),sr=o((e,t,n)=>t.has(e)||Hs("Cannot "+n),"__accessCheck$2"),z=o((e,t,n)=>(sr(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet$2"),nt=o((e,t,n)=>t.has(e)?Hs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd$2"),he=o((e,t,n,r)=>(sr(e,t,"write to private field"),t.set(e,n),n),"__privateSet$2"),Ys=o((e,t,n)=>(sr(e,t,"access private method"),n),"__privateMethod$1"),se,Rt,Se,te,Mt,qs,Ks;const uD=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),go=class go{constructor(t,n){nt(this,Mt),nt(this,se),nt(this,Rt),nt(this,Se,!1),nt(this,te),he(this,se,t),he(this,Rt,n)}next(){const t=o(()=>Ys(this,Mt,qs).call(this),"e");return he(this,te,z(this,te)?z(this,te).then(t,t):t()),z(this,te)}return(t){const n=o(()=>Ys(this,Mt,Ks).call(this,t),"t");return z(this,te)?z(this,te).then(n,n):n()}};o(go,"c");let ar=go;se=new WeakMap,Rt=new WeakMap,Se=new WeakMap,te=new WeakMap,Mt=new WeakSet,qs=o(async function(){if(z(this,Se))return{done:!0,value:void 0};let e;try{e=await z(this,se).read()}catch(t){throw he(this,te,void 0),he(this,Se,!0),z(this,se).releaseLock(),t}return e.done&&(he(this,te,void 0),he(this,Se,!0),z(this,se).releaseLock()),e},"s_fn"),Ks=o(async function(e){if(z(this,Se))return{done:!0,value:e};if(he(this,Se,!0),!z(this,Rt)){const t=z(this,se).cancel(e);return z(this,se).releaseLock(),await t,{done:!0,value:e}}return z(this,se).releaseLock(),{done:!0,value:e}},"i_fn");const ur=Symbol();function Zs(){return this[ur].next()}o(Zs,"i"),Object.defineProperty(Zs,"name",{value:"next"});function Js(e){return this[ur].return(e)}o(Js,"o"),Object.defineProperty(Js,"name",{value:"return"});const cD=Object.create(uD,{next:{enumerable:!0,configurable:!0,writable:!0,value:Zs},return:{enumerable:!0,configurable:!0,writable:!0,value:Js}});function lD({preventCancel:e=!1}={}){const t=this.getReader(),n=new ar(t,e),r=Object.create(cD);return r[ur]=n,r}o(lD,"h");const dD=o(e=>{if(Ot(e,{checkOpen:!1})&&cr.on!==void 0)return hD(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(fD.call(e)==="[object ReadableStream]")return lD.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},"getAsyncIterable"),{toString:fD}=Object.prototype,hD=o(async function*(e){const t=new AbortController,n={};DD(e,t,n);try{for await(const[r]of cr.on(e,"data",{signal:t.signal}))yield r}catch(r){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw r}finally{e.destroy()}},"getStreamIterable"),DD=o(async(e,t,n)=>{try{await cr.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{t.abort()}},"handleStreamEnd"),cr={};var pD=Object.defineProperty,mD=o((e,t,n)=>t in e?pD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$2"),gD=o((e,t,n)=>mD(e,t+"",n),"__publicField$2");const lr=o(async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,finalize:u},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const d=dD(e),l=t();l.length=0;try{for await(const f of d){const h=wD(f),
|
|
51
|
+
${e}`},"fixCwdError"),Us=o((e,t,n)=>{n.cwd=eD(n.cwd);const[r,i,s]=Hh(e,t,n),{command:a,args:u,options:c}=wf._parse(r,i,s),d=dd(c),l=nD(d);return Wh(l),Xh(l),Yh(l),Jf(l),Nh(l),l.shell=Ti(l.shell),l.env=rD(l),l.killSignal=Nf(l.killSignal),l.forceKillAfterDelay=Vf(l.forceKillAfterDelay),l.lines=l.lines.map((f,h)=>f&&!be.has(l.encoding)&&l.buffer[h]),I.platform==="win32"&&Y.basename(a,".exe")==="cmd"&&u.unshift("/q"),{file:a,commandArguments:u,options:l}},"normalizeOptions"),nD=o(({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i="utf8",reject:s=!0,cleanup:a=!0,all:u=!1,windowsHide:c=!0,killSignal:d="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:f=!1,ipcInput:h,ipc:p=h!==void 0||f,serialization:D="advanced",...m})=>({...m,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:s,cleanup:a,all:u,windowsHide:c,killSignal:d,forceKillAfterDelay:l,gracefulCancel:f,ipcInput:h,ipc:p,serialization:D}),"addDefaultOptions"),rD=o(({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const a=t?{...I.env,...e}:e;return n||r?Sf({env:a,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):a},"getEnv"),js=o((e,t,n)=>n.shell&&t.length>0?[[e,...t].join(" "),[],n]:[e,t,n],"concatenateShell");function ir(e){if(typeof e=="string")return oD(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return iD(e)}o(ir,"stripFinalNewline");const oD=o(e=>e.at(-1)===Ws?e.slice(0,e.at(-2)===Gs?-2:-1):e,"stripFinalNewlineString"),iD=o(e=>e.at(-1)===sD?e.subarray(0,e.at(-2)===aD?-2:-1):e,"stripFinalNewlineBinary"),Ws=`
|
|
52
|
+
`,sD=Ws.codePointAt(0),Gs="\r",aD=Gs.codePointAt(0);function Ce(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}o(Ce,"isStream");function zs(e,{checkOpen:t=!0}={}){return Ce(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}o(zs,"isWritableStream$1");function Ot(e,{checkOpen:t=!0}={}){return Ce(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}o(Ot,"isReadableStream$1");function Vs(e,t){return zs(e,t)&&Ot(e,t)}o(Vs,"isDuplexStream");var Hs=o(e=>{throw TypeError(e)},"__typeError$2"),sr=o((e,t,n)=>t.has(e)||Hs("Cannot "+n),"__accessCheck$2"),z=o((e,t,n)=>(sr(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet$2"),nt=o((e,t,n)=>t.has(e)?Hs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd$2"),he=o((e,t,n,r)=>(sr(e,t,"write to private field"),t.set(e,n),n),"__privateSet$2"),Ys=o((e,t,n)=>(sr(e,t,"access private method"),n),"__privateMethod$1"),se,Rt,Se,te,Mt,qs,Ks;const uD=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),go=class go{constructor(t,n){nt(this,Mt),nt(this,se),nt(this,Rt),nt(this,Se,!1),nt(this,te),he(this,se,t),he(this,Rt,n)}next(){const t=o(()=>Ys(this,Mt,qs).call(this),"e");return he(this,te,z(this,te)?z(this,te).then(t,t):t()),z(this,te)}return(t){const n=o(()=>Ys(this,Mt,Ks).call(this,t),"t");return z(this,te)?z(this,te).then(n,n):n()}};o(go,"c");let ar=go;se=new WeakMap,Rt=new WeakMap,Se=new WeakMap,te=new WeakMap,Mt=new WeakSet,qs=o(async function(){if(z(this,Se))return{done:!0,value:void 0};let e;try{e=await z(this,se).read()}catch(t){throw he(this,te,void 0),he(this,Se,!0),z(this,se).releaseLock(),t}return e.done&&(he(this,te,void 0),he(this,Se,!0),z(this,se).releaseLock()),e},"s_fn"),Ks=o(async function(e){if(z(this,Se))return{done:!0,value:e};if(he(this,Se,!0),!z(this,Rt)){const t=z(this,se).cancel(e);return z(this,se).releaseLock(),await t,{done:!0,value:e}}return z(this,se).releaseLock(),{done:!0,value:e}},"i_fn");const ur=Symbol();function Zs(){return this[ur].next()}o(Zs,"i"),Object.defineProperty(Zs,"name",{value:"next"});function Js(e){return this[ur].return(e)}o(Js,"o"),Object.defineProperty(Js,"name",{value:"return"});const cD=Object.create(uD,{next:{enumerable:!0,configurable:!0,writable:!0,value:Zs},return:{enumerable:!0,configurable:!0,writable:!0,value:Js}});function lD({preventCancel:e=!1}={}){const t=this.getReader(),n=new ar(t,e),r=Object.create(cD);return r[ur]=n,r}o(lD,"h");const dD=o(e=>{if(Ot(e,{checkOpen:!1})&&cr.on!==void 0)return hD(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(fD.call(e)==="[object ReadableStream]")return lD.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},"getAsyncIterable"),{toString:fD}=Object.prototype,hD=o(async function*(e){const t=new AbortController,n={};DD(e,t,n);try{for await(const[r]of cr.on(e,"data",{signal:t.signal}))yield r}catch(r){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw r}finally{e.destroy()}},"getStreamIterable"),DD=o(async(e,t,n)=>{try{await cr.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{t.abort()}},"handleStreamEnd"),cr={};var pD=Object.defineProperty,mD=o((e,t,n)=>t in e?pD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$2"),gD=o((e,t,n)=>mD(e,t+"",n),"__publicField$2");const lr=o(async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,finalize:u},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const d=dD(e),l=t();l.length=0;try{for await(const f of d){const h=wD(f),p=n[h](f,l);Xs({convertedChunk:p,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:c})}return FD({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,maxBuffer:c}),u(l)}catch(f){const h=typeof f=="object"&&f!==null?f:new Error(f);throw h.bufferedData=u(l),h}},"getStreamContents$1"),FD=o(({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const a=i(e);a!==void 0&&Xs({convertedChunk:a,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:s})},"appendFinalChunk"),Xs=o(({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const a=n(e),u=t.length+a;if(u<=s){Qs(e,t,i,u);return}const c=r(e,s-t.length);throw c!==void 0&&Qs(c,t,i,s),new _e},"appendChunk"),Qs=o((e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},"addNewChunk"),wD=o(e=>{const t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";const n=xs.call(e);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&xs.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},"getChunkType"),{toString:xs}=Object.prototype,Fo=class Fo extends Error{constructor(){super("maxBuffer exceeded"),gD(this,"name","MaxBufferError")}};o(Fo,"MaxBufferError");let _e=Fo;const ve=o(e=>e,"identity"),dr=o(()=>{},"noop$1"),ea=o(({contents:e})=>e,"getContentsProperty"),ta=o(e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},"throwObjectStream"),na=o(e=>e.length,"getLengthProperty");async function yD(e,t){return lr(e,SD,t)}o(yD,"getStreamAsArray");const ED=o(()=>({contents:[]}),"initArray"),bD=o(()=>1,"increment"),CD=o((e,{contents:t})=>(t.push(e),t),"addArrayChunk"),SD={init:ED,convertChunk:{string:ve,buffer:ve,arrayBuffer:ve,dataView:ve,typedArray:ve,others:ve},getSize:bD,truncateChunk:dr,addChunk:CD,getFinalChunk:dr,finalize:ea};async function vD(e,t){return lr(e,_D,t)}o(vD,"getStreamAsArrayBuffer");const AD=o(()=>({contents:new ArrayBuffer(0)}),"initArrayBuffer"),$D=o(e=>BD.encode(e),"useTextEncoder"),BD=new TextEncoder,ra=o(e=>new Uint8Array(e),"useUint8Array"),oa=o(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"useUint8ArrayWithOffset"),TD=o((e,t)=>e.slice(0,t),"truncateArrayBufferChunk"),ID=o((e,{contents:t,length:n},r)=>{const i=aa()?RD(t,r):OD(t,r);return new Uint8Array(i).set(e,n),i},"addArrayBufferChunk"),OD=o((e,t)=>{if(t<=e.byteLength)return e;const n=new ArrayBuffer(ia(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},"resizeArrayBufferSlow"),RD=o((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;const n=new ArrayBuffer(t,{maxByteLength:ia(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},"resizeArrayBuffer"),ia=o(e=>sa**Math.ceil(Math.log(e)/Math.log(sa)),"getNewContentsLength"),sa=2,MD=o(({contents:e,length:t})=>aa()?e:e.slice(0,t),"finalizeArrayBuffer"),aa=o(()=>"resize"in ArrayBuffer.prototype,"hasArrayBufferResize"),_D={init:AD,convertChunk:{string:$D,buffer:ra,arrayBuffer:ra,dataView:oa,typedArray:oa,others:ta},getSize:na,truncateChunk:TD,addChunk:ID,getFinalChunk:dr,finalize:MD};async function PD(e,t){return lr(e,jD,t)}o(PD,"getStreamAsString");const LD=o(()=>({contents:"",textDecoder:new TextDecoder}),"initString"),_t=o((e,{textDecoder:t})=>t.decode(e,{stream:!0}),"useTextDecoder"),ND=o((e,{contents:t})=>t+e,"addStringChunk"),kD=o((e,t)=>e.slice(0,t),"truncateStringChunk"),UD=o(({textDecoder:e})=>{const t=e.decode();return t===""?void 0:t},"getFinalStringChunk"),jD={init:LD,convertChunk:{string:ve,buffer:_t,arrayBuffer:_t,dataView:_t,typedArray:_t,others:ta},getSize:na,truncateChunk:kD,addChunk:ND,getFinalChunk:UD,finalize:ea},WD=o(({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(e instanceof _e))throw e;if(s==="all")return e;const a=GD(n,r,i);throw e.maxBufferInfo={fdNumber:s,unit:a},t.destroy(),e},"handleMaxBuffer"),GD=o((e,t,n)=>e?"objects":t?"lines":n==="buffer"?"bytes":"characters","getMaxBufferUnit"),zD=o((e,t,n)=>{if(t.length!==n)return;const r=new _e;throw r.maxBufferInfo={fdNumber:"ipc"},r},"checkIpcMaxBuffer"),VD=o((e,t)=>{const{streamName:n,threshold:r,unit:i}=HD(e,t);return`Command's ${n} was larger than ${r} ${i}`},"getMaxBufferMessage"),HD=o((e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;const i=Ze(t,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:ki(n),threshold:i,unit:r}},"getMaxBufferInfo"),YD=o((e,t,n)=>e?.code==="ENOBUFS"&&t!==null&&t.some(r=>r!==null&&r.length>fr(n)),"isMaxBufferSync"),qD=o((e,t,n)=>{if(!t)return e;const r=fr(n);return e.length>r?e.slice(0,r):e},"truncateMaxBufferSync"),fr=o(([,e])=>e,"getMaxBufferSync"),KD=o(({stdio:e,all:t,ipcOutput:n,originalError:r,signal:i,signalDescription:s,exitCode:a,escapedCommand:u,timedOut:c,isCanceled:d,isGracefullyCanceled:l,isMaxBuffer:f,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:D,maxBuffer:m,timeout:F,cwd:g})=>{const w=r?.code,E=ZD({originalError:r,timedOut:c,timeout:F,isMaxBuffer:f,maxBuffer:m,errorCode:w,signal:i,signalDescription:s,exitCode:a,isCanceled:d,isGracefullyCanceled:l,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:D}),y=XD(r,g),b=y===void 0?"":`
|
|
53
53
|
${y}`,v=`${E}: ${u}${b}`,S=t===void 0?[e[2],e[1]]:[t],A=[v,...S,...e.slice(3),n.map(_=>QD(_)).join(`
|
|
54
54
|
`)].map(_=>Mn(ir(xD(_)))).filter(Boolean).join(`
|
|
55
55
|
|
|
56
|
-
`);return{originalMessage:y,shortMessage:v,message:A}},"createMessages"),ZD=o(({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:s,signal:a,signalDescription:u,exitCode:c,isCanceled:d,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:h,killSignal:
|
|
57
|
-
`):ua(e),"serializeMessagePart"),ua=o(e=>typeof e=="string"?e:X(e)?Mi(e):"","serializeMessageItem"),ca=o(({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:a})=>la({command:e,escapedCommand:t,cwd:s,durationMs:Zi(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),"makeSuccessResult"),hr=o(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:a})=>Dr({error:e,command:t,escapedCommand:n,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:a}),"makeEarlyError"),Dr=o(({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:d,signal:l,stdio:f,all:h,ipcOutput:D,options:{timeoutDuration:p,timeout:m=p,forceKillAfterDelay:F,killSignal:g,cwd:w,maxBuffer:E},isSync:y})=>{const{exitCode:b,signal:v,signalDescription:S}=tp(d,l),{originalMessage:A,shortMessage:_,message:J}=KD({stdio:f,all:h,ipcOutput:D,originalError:e,signal:v,signalDescription:S,exitCode:b,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,forceKillAfterDelay:F,killSignal:g,maxBuffer:E,timeout:m,cwd:w}),H=vf(e,J,y);return Object.assign(H,ep({error:H,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:b,signal:v,signalDescription:S,stdio:f,all:h,ipcOutput:D,cwd:w,originalMessage:A,shortMessage:_})),H},"makeError"),ep=o(({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:d,signal:l,signalDescription:f,stdio:h,all:D,ipcOutput:p,cwd:m,originalMessage:F,shortMessage:g})=>la({shortMessage:g,originalMessage:F,command:t,escapedCommand:n,cwd:m,durationMs:Zi(r),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isTerminated:l!==void 0,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:d,signal:l,signalDescription:f,code:e.cause?.code,stdout:h[1],stderr:h[2],all:D,stdio:h,ipcOutput:p,pipedFrom:[]}),"getErrorProperties"),la=o(e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),"omitUndefinedProperties"),tp=o((e,t)=>{const n=e===null?void 0:e,r=t===null?void 0:t,i=r===void 0?void 0:ws(t);return{exitCode:n,signal:r,signalDescription:i}},"normalizeExitPayload"),da=o(e=>Number.isFinite(e)?e:0,"toZeroIfInfinity");function np(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(da(e*1e3)%1e3),nanoseconds:Math.trunc(da(e*1e6)%1e3)}}o(np,"parseNumber");function rp(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}o(rp,"parseBigint");function op(e){switch(typeof e){case"number":{if(Number.isFinite(e))return np(e);break}case"bigint":return rp(e)}throw new TypeError("Expected a finite number or bigint")}o(op,"parseMilliseconds");const ip=o(e=>e===0||e===0n,"isZero"),sp=o((e,t)=>t===1||t===1n?e:`${e}s`,"pluralize"),ap=1e-7,up=24n*60n*60n*1000n;function cp(e,t){const n=typeof e=="bigint";if(!n&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};const r=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[];const s=o((l,f)=>{const h=Math.floor(l*10**f+ap);return(Math.round(h)/10**f).toFixed(f)},"floorDecimals"),a=o((l,f,h,D)=>{if(!((i.length===0||!t.colonNotation)&&ip(l)&&!(t.colonNotation&&h==="m"))){if(D??(D=String(l)),t.colonNotation){const p=D.includes(".")?D.split(".")[0].length:D.length,m=i.length>0?2:1;D="0".repeat(Math.max(0,m-p))+D}else D+=t.verbose?" "+sp(f,l):h;i.push(D)}},"add"),u=op(e),c=BigInt(u.days);if(t.hideYearAndDays?a(BigInt(c)*24n+BigInt(u.hours),"hour","h"):(t.hideYear?a(c,"day","d"):(a(c/365n,"year","y"),a(c%365n,"day","d")),a(Number(u.hours),"hour","h")),a(Number(u.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){const l=Number(u.seconds),f=Number(u.milliseconds),h=Number(u.microseconds),D=Number(u.nanoseconds);if(a(l,"second","s"),t.formatSubMilliseconds)a(f,"millisecond","ms"),a(h,"microsecond","\xB5s"),a(D,"nanosecond","ns");else{const p=f+h/1e3+D/1e6,m=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,F=p>=1?Math.round(p):Math.ceil(p),g=m?p.toFixed(m):F;a(Number.parseFloat(g),"millisecond","ms",g)}}else{const l=(n?Number(e%up):e)/1e3%60,f=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,h=s(l,f),D=t.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");a(Number.parseFloat(D),"second","s",D)}if(i.length===0)return r+"0"+(t.verbose?" milliseconds":"ms");const d=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(d)}o(cp,"prettyMilliseconds");const lp=o((e,t)=>{e.failed&&Je({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})},"logError"),dp=o((e,t)=>{Bn(t)&&(lp(e,t),fp(e,t))},"logResult"),fp=o((e,t)=>{const n=`(done in ${cp(e.durationMs)})`;Je({type:"duration",verboseMessage:n,verboseInfo:t,result:e})},"logDuration"),pr=o((e,t,{reject:n})=>{if(dp(e,t),e.failed&&n)throw e;return e},"handleResult"),hp=o((e,t)=>Pe(e)?"asyncGenerator":ma(e)?"generator":gr(e)?"fileUrl":wp(e)?"filePath":Cp(e)?"webStream":Ce(e,{checkOpen:!1})?"native":X(e)?"uint8Array":Sp(e)?"asyncIterable":vp(e)?"iterable":wr(e)?fa({},t):gp(e)?Dp(e,t):"native","getStdioItemType"),Dp=o((e,t)=>Vs(e.transform,{checkOpen:!1})?pp(e,t):wr(e.transform)?fa(e,t):mp(e,t),"getTransformObjectType"),pp=o((e,t)=>(ha(e,t,"Duplex stream"),"duplex"),"getDuplexType"),fa=o((e,t)=>(ha(e,t,"web TransformStream"),"webTransform"),"getTransformStreamType"),ha=o(({final:e,binary:t,objectMode:n},r,i)=>{Da(e,`${r}.final`,i),Da(t,`${r}.binary`,i),mr(n,`${r}.objectMode`)},"validateNonGeneratorType"),Da=o((e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},"checkUndefinedOption"),mp=o(({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!pa(e))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Vs(t,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(wr(t))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!pa(t))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return mr(n,`${i}.binary`),mr(r,`${i}.objectMode`),Pe(e)||Pe(t)?"asyncGenerator":"generator"},"getGeneratorObjectType"),mr=o((e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},"checkBooleanOption"),pa=o(e=>Pe(e)||ma(e),"isGenerator"),Pe=o(e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]","isAsyncGenerator"),ma=o(e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]","isSyncGenerator"),gp=o(e=>K(e)&&(e.transform!==void 0||e.final!==void 0),"isTransformOptions"),gr=o(e=>Object.prototype.toString.call(e)==="[object URL]","isUrl"),Fp=o(e=>gr(e)&&e.protocol!=="file:","isRegularUrl"),wp=o(e=>K(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>yp.has(t))&&ga(e.file),"isFilePathObject"),yp=new Set(["file","append"]),ga=o(e=>typeof e=="string","isFilePathString"),Ep=o((e,t)=>e==="native"&&typeof t=="string"&&!bp.has(t),"isUnknownStdioString"),bp=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Fa=o(e=>Object.prototype.toString.call(e)==="[object ReadableStream]","isReadableStream"),Fr=o(e=>Object.prototype.toString.call(e)==="[object WritableStream]","isWritableStream"),Cp=o(e=>Fa(e)||Fr(e),"isWebStream"),wr=o(e=>Fa(e?.readable)&&Fr(e?.writable),"isTransformStream"),Sp=o(e=>wa(e)&&typeof e[Symbol.asyncIterator]=="function","isAsyncIterableObject"),vp=o(e=>wa(e)&&typeof e[Symbol.iterator]=="function","isIterableObject"),wa=o(e=>typeof e=="object"&&e!==null,"isObject"),Ae=new Set(["generator","asyncGenerator","duplex","webTransform"]),ya=new Set(["fileUrl","filePath","fileNumber"]),Ea=new Set(["fileUrl","filePath"]),Ap=new Set([...Ea,"webStream","nodeStream"]),$p=new Set(["webTransform","duplex"]),Pt={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},ba=o((e,t,n,r)=>r==="output"?Bp(e,t,n):Tp(e,t,n),"getTransformObjectModes"),Bp=o((e,t,n)=>{const r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},"getOutputObjectModes"),Tp=o((e,t,n)=>{const r=t===0?e===!0:n[t-1].value.readableObjectMode,i=t!==n.length-1&&(e??r);return{writableObjectMode:r,readableObjectMode:i}},"getInputObjectModes"),Ip=o((e,t)=>{const n=e.findLast(({type:r})=>Ae.has(r));return n===void 0?!1:t==="input"?n.value.writableObjectMode:n.value.readableObjectMode},"getFdObjectMode"),Op=o((e,t,n,r)=>[...e.filter(({type:i})=>!Ae.has(i)),...Rp(e,t,n,r)],"normalizeTransforms"),Rp=o((e,t,n,{encoding:r})=>{const i=e.filter(({type:a})=>Ae.has(a)),s=Array.from({length:i.length});for(const[a,u]of Object.entries(i))s[a]=Mp({stdioItem:u,index:Number(a),newTransforms:s,optionName:t,direction:n,encoding:r});return Np(s,n)},"getTransforms"),Mp=o(({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:s,encoding:a})=>t==="duplex"?_p({stdioItem:e,optionName:i}):t==="webTransform"?Pp({stdioItem:e,index:n,newTransforms:r,direction:s}):Lp({stdioItem:e,index:n,newTransforms:r,direction:s,encoding:a}),"normalizeTransform"),_p=o(({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:s})=>{if(i&&!r)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},"normalizeDuplex"),Pp=o(({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:a}=K(t)?t:{transform:t},{writableObjectMode:u,readableObjectMode:c}=ba(a,n,r,i);return{...e,value:{transform:s,writableObjectMode:u,readableObjectMode:c}}},"normalizeTransformStream"),Lp=o(({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:a,final:u,binary:c=!1,preserveNewlines:d=!1,objectMode:l}=K(t)?t:{transform:t},f=c||be.has(s),{writableObjectMode:h,readableObjectMode:D}=ba(l,n,r,i);return{...e,value:{transform:a,final:u,binary:f,preserveNewlines:d,writableObjectMode:h,readableObjectMode:D}}},"normalizeGenerator"),Np=o((e,t)=>t==="input"?e.reverse():e,"sortTransforms"),kp=o((e,t,n)=>{const r=e.map(i=>Up(i,t));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??Gp},"getStreamDirection"),Up=o(({type:e,value:t},n)=>jp[n]??Ca[e](t),"getStdioItemDirection"),jp=["input","output","output"],Le=o(()=>{},"anyDirection"),yr=o(()=>"input","alwaysInput"),Ca={generator:Le,asyncGenerator:Le,fileUrl:Le,filePath:Le,iterable:yr,asyncIterable:yr,uint8Array:yr,webStream:o(e=>Fr(e)?"output":"input","webStream"),nodeStream(e){return Ot(e,{checkOpen:!1})?zs(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:Le,duplex:Le,native(e){const t=Wp(e);if(t!==void 0)return t;if(Ce(e,{checkOpen:!1}))return Ca.nodeStream(e)}},Wp=o(e=>{if([0,I.stdin].includes(e))return"input";if([1,2,I.stdout,I.stderr].includes(e))return"output"},"getStandardStreamDirection"),Gp="output",zp=o((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e,"normalizeIpcStdioArray"),Vp=o(({stdio:e,ipc:t,buffer:n,...r},i,s)=>{const a=Hp(e,r).map((u,c)=>Sa(u,c));return s?qp(a,n,i):zp(a,t)},"normalizeStdioOption"),Hp=o((e,t)=>{if(e===void 0)return ee.map(r=>t[r]);if(Yp(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ee.map(r=>`\`${r}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const n=Math.max(e.length,ee.length);return Array.from({length:n},(r,i)=>e[i])},"getStdioArray"),Yp=o(e=>ee.some(t=>e[t]!==void 0),"hasAlias"),Sa=o((e,t)=>Array.isArray(e)?e.map(n=>Sa(n,t)):e??(t>=ee.length?"ignore":"pipe"),"addDefaultValue"),qp=o((e,t,n)=>e.map((r,i)=>!t[i]&&i!==0&&!Tn(n,i)&&Kp(r)?"ignore":r),"normalizeStdioSync"),Kp=o(e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe"),"isOutputPipeOnly"),Zp=o(({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||t!=="native"?e:s?Jp({stdioItem:e,fdNumber:r,direction:i}):xp({stdioItem:e,fdNumber:r}),"handleNativeStream"),Jp=o(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{const s=Xp({value:t,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(Ce(t,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},"handleNativeStreamSync"),Xp=o(({value:e,optionName:t,fdNumber:n,direction:r})=>{const i=Qp(e,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:t};if(_o.isatty(i))throw new TypeError(`The \`${t}: ${Qn(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Ke(cn(i)),optionName:t}}},"getTargetFd"),Qp=o((e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;const n=$n.indexOf(e);if(n!==-1)return n},"getTargetFdNumber"),xp=o(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t==="inherit"?{type:"nodeStream",value:va(r,t,n),optionName:n}:typeof t=="number"?{type:"nodeStream",value:va(t,t,n),optionName:n}:Ce(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:n}:e,"handleNativeStreamAsync"),va=o((e,t,n)=>{const r=$n[e];if(r===void 0)throw new TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},"getStandardStream"),em=o(({input:e,inputFile:t},n)=>n===0?[...tm(e),...rm(t)]:[],"handleInputOptions"),tm=o(e=>e===void 0?[]:[{type:nm(e),value:e,optionName:"input"}],"handleInputOption"),nm=o(e=>{if(Ot(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(X(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},"getInputType"),rm=o(e=>e===void 0?[]:[{...om(e),optionName:"inputFile"}],"handleInputFileOption"),om=o(e=>{if(gr(e))return{type:"fileUrl",value:e};if(ga(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},"getInputFileType"),im=o(e=>e.filter((t,n)=>e.every((r,i)=>t.value!==r.value||n>=i||t.type==="generator"||t.type==="asyncGenerator")),"filterDuplicates"),sm=o(({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const a=am(i,e);if(a.length!==0){if(s){um({otherStdioItems:a,type:e,value:t,optionName:n,direction:r});return}if(Ap.has(e))return Aa({otherStdioItems:a,type:e,value:t,optionName:n,direction:r});$p.has(e)&&lm({otherStdioItems:a,type:e,value:t,optionName:n})}},"getDuplicateStream"),am=o((e,t)=>e.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===t).map((i=>({...i,direction:n})))),"getOtherStdioItems"),um=o(({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{Ea.has(t)&&Aa({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},"validateDuplicateStreamSync"),Aa=o(({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{const s=e.filter(u=>cm(u,n));if(s.length===0)return;const a=s.find(u=>u.direction!==i);return $a(a,r,t),i==="output"?s[0].stream:void 0},"getDuplicateStreamInstance"),cm=o(({type:e,value:t},n)=>e==="filePath"?t.file===n.file:e==="fileUrl"?t.href===n.href:t===n,"hasSameValue"),lm=o(({otherStdioItems:e,type:t,value:n,optionName:r})=>{const i=e.find(({value:{transform:s}})=>s===n.transform);$a(i,r,t)},"validateDuplicateTransform"),$a=o((e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Pt[n]} that is the same.`)},"throwOnDuplicateStream"),Ba=o((e,t,n,r)=>{const s=Vp(t,n,r).map((u,c)=>dm({stdioOption:u,fdNumber:c,options:t,isSync:r})),a=wm({initialFileDescriptors:s,addProperties:e,options:t,isSync:r});return t.stdio=a.map(({stdioItems:u})=>bm(u)),a},"handleStdio"),dm=o(({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{const i=ki(t),{stdioItems:s,isStdioArray:a}=fm({stdioOption:e,fdNumber:t,options:n,optionName:i}),u=kp(s,t,i),c=s.map(f=>Zp({stdioItem:f,isStdioArray:a,fdNumber:t,direction:u,isSync:r})),d=Op(c,i,u,n),l=Ip(d,u);return Fm(d,l),{direction:u,objectMode:l,stdioItems:d}},"getFileDescriptor"),fm=o(({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{const s=[...(Array.isArray(e)?e:[e]).map(c=>hm(c,r)),...em(n,t)],a=im(s),u=a.length>1;return Dm(a,u,r),mm(a),{stdioItems:a,isStdioArray:u}},"initializeStdioItems"),hm=o((e,t)=>({type:hp(e,t),value:e,optionName:t}),"initializeStdioItem"),Dm=o((e,t,n)=>{if(e.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(const{value:r,optionName:i}of e)if(pm.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},"validateStdioArray"),pm=new Set(["ignore","ipc"]),mm=o(e=>{for(const t of e)gm(t)},"validateStreams"),gm=o(({type:e,value:t,optionName:n})=>{if(Fp(t))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
56
|
+
`);return{originalMessage:y,shortMessage:v,message:A}},"createMessages"),ZD=o(({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:s,signal:a,signalDescription:u,exitCode:c,isCanceled:d,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:h,killSignal:p})=>{const D=JD(f,h);return t?`Command timed out after ${n} milliseconds${D}`:l?a===void 0?`Command was gracefully canceled with exit code ${c}`:f?`Command was gracefully canceled${D}`:`Command was gracefully canceled with ${a} (${u})`:d?`Command was canceled${D}`:r?`${VD(e,i)}${D}`:s!==void 0?`Command failed with ${s}${D}`:f?`Command was killed with ${p} (${ws(p)})${D}`:a!==void 0?`Command was killed with ${a} (${u})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},"getErrorPrefix"),JD=o((e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"","getForcefulSuffix"),XD=o((e,t)=>{if(e instanceof ye)return;const n=Af(e)?e.originalMessage:String(e?.message??e),r=Mn(tD(n,t));return r===""?void 0:r},"getOriginalMessage"),QD=o(e=>typeof e=="string"?e:Io(e),"serializeIpcMessage"),xD=o(e=>Array.isArray(e)?e.map(t=>ir(ua(t))).filter(Boolean).join(`
|
|
57
|
+
`):ua(e),"serializeMessagePart"),ua=o(e=>typeof e=="string"?e:X(e)?Mi(e):"","serializeMessageItem"),ca=o(({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:a})=>la({command:e,escapedCommand:t,cwd:s,durationMs:Zi(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),"makeSuccessResult"),hr=o(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:a})=>Dr({error:e,command:t,escapedCommand:n,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:a}),"makeEarlyError"),Dr=o(({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:d,signal:l,stdio:f,all:h,ipcOutput:p,options:{timeoutDuration:D,timeout:m=D,forceKillAfterDelay:F,killSignal:g,cwd:w,maxBuffer:E},isSync:y})=>{const{exitCode:b,signal:v,signalDescription:S}=tp(d,l),{originalMessage:A,shortMessage:_,message:J}=KD({stdio:f,all:h,ipcOutput:p,originalError:e,signal:v,signalDescription:S,exitCode:b,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,forceKillAfterDelay:F,killSignal:g,maxBuffer:E,timeout:m,cwd:w}),H=vf(e,J,y);return Object.assign(H,ep({error:H,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:b,signal:v,signalDescription:S,stdio:f,all:h,ipcOutput:p,cwd:w,originalMessage:A,shortMessage:_})),H},"makeError"),ep=o(({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:d,signal:l,signalDescription:f,stdio:h,all:p,ipcOutput:D,cwd:m,originalMessage:F,shortMessage:g})=>la({shortMessage:g,originalMessage:F,command:t,escapedCommand:n,cwd:m,durationMs:Zi(r),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isTerminated:l!==void 0,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:d,signal:l,signalDescription:f,code:e.cause?.code,stdout:h[1],stderr:h[2],all:p,stdio:h,ipcOutput:D,pipedFrom:[]}),"getErrorProperties"),la=o(e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),"omitUndefinedProperties"),tp=o((e,t)=>{const n=e===null?void 0:e,r=t===null?void 0:t,i=r===void 0?void 0:ws(t);return{exitCode:n,signal:r,signalDescription:i}},"normalizeExitPayload"),da=o(e=>Number.isFinite(e)?e:0,"toZeroIfInfinity");function np(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(da(e*1e3)%1e3),nanoseconds:Math.trunc(da(e*1e6)%1e3)}}o(np,"parseNumber");function rp(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}o(rp,"parseBigint");function op(e){switch(typeof e){case"number":{if(Number.isFinite(e))return np(e);break}case"bigint":return rp(e)}throw new TypeError("Expected a finite number or bigint")}o(op,"parseMilliseconds");const ip=o(e=>e===0||e===0n,"isZero"),sp=o((e,t)=>t===1||t===1n?e:`${e}s`,"pluralize"),ap=1e-7,up=24n*60n*60n*1000n;function cp(e,t){const n=typeof e=="bigint";if(!n&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};const r=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[];const s=o((l,f)=>{const h=Math.floor(l*10**f+ap);return(Math.round(h)/10**f).toFixed(f)},"floorDecimals"),a=o((l,f,h,p)=>{if(!((i.length===0||!t.colonNotation)&&ip(l)&&!(t.colonNotation&&h==="m"))){if(p??(p=String(l)),t.colonNotation){const D=p.includes(".")?p.split(".")[0].length:p.length,m=i.length>0?2:1;p="0".repeat(Math.max(0,m-D))+p}else p+=t.verbose?" "+sp(f,l):h;i.push(p)}},"add"),u=op(e),c=BigInt(u.days);if(t.hideYearAndDays?a(BigInt(c)*24n+BigInt(u.hours),"hour","h"):(t.hideYear?a(c,"day","d"):(a(c/365n,"year","y"),a(c%365n,"day","d")),a(Number(u.hours),"hour","h")),a(Number(u.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){const l=Number(u.seconds),f=Number(u.milliseconds),h=Number(u.microseconds),p=Number(u.nanoseconds);if(a(l,"second","s"),t.formatSubMilliseconds)a(f,"millisecond","ms"),a(h,"microsecond","\xB5s"),a(p,"nanosecond","ns");else{const D=f+h/1e3+p/1e6,m=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,F=D>=1?Math.round(D):Math.ceil(D),g=m?D.toFixed(m):F;a(Number.parseFloat(g),"millisecond","ms",g)}}else{const l=(n?Number(e%up):e)/1e3%60,f=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,h=s(l,f),p=t.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");a(Number.parseFloat(p),"second","s",p)}if(i.length===0)return r+"0"+(t.verbose?" milliseconds":"ms");const d=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(d)}o(cp,"prettyMilliseconds");const lp=o((e,t)=>{e.failed&&Je({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})},"logError"),dp=o((e,t)=>{Bn(t)&&(lp(e,t),fp(e,t))},"logResult"),fp=o((e,t)=>{const n=`(done in ${cp(e.durationMs)})`;Je({type:"duration",verboseMessage:n,verboseInfo:t,result:e})},"logDuration"),pr=o((e,t,{reject:n})=>{if(dp(e,t),e.failed&&n)throw e;return e},"handleResult"),hp=o((e,t)=>Pe(e)?"asyncGenerator":ma(e)?"generator":gr(e)?"fileUrl":wp(e)?"filePath":Cp(e)?"webStream":Ce(e,{checkOpen:!1})?"native":X(e)?"uint8Array":Sp(e)?"asyncIterable":vp(e)?"iterable":wr(e)?fa({},t):gp(e)?Dp(e,t):"native","getStdioItemType"),Dp=o((e,t)=>Vs(e.transform,{checkOpen:!1})?pp(e,t):wr(e.transform)?fa(e,t):mp(e,t),"getTransformObjectType"),pp=o((e,t)=>(ha(e,t,"Duplex stream"),"duplex"),"getDuplexType"),fa=o((e,t)=>(ha(e,t,"web TransformStream"),"webTransform"),"getTransformStreamType"),ha=o(({final:e,binary:t,objectMode:n},r,i)=>{Da(e,`${r}.final`,i),Da(t,`${r}.binary`,i),mr(n,`${r}.objectMode`)},"validateNonGeneratorType"),Da=o((e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},"checkUndefinedOption"),mp=o(({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!pa(e))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Vs(t,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(wr(t))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!pa(t))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return mr(n,`${i}.binary`),mr(r,`${i}.objectMode`),Pe(e)||Pe(t)?"asyncGenerator":"generator"},"getGeneratorObjectType"),mr=o((e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},"checkBooleanOption"),pa=o(e=>Pe(e)||ma(e),"isGenerator"),Pe=o(e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]","isAsyncGenerator"),ma=o(e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]","isSyncGenerator"),gp=o(e=>K(e)&&(e.transform!==void 0||e.final!==void 0),"isTransformOptions"),gr=o(e=>Object.prototype.toString.call(e)==="[object URL]","isUrl"),Fp=o(e=>gr(e)&&e.protocol!=="file:","isRegularUrl"),wp=o(e=>K(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>yp.has(t))&&ga(e.file),"isFilePathObject"),yp=new Set(["file","append"]),ga=o(e=>typeof e=="string","isFilePathString"),Ep=o((e,t)=>e==="native"&&typeof t=="string"&&!bp.has(t),"isUnknownStdioString"),bp=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Fa=o(e=>Object.prototype.toString.call(e)==="[object ReadableStream]","isReadableStream"),Fr=o(e=>Object.prototype.toString.call(e)==="[object WritableStream]","isWritableStream"),Cp=o(e=>Fa(e)||Fr(e),"isWebStream"),wr=o(e=>Fa(e?.readable)&&Fr(e?.writable),"isTransformStream"),Sp=o(e=>wa(e)&&typeof e[Symbol.asyncIterator]=="function","isAsyncIterableObject"),vp=o(e=>wa(e)&&typeof e[Symbol.iterator]=="function","isIterableObject"),wa=o(e=>typeof e=="object"&&e!==null,"isObject"),Ae=new Set(["generator","asyncGenerator","duplex","webTransform"]),ya=new Set(["fileUrl","filePath","fileNumber"]),Ea=new Set(["fileUrl","filePath"]),Ap=new Set([...Ea,"webStream","nodeStream"]),$p=new Set(["webTransform","duplex"]),Pt={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},ba=o((e,t,n,r)=>r==="output"?Bp(e,t,n):Tp(e,t,n),"getTransformObjectModes"),Bp=o((e,t,n)=>{const r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},"getOutputObjectModes"),Tp=o((e,t,n)=>{const r=t===0?e===!0:n[t-1].value.readableObjectMode,i=t!==n.length-1&&(e??r);return{writableObjectMode:r,readableObjectMode:i}},"getInputObjectModes"),Ip=o((e,t)=>{const n=e.findLast(({type:r})=>Ae.has(r));return n===void 0?!1:t==="input"?n.value.writableObjectMode:n.value.readableObjectMode},"getFdObjectMode"),Op=o((e,t,n,r)=>[...e.filter(({type:i})=>!Ae.has(i)),...Rp(e,t,n,r)],"normalizeTransforms"),Rp=o((e,t,n,{encoding:r})=>{const i=e.filter(({type:a})=>Ae.has(a)),s=Array.from({length:i.length});for(const[a,u]of Object.entries(i))s[a]=Mp({stdioItem:u,index:Number(a),newTransforms:s,optionName:t,direction:n,encoding:r});return Np(s,n)},"getTransforms"),Mp=o(({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:s,encoding:a})=>t==="duplex"?_p({stdioItem:e,optionName:i}):t==="webTransform"?Pp({stdioItem:e,index:n,newTransforms:r,direction:s}):Lp({stdioItem:e,index:n,newTransforms:r,direction:s,encoding:a}),"normalizeTransform"),_p=o(({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:s})=>{if(i&&!r)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},"normalizeDuplex"),Pp=o(({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:a}=K(t)?t:{transform:t},{writableObjectMode:u,readableObjectMode:c}=ba(a,n,r,i);return{...e,value:{transform:s,writableObjectMode:u,readableObjectMode:c}}},"normalizeTransformStream"),Lp=o(({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:a,final:u,binary:c=!1,preserveNewlines:d=!1,objectMode:l}=K(t)?t:{transform:t},f=c||be.has(s),{writableObjectMode:h,readableObjectMode:p}=ba(l,n,r,i);return{...e,value:{transform:a,final:u,binary:f,preserveNewlines:d,writableObjectMode:h,readableObjectMode:p}}},"normalizeGenerator"),Np=o((e,t)=>t==="input"?e.reverse():e,"sortTransforms"),kp=o((e,t,n)=>{const r=e.map(i=>Up(i,t));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??Gp},"getStreamDirection"),Up=o(({type:e,value:t},n)=>jp[n]??Ca[e](t),"getStdioItemDirection"),jp=["input","output","output"],Le=o(()=>{},"anyDirection"),yr=o(()=>"input","alwaysInput"),Ca={generator:Le,asyncGenerator:Le,fileUrl:Le,filePath:Le,iterable:yr,asyncIterable:yr,uint8Array:yr,webStream:o(e=>Fr(e)?"output":"input","webStream"),nodeStream(e){return Ot(e,{checkOpen:!1})?zs(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:Le,duplex:Le,native(e){const t=Wp(e);if(t!==void 0)return t;if(Ce(e,{checkOpen:!1}))return Ca.nodeStream(e)}},Wp=o(e=>{if([0,I.stdin].includes(e))return"input";if([1,2,I.stdout,I.stderr].includes(e))return"output"},"getStandardStreamDirection"),Gp="output",zp=o((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e,"normalizeIpcStdioArray"),Vp=o(({stdio:e,ipc:t,buffer:n,...r},i,s)=>{const a=Hp(e,r).map((u,c)=>Sa(u,c));return s?qp(a,n,i):zp(a,t)},"normalizeStdioOption"),Hp=o((e,t)=>{if(e===void 0)return ee.map(r=>t[r]);if(Yp(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ee.map(r=>`\`${r}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const n=Math.max(e.length,ee.length);return Array.from({length:n},(r,i)=>e[i])},"getStdioArray"),Yp=o(e=>ee.some(t=>e[t]!==void 0),"hasAlias"),Sa=o((e,t)=>Array.isArray(e)?e.map(n=>Sa(n,t)):e??(t>=ee.length?"ignore":"pipe"),"addDefaultValue"),qp=o((e,t,n)=>e.map((r,i)=>!t[i]&&i!==0&&!Tn(n,i)&&Kp(r)?"ignore":r),"normalizeStdioSync"),Kp=o(e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe"),"isOutputPipeOnly"),Zp=o(({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||t!=="native"?e:s?Jp({stdioItem:e,fdNumber:r,direction:i}):xp({stdioItem:e,fdNumber:r}),"handleNativeStream"),Jp=o(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{const s=Xp({value:t,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(Ce(t,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},"handleNativeStreamSync"),Xp=o(({value:e,optionName:t,fdNumber:n,direction:r})=>{const i=Qp(e,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:t};if(_o.isatty(i))throw new TypeError(`The \`${t}: ${Qn(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Ke(cn(i)),optionName:t}}},"getTargetFd"),Qp=o((e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;const n=$n.indexOf(e);if(n!==-1)return n},"getTargetFdNumber"),xp=o(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t==="inherit"?{type:"nodeStream",value:va(r,t,n),optionName:n}:typeof t=="number"?{type:"nodeStream",value:va(t,t,n),optionName:n}:Ce(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:n}:e,"handleNativeStreamAsync"),va=o((e,t,n)=>{const r=$n[e];if(r===void 0)throw new TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},"getStandardStream"),em=o(({input:e,inputFile:t},n)=>n===0?[...tm(e),...rm(t)]:[],"handleInputOptions"),tm=o(e=>e===void 0?[]:[{type:nm(e),value:e,optionName:"input"}],"handleInputOption"),nm=o(e=>{if(Ot(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(X(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},"getInputType"),rm=o(e=>e===void 0?[]:[{...om(e),optionName:"inputFile"}],"handleInputFileOption"),om=o(e=>{if(gr(e))return{type:"fileUrl",value:e};if(ga(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},"getInputFileType"),im=o(e=>e.filter((t,n)=>e.every((r,i)=>t.value!==r.value||n>=i||t.type==="generator"||t.type==="asyncGenerator")),"filterDuplicates"),sm=o(({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const a=am(i,e);if(a.length!==0){if(s){um({otherStdioItems:a,type:e,value:t,optionName:n,direction:r});return}if(Ap.has(e))return Aa({otherStdioItems:a,type:e,value:t,optionName:n,direction:r});$p.has(e)&&lm({otherStdioItems:a,type:e,value:t,optionName:n})}},"getDuplicateStream"),am=o((e,t)=>e.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===t).map((i=>({...i,direction:n})))),"getOtherStdioItems"),um=o(({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{Ea.has(t)&&Aa({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},"validateDuplicateStreamSync"),Aa=o(({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{const s=e.filter(u=>cm(u,n));if(s.length===0)return;const a=s.find(u=>u.direction!==i);return $a(a,r,t),i==="output"?s[0].stream:void 0},"getDuplicateStreamInstance"),cm=o(({type:e,value:t},n)=>e==="filePath"?t.file===n.file:e==="fileUrl"?t.href===n.href:t===n,"hasSameValue"),lm=o(({otherStdioItems:e,type:t,value:n,optionName:r})=>{const i=e.find(({value:{transform:s}})=>s===n.transform);$a(i,r,t)},"validateDuplicateTransform"),$a=o((e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Pt[n]} that is the same.`)},"throwOnDuplicateStream"),Ba=o((e,t,n,r)=>{const s=Vp(t,n,r).map((u,c)=>dm({stdioOption:u,fdNumber:c,options:t,isSync:r})),a=wm({initialFileDescriptors:s,addProperties:e,options:t,isSync:r});return t.stdio=a.map(({stdioItems:u})=>bm(u)),a},"handleStdio"),dm=o(({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{const i=ki(t),{stdioItems:s,isStdioArray:a}=fm({stdioOption:e,fdNumber:t,options:n,optionName:i}),u=kp(s,t,i),c=s.map(f=>Zp({stdioItem:f,isStdioArray:a,fdNumber:t,direction:u,isSync:r})),d=Op(c,i,u,n),l=Ip(d,u);return Fm(d,l),{direction:u,objectMode:l,stdioItems:d}},"getFileDescriptor"),fm=o(({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{const s=[...(Array.isArray(e)?e:[e]).map(c=>hm(c,r)),...em(n,t)],a=im(s),u=a.length>1;return Dm(a,u,r),mm(a),{stdioItems:a,isStdioArray:u}},"initializeStdioItems"),hm=o((e,t)=>({type:hp(e,t),value:e,optionName:t}),"initializeStdioItem"),Dm=o((e,t,n)=>{if(e.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(const{value:r,optionName:i}of e)if(pm.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},"validateStdioArray"),pm=new Set(["ignore","ipc"]),mm=o(e=>{for(const t of e)gm(t)},"validateStreams"),gm=o(({type:e,value:t,optionName:n})=>{if(Fp(t))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
58
58
|
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Ep(e,t))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},"validateFileStdio"),Fm=o((e,t)=>{if(!t)return;const n=e.find(({type:r})=>ya.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},"validateFileObjectMode"),wm=o(({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{const i=[];try{for(const s of e)i.push(ym({fileDescriptor:s,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(s){throw Ta(i),s}},"getFinalFileDescriptors"),ym=o(({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:a})=>{const u=n.map(c=>Em({stdioItem:c,addProperties:i,direction:e,options:s,fileDescriptors:r,isSync:a}));return{direction:e,objectMode:t,stdioItems:u}},"getFinalFileDescriptor"),Em=o(({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const a=sm({stdioItem:e,direction:n,fileDescriptors:i,isSync:s});return a!==void 0?{...e,stream:a}:{...e,...t[n][e.type](e,r)}},"addStreamProperties"),Ta=o(e=>{for(const{stdioItems:t}of e)for(const{stream:n}of t)n!==void 0&&!Fe(n)&&n.destroy()},"cleanupCustomStreams"),bm=o(e=>{if(e.length>1)return e.some(({value:r})=>r==="overlapped")?"overlapped":"pipe";const[{type:t,value:n}]=e;return t==="native"?n:"pipe"},"forwardStdio"),Cm=o((e,t)=>Ba(vm,e,t,!0),"handleStdioSync"),ne=o(({type:e,optionName:t})=>{Ia(t,Pt[e])},"forbiddenIfSync"),Sm=o(({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&Ia(e,`"${t}"`),{}),"forbiddenNativeIfSync"),Ia=o((e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},"throwInvalidSyncValue"),Oa={generator(){},asyncGenerator:ne,webStream:ne,nodeStream:ne,webTransform:ne,duplex:ne,asyncIterable:ne,native:Sm},vm={input:{...Oa,fileUrl:o(({value:e})=>({contents:[Ke(cn(e))]}),"fileUrl"),filePath:o(({value:{file:e}})=>({contents:[Ke(cn(e))]}),"filePath"),fileNumber:ne,iterable:o(({value:e})=>({contents:[...e]}),"iterable"),string:o(({value:e})=>({contents:[e]}),"string"),uint8Array:o(({value:e})=>({contents:[e]}),"uint8Array")},output:{...Oa,fileUrl:o(({value:e})=>({path:e}),"fileUrl"),filePath:o(({value:{file:e,append:t}})=>({path:e,append:t}),"filePath"),fileNumber:o(({value:e})=>({path:e}),"fileNumber"),iterable:ne,string:ne,uint8Array:ne}},Ne=o((e,{stripFinalNewline:t},n)=>Ra(t,n)&&e!==void 0&&!Array.isArray(e)?ir(e):e,"stripNewline"),Ra=o((e,t)=>t==="all"?e[1]||e[2]:e[t],"getStripFinalNewline"),Ma=o((e,t,n,r)=>e||n?void 0:La(t,r),"getSplitLinesGenerator"),_a=o((e,t,n)=>n?e.flatMap(r=>Pa(r,t)):Pa(e,t),"splitLinesSync"),Pa=o((e,t)=>{const{transform:n,final:r}=La(t,{});return[...n(e),...r()]},"splitLinesItemSync"),La=o((e,t)=>(t.previousChunks="",{transform:Am.bind(void 0,t,e),final:Bm.bind(void 0,t)}),"initializeSplitLines"),Am=o(function*(e,t,n){if(typeof n!="string"){yield n;return}let{previousChunks:r}=e,i=-1;for(let s=0;s<n.length;s+=1)if(n[s]===`
|
|
59
59
|
`){const a=$m(n,s,t,e);let u=n.slice(i+1,s+1-a);r.length>0&&(u=Er(r,u),r=""),yield u,i=s}i!==n.length-1&&(r=Er(r,n.slice(i+1))),e.previousChunks=r},"splitGenerator"),$m=o((e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]==="\r",r.isWindowsNewline?2:1),"getNewlineLength"),Bm=o(function*({previousChunks:e}){e.length>0&&(yield e)},"linesFinal"),Tm=o(({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:Im.bind(void 0,r)},"getAppendNewlineGenerator"),Im=o(function*({isWindowsNewline:e=!1},t){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof t=="string"?Om:Mm;if(t.at(-1)===i){yield t;return}yield s(t,e?r:n)},"appendNewlineGenerator"),Er=o((e,t)=>`${e}${t}`,"concatString"),Om={windowsNewline:`\r
|
|
60
60
|
`,unixNewline:`
|
|
61
61
|
`,LF:`
|
|
62
62
|
`,concatBytes:Er},Rm=o((e,t)=>{const n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},"concatUint8Array"),Mm={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Rm},_m=o((e,t)=>e?void 0:Pm.bind(void 0,t),"getValidateTransformInput"),Pm=o(function*(e,t){if(typeof t!="string"&&!X(t)&&!fn.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},"validateStringTransformInput"),Lm=o((e,t)=>e?Nm.bind(void 0,t):km.bind(void 0,t),"getValidateTransformReturn"),Nm=o(function*(e,t){Na(e,t),yield t},"validateObjectTransformReturn"),km=o(function*(e,t){if(Na(e,t),typeof t!="string"&&!X(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},"validateStringTransformReturn"),Na=o((e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
|
|
63
63
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
64
|
-
if (condition) { yield value; }`)},"validateEmptyReturn"),ka=o((e,t,n)=>{if(n)return;if(e)return{transform:Um.bind(void 0,new TextEncoder)};const r=new To(t);return{transform:jm.bind(void 0,r),final:Wm.bind(void 0,r)}},"getEncodingTransformGenerator"),Um=o(function*(e,t){fn.isBuffer(t)?yield Ke(t):typeof t=="string"?yield e.encode(t):yield t},"encodingUint8ArrayGenerator"),jm=o(function*(e,t){yield X(t)?e.write(t):t},"encodingStringGenerator"),Wm=o(function*(e){const t=e.end();t!==""&&(yield t)},"encodingStringFinal"),Ua=Re(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(const i of t.currentIterable)r.push(i)}finally{delete t.currentIterable}}),br=o(async function*(e,t,n){if(n===t.length){yield e;return}const{transform:r=Hm}=t[n];for await(const i of r(e))yield*br(i,t,n+1)},"transformChunk"),Gm=o(async function*(e){for(const[t,{final:n}]of Object.entries(e))yield*zm(n,Number(t),e)},"finalChunks"),zm=o(async function*(e,t,n){if(e!==void 0)for await(const r of e())yield*br(r,n,t+1)},"generatorFinalChunks"),Vm=Re(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Hm=o(function*(e){yield e},"identityGenerator$1"),ja=o((e,t,n,r)=>{try{for(const i of e(...t))n.push(i);r()}catch(i){r(i)}},"pushChunksSync"),Ym=o((e,t)=>[...t.flatMap(n=>[...rt(n,e,0)]),...Cr(e)],"runTransformSync"),rt=o(function*(e,t,n){if(n===t.length){yield e;return}const{transform:r=Km}=t[n];for(const i of r(e))yield*rt(i,t,n+1)},"transformChunkSync"),Cr=o(function*(e){for(const[t,{final:n}]of Object.entries(e))yield*qm(n,Number(t),e)},"finalChunksSync"),qm=o(function*(e,t,n){if(e!==void 0)for(const r of e())yield*rt(r,n,t+1)},"generatorFinalChunksSync"),Km=o(function*(e){yield e},"identityGenerator"),Wa=o(({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:a})=>{const u={},c=za(e,a,s),d=Pe(t),l=Pe(n),f=d?Ua.bind(void 0,br,u):ja.bind(void 0,rt),h=d||l?Ua.bind(void 0,Gm,u):ja.bind(void 0,Cr),D=d||l?Vm.bind(void 0,u):void 0;return{stream:new Yc({writableObjectMode:r,writableHighWaterMark:pt(r),readableObjectMode:i,readableHighWaterMark:pt(i),transform(m,F,g){f([m,c,0],this,g)},flush(m){h([c],this,m)},destroy:D})}},"generatorToStream"),Ga=o((e,t,n,r)=>{const i=t.filter(({type:a})=>a==="generator"),s=r?i.reverse():i;for(const{value:a,optionName:u}of s){const c=za(a,n,u);e=Ym(c,e)}return e},"runGeneratorsSync"),za=o(({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},a,u)=>{const c={};return[{transform:_m(r,u)},ka(n,a,r),Ma(n,s,r,c),{transform:e,final:t},{transform:Lm(i,u)},Tm({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},"addInternalGenerators"),Zm=o((e,t)=>{for(const n of Jm(e))Xm(e,n,t)},"addInputOptionsSync"),Jm=o(e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),"getInputFdNumbers"),Xm=o((e,t,n)=>{const{stdioItems:r}=e[t],i=r.filter(({contents:u})=>u!==void 0);if(i.length===0)return;if(t!==0){const[{type:u,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Pt[u]} with synchronous methods.`)}const a=i.map(({contents:u})=>u).map(u=>Qm(u,r));n.input=An(a)},"addInputOptionSync"),Qm=o((e,t)=>{const n=Ga(e,t,"utf8",!0);return xm(n),An(n)},"applySingleInputGeneratorsSync"),xm=o(e=>{const t=e.find(n=>typeof n!="string"&&!X(n));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},"validateSerializable"),Va=o(({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!=="all"&&Tn(n,r)&&!be.has(t)&&e0(r)&&(e.some(({type:i,value:s})=>i==="native"&&t0.has(s))||e.every(({type:i})=>Ae.has(i))),"shouldLogOutput"),e0=o(e=>e===1||e===2,"fdUsesVerbose"),t0=new Set(["pipe","overlapped"]),n0=o(async(e,t,n,r)=>{for await(const i of e)o0(t)||Ha(i,n,r)},"logLines"),r0=o((e,t,n)=>{for(const r of e)Ha(r,t,n)},"logLinesSync"),o0=o(e=>e._readableState.pipes.length>0,"isPipingStream"),Ha=o((e,t,n)=>{const r=qi(e);Je({type:"output",verboseMessage:r,fdNumber:t,verboseInfo:n})},"logLine"),i0=o(({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};const s={},a=new Set([]);return{output:t.map((c,d)=>s0({result:c,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:r,verboseInfo:i},n)),...s}},"transformOutputSync"),s0=o(({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:s,verboseInfo:a},{buffer:u,encoding:c,lines:d,stripFinalNewline:l,maxBuffer:f})=>{if(e===null)return;const h=qD(e,s,f),D=Ke(h),{stdioItems:p,objectMode:m}=t[n],F=a0([D],p,c,r),{serializedResult:g,finalResult:w=g}=u0({chunks:F,objectMode:m,encoding:c,lines:d,stripFinalNewline:l,fdNumber:n});c0({serializedResult:g,fdNumber:n,state:r,verboseInfo:a,encoding:c,stdioItems:p,objectMode:m});const E=u[n]?w:void 0;try{return r.error===void 0&&l0(g,p,i),E}catch(y){return r.error=y,E}},"transformOutputResultSync"),a0=o((e,t,n,r)=>{try{return Ga(e,t,n,!1)}catch(i){return r.error=i,e}},"runOutputGeneratorsSync"),u0=o(({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(t)return{serializedResult:e};if(n==="buffer")return{serializedResult:An(e)};const a=td(e,n);return r[s]?{serializedResult:a,finalResult:_a(a,!i[s],t)}:{serializedResult:a}},"serializeChunks"),c0=o(({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:a})=>{if(!Va({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:t}))return;const u=_a(e,!1,a);try{r0(u,t,r)}catch(c){n.error??(n.error=c)}},"logOutputSync"),l0=o((e,t,n)=>{for(const{path:r,append:i}of t.filter(({type:s})=>ya.has(s))){const s=typeof r=="string"?r:r.toString();i||n.has(s)?Vc(r,e):(n.add(s),Hc(r,e))}},"writeToFiles"),d0=o(([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Ne(t,n,"all")]:Array.isArray(t)?[Ne(e,n,"all"),...t]:X(e)&&X(t)?_i([e,t]):`${e}${t}`},"getAllSync"),f0=o(async(e,t)=>{const[n,r]=await h0(e);return t.isForcefullyTerminated??(t.isForcefullyTerminated=!1),[n,r]},"waitForExit"),h0=o(async e=>{const[t,n]=await Promise.allSettled([G(e,"spawn"),G(e,"exit")]);return t.status==="rejected"?[]:n.status==="rejected"?Ya(e):n.value},"waitForExitOrError"),Ya=o(async e=>{try{return await G(e,"exit")}catch{return Ya(e)}},"waitForSubprocessExit"),D0=o(async e=>{const[t,n]=await e;if(!p0(t,n)&&qa(t,n))throw new ye;return[t,n]},"waitForSuccessfulExit"),p0=o((e,t)=>e===void 0&&t===void 0,"isSubprocessErrorExit"),qa=o((e,t)=>e!==0||t!==null,"isFailedExit"),m0=o(({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{const s=g0(e,t,n),a=s?.code==="ETIMEDOUT",u=YD(s,r,i);return{resultError:s,exitCode:t,signal:n,timedOut:a,isMaxBuffer:u}},"getExitResultSync"),g0=o((e,t,n)=>e!==void 0?e:qa(t,n)?new ye:void 0,"getResultError"),F0=o((e,t,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:a,startTime:u,verboseInfo:c,options:d,fileDescriptors:l}=w0(e,t,n),f=b0({file:r,commandArguments:i,options:d,command:s,escapedCommand:a,verboseInfo:c,fileDescriptors:l,startTime:u});return pr(f,c,d)},"execaCoreSync"),w0=o((e,t,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=Ji(e,t,n),u=y0(n),{file:c,commandArguments:d,options:l}=Us(e,t,u);E0(l);const f=Cm(l,a);return{file:c,commandArguments:d,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:f}},"handleSyncArguments"),y0=o(e=>e.node&&!e.ipc?{...e,ipc:!1}:e,"normalizeSyncOptions"),E0=o(({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Lt("ipcInput"),e&&Lt("ipc: true"),n&&Lt("detached: true"),r&&Lt("cancelSignal")},"validateSyncOptions"),Lt=o(e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},"throwInvalidSyncOption"),b0=o(({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:a,startTime:u})=>{const c=C0({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:u});if(c.failed)return c;const{resultError:d,exitCode:l,signal:f,timedOut:h,isMaxBuffer:D}=m0(c,n),{output:p,error:m=d}=i0({fileDescriptors:a,syncResult:c,options:n,isMaxBuffer:D,verboseInfo:s}),F=p.map((w,E)=>Ne(w,n,E)),g=Ne(d0(p,n),n,"all");return v0({error:m,exitCode:l,signal:f,timedOut:h,isMaxBuffer:D,stdio:F,all:g,options:n,command:r,escapedCommand:i,startTime:u})},"spawnSubprocessSync"),C0=o(({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:a})=>{try{Zm(s,n);const u=S0(n);return Ic(...js(e,t,u))}catch(u){return hr({error:u,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:a,isSync:!0})}},"runSubprocessSync"),S0=o(({encoding:e,maxBuffer:t,...n})=>({...n,encoding:"buffer",maxBuffer:fr(t)}),"normalizeSpawnSyncOptions"),v0=o(({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:s,all:a,options:u,command:c,escapedCommand:d,startTime:l})=>e===void 0?ca({command:c,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:u,startTime:l}):Dr({error:e,command:c,escapedCommand:d,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:s,all:a,ipcOutput:[],options:u,startTime:l,isSync:!0}),"getSyncResult"),A0=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(Zn({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:Is(e)}),$0({anyProcess:e,channel:t,isSubprocess:n,filter:s,reference:i})),"getOneMessage"),$0=o(async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Bs(t,i);const s=At(e,t,n),a=new AbortController;try{return await Promise.race([B0(s,r,a),T0(s,n,a),I0(s,n,a)])}catch(u){throw Jn(e),u}finally{a.abort(),Ts(t,i)}},"getOneMessageAsync"),B0=o(async(e,t,{signal:n})=>{if(t===void 0){const[r]=await G(e,"message",{signal:n});return r}for await(const[r]of Dt(e,"message",{signal:n}))if(t(r))return r},"getMessage"),T0=o(async(e,t,{signal:n})=>{await G(e,"disconnect",{signal:n}),eh(t)},"throwOnDisconnect"),I0=o(async(e,t,{signal:n})=>{const[r]=await G(e,"strict:error",{signal:n});throw Cs(r,t)},"throwOnStrictError"),O0=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>Ka({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),"getEachMessage"),Ka=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{Zn({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:Is(e)}),Bs(t,s);const a=At(e,t,n),u=new AbortController,c={};return R0(e,a,u),M0({ipcEmitter:a,isSubprocess:n,controller:u,state:c}),_0({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:n,shouldAwait:i,controller:u,state:c,reference:s})},"loopOnMessages"),R0=o(async(e,t,n)=>{try{await G(t,"disconnect",{signal:n.signal}),n.abort()}catch{}},"stopOnDisconnect"),M0=o(async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{const[i]=await G(e,"strict:error",{signal:n.signal});r.error=Cs(i,t),n.abort()}catch{}},"abortOnStrictError"),_0=o(async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:a,reference:u}){try{for await(const[c]of Dt(n,"message",{signal:s.signal}))Za(a),yield c}catch{Za(a)}finally{s.abort(),Ts(t,u),r||Jn(e),i&&await e}},"iterateOnMessages"),Za=o(({error:e})=>{if(e)throw e},"throwIfStrictError"),P0=o((e,{ipc:t})=>{Object.assign(e,Ja(e,!1,t))},"addIpcMethods"),L0=o(()=>{const e=I,t=!0,n=I.channel!==void 0;return{...Ja(e,t,n),getCancelSignal:_h.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}},"getIpcExport"),Ja=o((e,t,n)=>({sendMessage:Rs.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:A0.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:O0.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),"getIpcMethods"),N0=o(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:a})=>{Ta(r);const u=new Bo;k0(u,r),Object.assign(u,{readable:U0,writable:j0,duplex:W0});const c=hr({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),d=G0(c,a,i);return{subprocess:u,promise:d}},"handleEarlyError"),k0=o((e,t)=>{const n=ot(),r=ot(),i=ot(),s=Array.from({length:t.length-3},ot),a=ot(),u=[n,r,i,...s];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:a,stdio:u})},"createDummyStreams"),ot=o(()=>{const e=new Wo;return e.end(),e},"createDummyStream"),U0=o(()=>new ge({read(){}}),"readable"),j0=o(()=>new dn({write(){}}),"writable"),W0=o(()=>new ln({read(){},write(){}}),"duplex"),G0=o(async(e,t,n)=>pr(e,t,n),"handleDummyPromise"),z0=o((e,t)=>Ba(V0,e,t,!1),"handleStdioAsync"),it=o(({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${Pt[e]}.`)},"forbiddenIfAsync"),Xa={fileNumber:it,generator:Wa,asyncGenerator:Wa,nodeStream:o(({value:e})=>({stream:e}),"nodeStream"),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){const r=t||n;return{stream:ln.fromWeb(e,{objectMode:r})}},duplex:o(({value:{transform:e}})=>({stream:e}),"duplex"),native(){}},V0={input:{...Xa,fileUrl:o(({value:e})=>({stream:jo(e)}),"fileUrl"),filePath:o(({value:{file:e}})=>({stream:jo(e)}),"filePath"),webStream:o(({value:e})=>({stream:ge.fromWeb(e)}),"webStream"),iterable:o(({value:e})=>({stream:ge.from(e)}),"iterable"),asyncIterable:o(({value:e})=>({stream:ge.from(e)}),"asyncIterable"),string:o(({value:e})=>({stream:ge.from(e)}),"string"),uint8Array:o(({value:e})=>({stream:ge.from(fn.from(e))}),"uint8Array")},output:{...Xa,fileUrl:o(({value:e})=>({stream:Uo(e)}),"fileUrl"),filePath:o(({value:{file:e,append:t}})=>({stream:Uo(e,t?{flags:"a"}:{})}),"filePath"),webStream:o(({value:e})=>({stream:dn.fromWeb(e)}),"webStream"),iterable:it,asyncIterable:it,string:it,uint8Array:it}};var Qa=o(e=>{throw TypeError(e)},"__typeError$1"),xa=o((e,t,n)=>t.has(e)||Qa("Cannot "+n),"__accessCheck$1"),V=o((e,t,n)=>(xa(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet$1"),ke=o((e,t,n)=>t.has(e)?Qa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd$1"),H0=o((e,t,n,r)=>(xa(e,t,"write to private field"),t.set(e,n),n),"__privateSet$1"),$e,Sr,vr,st,Nt,at;function Ar(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const i of e)Br(i);const t=e.some(({readableObjectMode:i})=>i),n=Y0(e,t),r=new $r({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of e)r.add(i);return r}o(Ar,"mergeStreams");const Y0=o((e,t)=>{if(e.length===0)return pt(t);const n=e.filter(({readableObjectMode:r})=>r===t).map(({readableHighWaterMark:r})=>r);return Math.max(...n)},"getHighWaterMark"),wo=class wo extends Wo{constructor(){super(...arguments),ke(this,$e,new Set([])),ke(this,Sr,new Set([])),ke(this,vr,new Set([])),ke(this,st),ke(this,Nt,Symbol("unpipe")),ke(this,at,new WeakMap)}add(t){if(Br(t),V(this,$e).has(t))return;V(this,$e).add(t),V(this,st)??H0(this,st,q0(this,V(this,$e),V(this,Nt)));const n=J0({passThroughStream:this,stream:t,streams:V(this,$e),ended:V(this,Sr),aborted:V(this,vr),onFinished:V(this,st),unpipeEvent:V(this,Nt)});V(this,at).set(t,n),t.pipe(this,{end:!1})}async remove(t){if(Br(t),!V(this,$e).has(t))return!1;const n=V(this,at).get(t);return n===void 0?!1:(V(this,at).delete(t),t.unpipe(this),await n,!0)}};o(wo,"MergedStream");let $r=wo;$e=new WeakMap,Sr=new WeakMap,vr=new WeakMap,st=new WeakMap,Nt=new WeakMap,at=new WeakMap;const q0=o(async(e,t,n)=>{kt(e,ru);const r=new AbortController;try{await Promise.race([K0(e,r),Z0(e,t,n,r)])}finally{r.abort(),kt(e,-ru)}},"onMergedStreamFinished"),K0=o(async(e,{signal:t})=>{try{await le(e,{signal:t,cleanup:!0})}catch(n){throw eu(e,n),n}},"onMergedStreamEnd"),Z0=o(async(e,t,n,{signal:r})=>{for await(const[i]of Dt(e,"unpipe",{signal:r}))t.has(i)&&i.emit(n)},"onInputStreamsUnpipe"),Br=o(e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},"validateStream"),J0=o(async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:a})=>{kt(e,ou);const u=new AbortController;try{await Promise.race([X0(s,t,u),Q0({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:u}),x0({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:a,controller:u})])}finally{u.abort(),kt(e,-ou)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Tr(e):e2(e))},"endWhenStreamsDone"),X0=o(async(e,t,{signal:n})=>{try{await e,n.aborted||Tr(t)}catch(r){n.aborted||eu(t,r)}},"afterMergedStreamFinished"),Q0=o(async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await le(t,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(a){if(s.aborted||!n.has(t))return;tu(a)?i.add(t):nu(e,a)}},"onInputStreamEnd"),x0=o(async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await G(e,i,{signal:s}),!e.readable)return G(s,"abort",{signal:s});t.delete(e),n.delete(e),r.delete(e)},"onInputStreamUnpipe"),e2=o(e=>{e.writable&&e.end()},"endStream"),eu=o((e,t)=>{tu(t)?Tr(e):nu(e,t)},"errorOrAbortStream"),tu=o(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isAbortError"),Tr=o(e=>{(e.readable||e.writable)&&e.destroy()},"abortStream"),nu=o((e,t)=>{e.destroyed||(e.once("error",t2),e.destroy(t))},"errorStream"),t2=o(()=>{},"noop"),kt=o((e,t)=>{const n=e.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&e.setMaxListeners(n+t)},"updateMaxListeners"),ru=2,ou=1,Ut=o((e,t)=>{e.pipe(t),n2(e,t),r2(e,t)},"pipeStreams"),n2=o(async(e,t)=>{if(!(Fe(e)||Fe(t))){try{await le(e,{cleanup:!0,readable:!0,writable:!1})}catch{}iu(t)}},"onSourceFinish"),iu=o(e=>{e.writable&&e.end()},"endDestinationStream"),r2=o(async(e,t)=>{if(!(Fe(e)||Fe(t))){try{await le(t,{cleanup:!0,readable:!1,writable:!0})}catch{}su(e)}},"onDestinationFinish"),su=o(e=>{e.readable&&e.destroy()},"abortSourceStream"),o2=o((e,t,n)=>{const r=new Map;for(const[i,{stdioItems:s,direction:a}]of Object.entries(t)){for(const{stream:u}of s.filter(({type:c})=>Ae.has(c)))i2(e,u,a,i);for(const{stream:u}of s.filter(({type:c})=>!Ae.has(c)))a2({subprocess:e,stream:u,direction:a,fdNumber:i,pipeGroups:r,controller:n})}for(const[i,s]of r.entries()){const a=s.length===1?s[0]:Ar(s);Ut(a,i)}},"pipeOutputAsync"),i2=o((e,t,n,r)=>{n==="output"?Ut(e.stdio[r],t):Ut(t,e.stdio[r]);const i=s2[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},"pipeTransform"),s2=["stdin","stdout","stderr"],a2=o(({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(t===void 0)return;u2(t,s);const[a,u]=n==="output"?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(a)??[];i.set(a,[...c,u])},"pipeStdioItem"),u2=o((e,{signal:t})=>{Fe(e)&&St(e,c2,t)},"setStandardStreamMaxListeners"),c2=2,Ue=[];Ue.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&Ue.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&Ue.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var l2=Object.defineProperty,au=o(e=>{throw TypeError(e)},"__typeError"),d2=o((e,t,n)=>t in e?l2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$1"),jt=o((e,t,n)=>d2(e,typeof t!="symbol"?t+"":t,n),"__publicField$1"),Ir=o((e,t,n)=>t.has(e)||au("Cannot "+n),"__accessCheck"),B=o((e,t,n)=>(Ir(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet"),De=o((e,t,n)=>t.has(e)?au("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd"),je=o((e,t,n,r)=>(Ir(e,t,"write to private field"),t.set(e,n),n),"__privateSet"),uu=o((e,t,n)=>(Ir(e,t,"access private method"),n),"__privateMethod"),Or,Z,L,ut,ct,We,Be,Wt,cu,lu;const Gt=o(e=>!!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","processOk"),Rr=Symbol.for("signal-exit emitter"),Mr=globalThis,f2=Object.defineProperty.bind(Object),yo=class yo{constructor(){if(jt(this,"emitted",{afterExit:!1,exit:!1}),jt(this,"listeners",{afterExit:[],exit:[]}),jt(this,"count",0),jt(this,"id",Math.random()),Mr[Rr])return Mr[Rr];f2(Mr,Rr,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,n){this.listeners[t].push(n)}removeListener(t,n){const r=this.listeners[t],i=r.indexOf(n);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(t,n,r){if(this.emitted[t])return!1;this.emitted[t]=!0;let i=!1;for(const s of this.listeners[t])i=s(n,r)===!0||i;return t==="exit"&&(i=this.emit("afterExit",n,r)||i),i}};o(yo,"Emitter");let _r=yo;const Eo=class Eo{};o(Eo,"SignalExitBase");let zt=Eo;const h2=o(e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),"signalExitWrap"),bo=class bo extends zt{onExit(){return()=>{}}load(){}unload(){}};o(bo,"SignalExitFallback");let Pr=bo;const Co=class Co extends zt{constructor(t){super(),De(this,Wt),De(this,Or,Nr.platform==="win32"?"SIGINT":"SIGHUP"),De(this,Z,new _r),De(this,L),De(this,ut),De(this,ct),De(this,We,{}),De(this,Be,!1),je(this,L,t),je(this,We,{});for(const n of Ue)B(this,We)[n]=()=>{const r=B(this,L).listeners(n);let{count:i}=B(this,Z);const s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();const a=B(this,Z).emit("exit",null,n),u=n==="SIGHUP"?B(this,Or):n;a||t.kill(t.pid,u)}};je(this,ct,t.reallyExit),je(this,ut,t.emit)}onExit(t,n){if(!Gt(B(this,L)))return()=>{};B(this,Be)===!1&&this.load();const r=n?.alwaysLast?"afterExit":"exit";return B(this,Z).on(r,t),()=>{B(this,Z).removeListener(r,t),B(this,Z).listeners.exit.length===0&&B(this,Z).listeners.afterExit.length===0&&this.unload()}}load(){if(!B(this,Be)){je(this,Be,!0),B(this,Z).count+=1;for(const t of Ue)try{const n=B(this,We)[t];n&&B(this,L).on(t,n)}catch{}B(this,L).emit=(t,...n)=>uu(this,Wt,lu).call(this,t,...n),B(this,L).reallyExit=t=>uu(this,Wt,cu).call(this,t)}}unload(){B(this,Be)&&(je(this,Be,!1),Ue.forEach(t=>{const n=B(this,We)[t];if(!n)throw new Error("Listener not defined for signal: "+t);try{B(this,L).removeListener(t,n)}catch{}}),B(this,L).emit=B(this,ut),B(this,L).reallyExit=B(this,ct),B(this,Z).count-=1)}};o(Co,"SignalExit");let Lr=Co;Or=new WeakMap,Z=new WeakMap,L=new WeakMap,ut=new WeakMap,ct=new WeakMap,We=new WeakMap,Be=new WeakMap,Wt=new WeakSet,cu=o(function(e){return Gt(B(this,L))?(B(this,L).exitCode=e||0,B(this,Z).emit("exit",B(this,L).exitCode,null),B(this,ct).call(B(this,L),B(this,L).exitCode)):0},"processReallyExit_fn"),lu=o(function(e,...t){const n=B(this,ut);if(e==="exit"&&Gt(B(this,L))){typeof t[0]=="number"&&(B(this,L).exitCode=t[0]);const r=n.call(B(this,L),e,...t);return B(this,Z).emit("exit",B(this,L).exitCode,null),r}else return n.call(B(this,L),e,...t)},"processEmit_fn");const Nr=globalThis.process,{onExit:D2}=h2(Gt(Nr)?new Lr(Nr):new Pr),p2=o((e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;const i=D2(()=>{e.kill()});ko(r,()=>{i()})},"cleanupOnExit"),m2=o(({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{const s=Ki(),{destination:a,destinationStream:u,destinationError:c,from:d,unpipeSignal:l}=g2(n,r,i),{sourceStream:f,sourceError:h}=w2(e,d),{options:D,fileDescriptors:p}=Ee.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:D,sourceError:h,destination:a,destinationStream:u,destinationError:c,unpipeSignal:l,fileDescriptors:p,startTime:s}},"normalizePipeArguments"),g2=o((e,t,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:a}={}}=F2(e,t,...n),u=Ss(r,s);return{destination:r,destinationStream:u,from:i,unpipeSignal:a}}catch(r){return{destinationError:r}}},"getDestinationStream"),F2=o((e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(du,e)(n,...r),pipeOptions:e};if(typeof n=="string"||n instanceof URL||Bi(n)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[i,s,a]=Ii(n,...r);return{destination:t(du)(i,s,a),pipeOptions:a}}if(Ee.has(n)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},"getDestination"),du=o(({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),"mapDestinationArguments"),w2=o((e,t)=>{try{return{sourceStream:Xn(e,t)}}catch(n){return{sourceError:n}}},"getSourceStream"),y2=o(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:a})=>{const u=E2({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(u!==void 0)throw fu({error:u,fileDescriptors:i,sourceOptions:s,startTime:a})},"handlePipeArgumentsError"),E2=o(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return su(e),r;if(t!==void 0)return iu(n),t},"getPipeArgumentsError"),fu=o(({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>hr({error:e,command:hu,escapedCommand:hu,fileDescriptors:t,options:n,startTime:r,isSync:!1}),"createNonCommandError"),hu="source.pipe(destination)",b2=o(async e=>{const[{status:t,reason:n,value:r=n},{status:i,reason:s,value:a=s}]=await e;if(a.pipedFrom.includes(r)||a.pipedFrom.push(r),i==="rejected")throw a;if(t==="rejected")throw r;return a},"waitForBothSubprocesses"),C2=o((e,t,n)=>{const r=Vt.has(t)?v2(e,t):S2(e,t);return St(e,$2,n.signal),St(t,B2,n.signal),A2(t),r},"pipeSubprocessStream"),S2=o((e,t)=>{const n=Ar([e]);return Ut(n,t),Vt.set(t,n),n},"pipeFirstSubprocessStream"),v2=o((e,t)=>{const n=Vt.get(t);return n.add(e),n},"pipeMoreSubprocessStream"),A2=o(async e=>{try{await le(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Vt.delete(e)},"cleanupMergedStreamsMap"),Vt=new WeakMap,$2=2,B2=1,T2=o((e,t)=>e===void 0?[]:[I2(e,t)],"unpipeOnAbort"),I2=o(async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await _c(e,t),await n.remove(t);const a=new Error("Pipe canceled by `unpipeSignal` option.");throw fu({error:a,fileDescriptors:r,sourceOptions:i,startTime:s})},"unpipeOnSignalAbort"),kr=o((e,...t)=>{if(K(t[0]))return kr.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});const{destination:n,...r}=m2(e,...t),i=O2({...r,destination:n});return i.pipe=kr.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},"pipeToSubprocess"),O2=o(async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:a,unpipeSignal:u,fileDescriptors:c,startTime:d})=>{const l=R2(e,i);y2({sourceStream:t,sourceError:r,destinationStream:s,destinationError:a,fileDescriptors:c,sourceOptions:n,startTime:d});const f=new AbortController;try{const h=C2(t,s,f);return await Promise.race([b2(l),...T2(u,{sourceStream:t,mergedStream:h,sourceOptions:n,fileDescriptors:c,startTime:d})])}finally{f.abort()}},"handlePipePromise"),R2=o((e,t)=>Promise.allSettled([e,t]),"getSubprocessPromises"),Du=o(({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const a=new AbortController;return M2(t,a),mu({stream:e,controller:a,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},"iterateOnSubprocessStream"),M2=o(async(e,t)=>{try{await e}catch{}finally{t.abort()}},"stopReadingOnExit"),pu=o(({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const a=new AbortController;_2(t,a,e);const u=e.readableObjectMode&&!s;return mu({stream:e,controller:a,binary:r==="buffer",shouldEncode:!u,encoding:r,shouldSplit:!u&&n,preserveNewlines:!i})},"iterateForResult"),_2=o(async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},"stopReadingOnStreamEnd"),mu=o(({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})=>{const u=Dt(e,"data",{signal:t.signal,highWaterMark:Fu,highWatermark:Fu});return P2({onStdoutChunk:u,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})},"iterateOnStream"),gu=pt(!0),Fu=gu,P2=o(async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a}){const u=L2({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a});try{for await(const[c]of e)yield*rt(c,u,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*Cr(u)}},"iterateOnData"),L2=o(({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[ka(e,n,!t),Ma(e,i,!r,{})].filter(Boolean),"getGenerators"),N2=o(async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:s,lines:a,allMixed:u,stripFinalNewline:c,verboseInfo:d,streamInfo:l})=>{const f=k2({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:u,verboseInfo:d,streamInfo:l});if(!i){await Promise.all([U2(e),f]);return}const h=Ra(c,n),D=pu({stream:e,onStreamEnd:t,lines:a,encoding:r,stripFinalNewline:h,allMixed:u}),[p]=await Promise.all([j2({stream:e,iterable:D,fdNumber:n,encoding:r,maxBuffer:s,lines:a}),f]);return p},"getStreamOutput"),k2=o(async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!Va({stdioItems:a[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const u=pu({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await n0(u,e,n,s)},"logOutputAsync"),U2=o(async e=>{await Uc(),e.readableFlowing===null&&e.resume()},"resumeStream"),j2=o(async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:a})=>{try{return t||a?await yD(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await vD(n,{maxBuffer:s})):await PD(n,{maxBuffer:s})}catch(u){return yu(WD({error:u,stream:e,readableObjectMode:t,lines:a,encoding:i,fdNumber:r}))}},"getStreamContents"),wu=o(async e=>{try{return await e}catch(t){return yu(t)}},"getBufferedData"),yu=o(({bufferedData:e})=>Ql(e)?new Uint8Array(e):e,"handleBufferedData"),Ur=o(async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=W2(e,n),a=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],le(e,{cleanup:!0,signal:a.signal})])}catch(u){s.stdinCleanedUp||V2(u,t,n,r)}finally{a.abort()}},"waitForStream"),W2=o((e,{originalStreams:[t],subprocess:n})=>{const r={stdinCleanedUp:!1};return e===t&&G2(e,n,r),r},"handleStdinDestroy"),G2=o((e,t,n)=>{const{_destroy:r}=e;e._destroy=(...i)=>{z2(t,n),r.call(e,...i)}},"spyOnStdinDestroy"),z2=o(({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},"setStdinCleanedUp"),V2=o((e,t,n,r)=>{if(!H2(e,t,n,r))throw e},"handleStreamError"),H2=o((e,t,n,r=!0)=>n.propagating?bu(e)||jr(e):(n.propagating=!0,Eu(n,t)===r?bu(e):jr(e)),"shouldIgnoreStreamError"),Eu=o(({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input","isInputFileDescriptor"),jr=o(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isStreamAbort"),bu=o(e=>e?.code==="EPIPE","isStreamEpipe"),Y2=o(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:u})=>e.stdio.map((c,d)=>Cu({stream:c,fdNumber:d,encoding:t,buffer:n[d],maxBuffer:r[d],lines:i[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:u})),"waitForStdioStreams"),Cu=o(async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:d})=>{if(!e)return;const l=Ur(e,t,d);if(Eu(d,t)){await l;return}const[f]=await Promise.all([N2({stream:e,onStreamEnd:l,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:d}),l]);return f},"waitForSubprocessStream"),q2=o(({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Ar([e,t].filter(Boolean)):void 0,"makeAllStream"),K2=o(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:u})=>Cu({...Z2(e,n),fdNumber:"all",encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:J2(e),stripFinalNewline:s,verboseInfo:a,streamInfo:u}),"waitForAllStream"),Z2=o(({stdout:e,stderr:t,all:n},[,r,i])=>{const s=r||i;return s?r?i?{stream:n,buffer:s}:{stream:e,buffer:s}:{stream:t,buffer:s}:{stream:n,buffer:s}},"getAllStream"),J2=o(({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,"getAllMixed"),X2=o(e=>Tn(e,"ipc"),"shouldLogIpc"),Q2=o((e,t)=>{const n=qi(e);Je({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:t})},"logIpcOutput"),x2=o(async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const a=X2(s),u=Ze(t,"ipc"),c=Ze(n,"ipc");for await(const d of Ka({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))u&&(zD(e,i,c),i.push(d)),a&&Q2(d,s);return i},"waitForIpcOutput"),eg=o(async(e,t)=>(await Promise.allSettled([e]),t),"getBufferedIpcOutput"),tg=o(async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:s,cancelSignal:a,gracefulCancel:u,forceKillAfterDelay:c,stripFinalNewline:d,ipc:l,ipcInput:f},context:h,verboseInfo:D,fileDescriptors:p,originalStreams:m,onInternalError:F,controller:g})=>{const w=f0(e,h),E={originalStreams:m,fileDescriptors:p,subprocess:e,exitPromise:w,propagating:!1},y=Y2({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:d,verboseInfo:D,streamInfo:E}),b=K2({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:d,verboseInfo:D,streamInfo:E}),v=[],S=x2({subprocess:e,buffer:n,maxBuffer:r,ipc:l,ipcOutput:v,verboseInfo:D}),A=ng(m,e,E),_=rg(p,E);try{return await Promise.race([Promise.all([{},D0(w),Promise.all(y),b,S,Jh(e,f),...A,..._]),F,og(e,g),...Gh(e,s,h,g),...Xf({subprocess:e,cancelSignal:a,gracefulCancel:u,context:h,controller:g}),...kh({subprocess:e,cancelSignal:a,gracefulCancel:u,forceKillAfterDelay:c,context:h,controller:g})])}catch(J){return h.terminationReason??(h.terminationReason="other"),Promise.all([{error:J},w,Promise.all(y.map(H=>wu(H))),wu(b),eg(S,v),Promise.allSettled(A),Promise.allSettled(_)])}},"waitForSubprocessResult"),ng=o((e,t,n)=>e.map((r,i)=>r===t.stdio[i]?void 0:Ur(r,i,n)),"waitForOriginalStreams"),rg=o((e,t)=>e.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>Ce(s,{checkOpen:!1})&&!Fe(s)).map(({type:i,value:s,stream:a=s})=>Ur(a,r,t,{isSameDirection:Ae.has(i),stopOnExit:i==="native"}))),"waitForCustomStreamsEnd"),og=o(async(e,{signal:t})=>{const[n]=await G(e,"error",{signal:t});throw n},"throwOnSubprocessError"),ig=o(()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),"initializeConcurrentStreams"),Wr=o((e,t,n)=>{const r=e[n];r.has(t)||r.set(t,[]);const i=r.get(t),s=xe();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},"addConcurrentStream"),Ht=o(async({resolve:e,promises:t},n)=>{e();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},"waitForConcurrentStreams"),Su=o(async e=>{if(e!==void 0)try{await vu(e)}catch{}},"safeWaitForSubprocessStdin"),sg=o(async e=>{if(e!==void 0)try{await Au(e)}catch{}},"safeWaitForSubprocessStdout"),vu=o(async e=>{await le(e,{cleanup:!0,readable:!1,writable:!0})},"waitForSubprocessStdin"),Au=o(async e=>{await le(e,{cleanup:!0,readable:!0,writable:!1})},"waitForSubprocessStdout"),$u=o(async(e,t)=>{if(await e,t)throw t},"waitForSubprocess"),Bu=o((e,t,n)=>{n&&!jr(n)?e.destroy(n):t&&e.destroy()},"destroyOtherStream"),ag=o(({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||be.has(n),{subprocessStdout:u,waitReadableDestroy:c}=Tu(e,r,t),{readableEncoding:d,readableObjectMode:l,readableHighWaterMark:f}=Iu(u,a),{read:h,onStdoutDataDone:D}=Ou({subprocessStdout:u,subprocess:e,binary:a,encoding:n,preserveNewlines:s}),p=new ge({read:h,destroy:Re(Mu.bind(void 0,{subprocessStdout:u,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:l,encoding:d});return Ru({subprocessStdout:u,onStdoutDataDone:D,readable:p,subprocess:e}),p},"createReadable"),Tu=o((e,t,n)=>{const r=Xn(e,t),i=Wr(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},"getSubprocessStdout"),Iu=o(({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:gu},"getReadableOptions"),Ou=o(({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{const s=xe(),a=Du({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){ug(this,a,s)},onStdoutDataDone:s}},"getReadableMethods"),ug=o(async(e,t,n)=>{try{const{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},"onRead"),Ru=o(async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Au(e),await r,await Su(i),await t,n.readable&&n.push(null)}catch(s){await Su(i),_u(n,s)}},"onStdoutFinished"),Mu=o(async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Ht(n,t)&&(_u(e,r),await $u(t,r))},"onReadableDestroy"),_u=o((e,t)=>{Bu(e,e.readable,t)},"destroyOtherReadable"),cg=o(({subprocess:e,concurrentStreams:t},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=Pu(e,n,t),a=new dn({...Lu(r,e,i),destroy:Re(ku.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Nu(r,a),a},"createWritable"),Pu=o((e,t,n)=>{const r=Ss(e,t),i=Wr(n,r,"writableFinal"),s=Wr(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},"getSubprocessStdin"),Lu=o((e,t,n)=>({write:lg.bind(void 0,e),final:Re(dg.bind(void 0,e,t,n))}),"getWritableMethods"),lg=o((e,t,n,r)=>{e.write(t,n)?r():e.once("drain",r)},"onWrite"),dg=o(async(e,t,n)=>{await Ht(n,t)&&(e.writable&&e.end(),await t)},"onWritableFinal"),Nu=o(async(e,t,n)=>{try{await vu(e),t.writable&&t.end()}catch(r){await sg(n),Uu(t,r)}},"onStdinFinished"),ku=o(async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Ht(n,t),await Ht(r,t)&&(Uu(e,i),await $u(t,i))},"onWritableDestroy"),Uu=o((e,t)=>{Bu(e,e.writable,t)},"destroyOtherWritable"),fg=o(({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:a=!0}={})=>{const u=s||be.has(n),{subprocessStdout:c,waitReadableDestroy:d}=Tu(e,r,t),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:h}=Pu(e,i,t),{readableEncoding:D,readableObjectMode:p,readableHighWaterMark:m}=Iu(c,u),{read:F,onStdoutDataDone:g}=Ou({subprocessStdout:c,subprocess:e,binary:u,encoding:n,preserveNewlines:a}),w=new ln({read:F,...Lu(l,e,f),destroy:Re(hg.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:e,waitReadableDestroy:d,waitWritableFinal:f,waitWritableDestroy:h})),readableHighWaterMark:m,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:p,writableObjectMode:l.writableObjectMode,encoding:D});return Ru({subprocessStdout:c,onStdoutDataDone:g,readable:w,subprocess:e,subprocessStdin:l}),Nu(l,w,c),w},"createDuplex"),hg=o(async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},a)=>{await Promise.all([Mu({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},a),ku({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},a)])},"onDuplexDestroy"),ju=o((e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||be.has(t),a=Xn(e,n),u=Du({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:i});return Dg(u,a,e)},"createIterable"),Dg=o(async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},"iterateOnStdoutData"),pg=o((e,{encoding:t})=>{const n=ig();e.readable=ag.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=cg.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=fg.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=ju.bind(void 0,e,t),e[Symbol.asyncIterator]=ju.bind(void 0,e,t,{})},"addConvertedStreams"),mg=o((e,t)=>{for(const[n,r]of Fg){const i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},"mergePromise"),gg=(async()=>{})().constructor.prototype,Fg=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(gg,e)]),wg=o((e,t,n,r)=>{const{file:i,commandArguments:s,command:a,escapedCommand:u,startTime:c,verboseInfo:d,options:l,fileDescriptors:f}=yg(e,t,n),{subprocess:h,promise:D}=bg({file:i,commandArguments:s,options:l,startTime:c,verboseInfo:d,command:a,escapedCommand:u,fileDescriptors:f});return h.pipe=kr.bind(void 0,{source:h,sourcePromise:D,boundOptions:{},createNested:r}),mg(h,D),Ee.set(h,{options:l,fileDescriptors:f}),h},"execaCoreAsync"),yg=o((e,t,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=Ji(e,t,n),{file:u,commandArguments:c,options:d}=Us(e,t,n),l=Eg(d),f=z0(l,a);return{file:u,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:f}},"handleAsyncArguments"),Eg=o(({timeout:e,signal:t,...n})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:e}},"handleAsyncOptions"),bg=o(({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:a,fileDescriptors:u})=>{let c;try{c=Oc(...js(e,t,n))}catch(p){return N0({error:p,command:s,escapedCommand:a,fileDescriptors:u,options:n,startTime:r,verboseInfo:i})}const d=new AbortController;Wc(Number.POSITIVE_INFINITY,d.signal);const l=[...c.stdio];o2(c,u,d),p2(c,n,d);const f={},h=xe();c.kill=Yf.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:h,context:f,controller:d}),c.all=q2(c,n),pg(c,n),P0(c,n);const D=Cg({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:u,originalStreams:l,command:s,escapedCommand:a,context:f,onInternalError:h,controller:d});return{subprocess:c,promise:D}},"spawnSubprocessAsync"),Cg=o(async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:s,command:a,escapedCommand:u,context:c,onInternalError:d,controller:l})=>{const[f,[h,D],p,m,F]=await tg({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:d,controller:l});l.abort(),d.resolve();const g=p.map((y,b)=>Ne(y,t,b)),w=Ne(m,t,"all"),E=Sg({errorInfo:f,exitCode:h,signal:D,stdio:g,all:w,ipcOutput:F,context:c,options:t,command:a,escapedCommand:u,startTime:n});return pr(E,r,t)},"handlePromise"),Sg=o(({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:s,context:a,options:u,command:c,escapedCommand:d,startTime:l})=>"error"in e?Dr({error:e.error,command:c,escapedCommand:d,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof _e,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:s,options:u,startTime:l,isSync:!1}):ca({command:c,escapedCommand:d,stdio:r,all:i,ipcOutput:s,options:u,startTime:l}),"getAsyncResult"),Gr=o((e,t)=>{const n=Object.fromEntries(Object.entries(t).map(([r,i])=>[r,vg(r,e[r],i)]));return{...e,...n}},"mergeOptions"),vg=o((e,t,n)=>Ag.has(e)&&K(t)&&K(n)?{...t,...n}:n,"mergeOption"),Ag=new Set(["env",...Gi]),Te=o((e,t,n,r)=>{const i=o((a,u,c)=>Te(a,u,n,c),"createNested"),s=o((...a)=>$g({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a),"boundExeca");return r!==void 0&&r(s,i,t),s},"createExeca"),$g=o(({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...a)=>{if(K(s))return i(e,Gr(n,s),r);const{file:u,commandArguments:c,options:d,isSync:l}=Bg({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:n});return l?F0(u,c,d):wg(u,c,d,i)},"callBoundExeca"),Bg=o(({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=id(t)?sd(t,n):[t,...n],[a,u,c]=Ii(...s),d=Gr(Gr(r,i),c),{file:l=a,commandArguments:f=u,options:h=d,isSync:D=!1}=e({file:a,commandArguments:u,options:d});return{file:l,commandArguments:f,options:h,isSync:D}},"parseArguments"),Tg=o(({file:e,commandArguments:t})=>Wu(e,t),"mapCommandAsync"),Ig=o(({file:e,commandArguments:t})=>({...Wu(e,t),isSync:!0}),"mapCommandSync"),Wu=o((e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);const[n,...r]=Og(e);return{file:n,commandArguments:r}},"parseCommand"),Og=o(e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);const t=e.trim();if(t==="")return[];const n=[];for(const r of t.split(Rg)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},"parseCommandString"),Rg=/ +/g,Mg=o((e,t,n)=>{e.sync=t(Pg,n),e.s=e.sync},"setScriptSync"),_g=o(({options:e})=>Gu(e),"mapScriptAsync"),Pg=o(({options:e})=>({...Gu(e),isSync:!0}),"mapScriptSync"),Gu=o(e=>({options:{...Lg(e),...e}}),"getScriptOptions"),Lg=o(({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},"getScriptStdinOption"),Ng={preferLocal:!0},Ge=Te(()=>({}));Te(()=>({isSync:!0})),Te(Tg),Te(Ig),Te(Vh),Te(_g,{},Ng,Mg),L0();let Ie=!0;const ze=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let lt=0;if(ze.process&&ze.process.env&&ze.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:n,TERM:r,COLORTERM:i}=ze.process.env;t||n||e==="0"?Ie=!1:e==="1"||e==="2"||e==="3"?Ie=!0:r==="dumb"?Ie=!1:"CI"in ze.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in ze.process.env)?Ie=!0:Ie=process.stdout.isTTY,Ie&&(process.platform==="win32"||i&&(i==="truecolor"||i==="24bit")?lt=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?lt=2:lt=1)}let zu={enabled:Ie,supportLevel:lt};function dt(e,t,n=1){const r=`\x1B[${e}m`,i=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return a=>zu.enabled&&zu.supportLevel>=n?r+(""+a).replace(s,r)+i:""+a}o(dt,"kolorist");const zr=dt(2,22),Vu=dt(30,39),Yt=dt(31,39),ft=dt(32,39),Hu=dt(46,49),kg=o(e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,"isAmbiguous"),Ug=o(e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,"isFullWidth"),jg=o(e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,"isWide"),Vr=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,qt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Kt=/\t{1,1000}/y,Hr=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),Zt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Wg=new RegExp("\\p{M}+","gu"),Gg={limit:1/0,ellipsis:""},Yu=o((e,t={},n={})=>{const r=t.limit??1/0,i=t.ellipsis??"",s=t?.ellipsisWidth??(i?Yu(i,Gg,n).width:0),a=n.ansiWidth??0,u=n.controlWidth??0,c=n.tabWidth??8,d=n.ambiguousWidth??1,l=n.emojiWidth??2,f=n.fullWidthWidth??2,h=n.regularWidth??1,D=n.wideWidth??2;let p=0,m=0,F=e.length,g=0,w=!1,E=F,y=Math.max(0,r-s),b=0,v=0,S=0,A=0;e:for(;;){if(v>b||m>=F&&m>p){const _=e.slice(b,v)||e.slice(p,m);g=0;for(const J of _.replaceAll(Wg,"")){const H=J.codePointAt(0)||0;if(Ug(H)?A=f:jg(H)?A=D:d!==h&&kg(H)?A=d:A=h,S+A>y&&(E=Math.min(E,Math.max(b,p)+g)),S+A>r){w=!0;break e}g+=J.length,S+=A}b=v=0}if(m>=F)break;if(Zt.lastIndex=m,Zt.test(e)){if(g=Zt.lastIndex-m,A=g*h,S+A>y&&(E=Math.min(E,m+Math.floor((y-S)/h))),S+A>r){w=!0;break}S+=A,b=p,v=m,m=p=Zt.lastIndex;continue}if(Vr.lastIndex=m,Vr.test(e)){if(S+a>y&&(E=Math.min(E,m)),S+a>r){w=!0;break}S+=a,b=p,v=m,m=p=Vr.lastIndex;continue}if(qt.lastIndex=m,qt.test(e)){if(g=qt.lastIndex-m,A=g*u,S+A>y&&(E=Math.min(E,m+Math.floor((y-S)/u))),S+A>r){w=!0;break}S+=A,b=p,v=m,m=p=qt.lastIndex;continue}if(Kt.lastIndex=m,Kt.test(e)){if(g=Kt.lastIndex-m,A=g*c,S+A>y&&(E=Math.min(E,m+Math.floor((y-S)/c))),S+A>r){w=!0;break}S+=A,b=p,v=m,m=p=Kt.lastIndex;continue}if(Hr.lastIndex=m,Hr.test(e)){if(S+l>y&&(E=Math.min(E,m)),S+l>r){w=!0;break}S+=l,b=p,v=m,m=p=Hr.lastIndex;continue}m+=1}return{width:w?y:S,index:w?E:F,truncated:w,ellipsed:w&&r>=s}},"getStringTruncatedWidth"),zg={limit:1/0,ellipsis:"",ellipsisWidth:0},pe=o((e,t={})=>Yu(e,zg,t).width,"fastStringWidth"),Jt="\x1B",qu="\x9B",Vg=39,Yr="\x07",Ku="[",Hg="]",Zu="m",qr=`${Hg}8;;`,Ju=new RegExp(`(?:\\${Ku}(?<code>\\d+)m|\\${qr}(?<uri>.*)${Yr})`,"y"),Xu=o(e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},"getClosingCode"),Qu=o(e=>`${Jt}${Ku}${e}${Zu}`,"wrapAnsiCode"),xu=o(e=>`${Jt}${qr}${e}${Yr}`,"wrapAnsiHyperlink"),Kr=o((e,t,n)=>{const r=t[Symbol.iterator]();let i=!1,s=!1,a=e.at(-1),u=a===void 0?0:pe(a),c=r.next(),d=r.next(),l=0;for(;!c.done;){const f=c.value,h=pe(f);u+h<=n?e[e.length-1]+=f:(e.push(f),u=0),(f===Jt||f===qu)&&(i=!0,s=t.startsWith(qr,l+1)),i?s?f===Yr&&(i=!1,s=!1):f===Zu&&(i=!1):(u+=h,u===n&&!d.done&&(e.push(""),u=0)),c=d,d=r.next(),l+=f.length}a=e.at(-1),!u&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},"wrapWord"),Yg=o(e=>{const t=e.split(" ");let n=t.length;for(;n&&!pe(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},"stringVisibleTrimSpacesRight"),qg=o((e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",i,s;const a=e.split(" ");let u=[""],c=0;for(let f=0;f<a.length;f++){const h=a[f];if(n.trim!==!1){const p=u.at(-1)??"",m=p.trimStart();p.length!==m.length&&(u[u.length-1]=m,c=pe(m))}f!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(u.push(""),c=0),(c||n.trim===!1)&&(u[u.length-1]+=" ",c++));const D=pe(h);if(n.hard&&D>t){const p=t-c,m=1+Math.floor((D-p-1)/t);Math.floor((D-1)/t)<m&&u.push(""),Kr(u,h,t),c=pe(u.at(-1)??"");continue}if(c+D>t&&c&&D){if(n.wordWrap===!1&&c<t){Kr(u,h,t),c=pe(u.at(-1)??"");continue}u.push(""),c=0}if(c+D>t&&n.wordWrap===!1){Kr(u,h,t),c=pe(u.at(-1)??"");continue}u[u.length-1]+=h,c+=D}n.trim!==!1&&(u=u.map(f=>Yg(f)));const d=u.join(`
|
|
65
|
-
`);let l=!1;for(let f=0;f<d.length;f++){const h=d[f];if(r+=h,!l)l=h>="\uD800"&&h<="\uDBFF";else continue;if(h===Jt||h===qu){Ju.lastIndex=f+1;const
|
|
66
|
-
`){s&&(r+=xu(""));const
|
|
64
|
+
if (condition) { yield value; }`)},"validateEmptyReturn"),ka=o((e,t,n)=>{if(n)return;if(e)return{transform:Um.bind(void 0,new TextEncoder)};const r=new To(t);return{transform:jm.bind(void 0,r),final:Wm.bind(void 0,r)}},"getEncodingTransformGenerator"),Um=o(function*(e,t){fn.isBuffer(t)?yield Ke(t):typeof t=="string"?yield e.encode(t):yield t},"encodingUint8ArrayGenerator"),jm=o(function*(e,t){yield X(t)?e.write(t):t},"encodingStringGenerator"),Wm=o(function*(e){const t=e.end();t!==""&&(yield t)},"encodingStringFinal"),Ua=Re(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(const i of t.currentIterable)r.push(i)}finally{delete t.currentIterable}}),br=o(async function*(e,t,n){if(n===t.length){yield e;return}const{transform:r=Hm}=t[n];for await(const i of r(e))yield*br(i,t,n+1)},"transformChunk"),Gm=o(async function*(e){for(const[t,{final:n}]of Object.entries(e))yield*zm(n,Number(t),e)},"finalChunks"),zm=o(async function*(e,t,n){if(e!==void 0)for await(const r of e())yield*br(r,n,t+1)},"generatorFinalChunks"),Vm=Re(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Hm=o(function*(e){yield e},"identityGenerator$1"),ja=o((e,t,n,r)=>{try{for(const i of e(...t))n.push(i);r()}catch(i){r(i)}},"pushChunksSync"),Ym=o((e,t)=>[...t.flatMap(n=>[...rt(n,e,0)]),...Cr(e)],"runTransformSync"),rt=o(function*(e,t,n){if(n===t.length){yield e;return}const{transform:r=Km}=t[n];for(const i of r(e))yield*rt(i,t,n+1)},"transformChunkSync"),Cr=o(function*(e){for(const[t,{final:n}]of Object.entries(e))yield*qm(n,Number(t),e)},"finalChunksSync"),qm=o(function*(e,t,n){if(e!==void 0)for(const r of e())yield*rt(r,n,t+1)},"generatorFinalChunksSync"),Km=o(function*(e){yield e},"identityGenerator"),Wa=o(({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:a})=>{const u={},c=za(e,a,s),d=Pe(t),l=Pe(n),f=d?Ua.bind(void 0,br,u):ja.bind(void 0,rt),h=d||l?Ua.bind(void 0,Gm,u):ja.bind(void 0,Cr),p=d||l?Vm.bind(void 0,u):void 0;return{stream:new Yc({writableObjectMode:r,writableHighWaterMark:pt(r),readableObjectMode:i,readableHighWaterMark:pt(i),transform(m,F,g){f([m,c,0],this,g)},flush(m){h([c],this,m)},destroy:p})}},"generatorToStream"),Ga=o((e,t,n,r)=>{const i=t.filter(({type:a})=>a==="generator"),s=r?i.reverse():i;for(const{value:a,optionName:u}of s){const c=za(a,n,u);e=Ym(c,e)}return e},"runGeneratorsSync"),za=o(({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},a,u)=>{const c={};return[{transform:_m(r,u)},ka(n,a,r),Ma(n,s,r,c),{transform:e,final:t},{transform:Lm(i,u)},Tm({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},"addInternalGenerators"),Zm=o((e,t)=>{for(const n of Jm(e))Xm(e,n,t)},"addInputOptionsSync"),Jm=o(e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),"getInputFdNumbers"),Xm=o((e,t,n)=>{const{stdioItems:r}=e[t],i=r.filter(({contents:u})=>u!==void 0);if(i.length===0)return;if(t!==0){const[{type:u,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Pt[u]} with synchronous methods.`)}const a=i.map(({contents:u})=>u).map(u=>Qm(u,r));n.input=An(a)},"addInputOptionSync"),Qm=o((e,t)=>{const n=Ga(e,t,"utf8",!0);return xm(n),An(n)},"applySingleInputGeneratorsSync"),xm=o(e=>{const t=e.find(n=>typeof n!="string"&&!X(n));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},"validateSerializable"),Va=o(({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!=="all"&&Tn(n,r)&&!be.has(t)&&e0(r)&&(e.some(({type:i,value:s})=>i==="native"&&t0.has(s))||e.every(({type:i})=>Ae.has(i))),"shouldLogOutput"),e0=o(e=>e===1||e===2,"fdUsesVerbose"),t0=new Set(["pipe","overlapped"]),n0=o(async(e,t,n,r)=>{for await(const i of e)o0(t)||Ha(i,n,r)},"logLines"),r0=o((e,t,n)=>{for(const r of e)Ha(r,t,n)},"logLinesSync"),o0=o(e=>e._readableState.pipes.length>0,"isPipingStream"),Ha=o((e,t,n)=>{const r=qi(e);Je({type:"output",verboseMessage:r,fdNumber:t,verboseInfo:n})},"logLine"),i0=o(({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};const s={},a=new Set([]);return{output:t.map((c,d)=>s0({result:c,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:r,verboseInfo:i},n)),...s}},"transformOutputSync"),s0=o(({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:s,verboseInfo:a},{buffer:u,encoding:c,lines:d,stripFinalNewline:l,maxBuffer:f})=>{if(e===null)return;const h=qD(e,s,f),p=Ke(h),{stdioItems:D,objectMode:m}=t[n],F=a0([p],D,c,r),{serializedResult:g,finalResult:w=g}=u0({chunks:F,objectMode:m,encoding:c,lines:d,stripFinalNewline:l,fdNumber:n});c0({serializedResult:g,fdNumber:n,state:r,verboseInfo:a,encoding:c,stdioItems:D,objectMode:m});const E=u[n]?w:void 0;try{return r.error===void 0&&l0(g,D,i),E}catch(y){return r.error=y,E}},"transformOutputResultSync"),a0=o((e,t,n,r)=>{try{return Ga(e,t,n,!1)}catch(i){return r.error=i,e}},"runOutputGeneratorsSync"),u0=o(({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(t)return{serializedResult:e};if(n==="buffer")return{serializedResult:An(e)};const a=td(e,n);return r[s]?{serializedResult:a,finalResult:_a(a,!i[s],t)}:{serializedResult:a}},"serializeChunks"),c0=o(({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:a})=>{if(!Va({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:t}))return;const u=_a(e,!1,a);try{r0(u,t,r)}catch(c){n.error??(n.error=c)}},"logOutputSync"),l0=o((e,t,n)=>{for(const{path:r,append:i}of t.filter(({type:s})=>ya.has(s))){const s=typeof r=="string"?r:r.toString();i||n.has(s)?Vc(r,e):(n.add(s),Hc(r,e))}},"writeToFiles"),d0=o(([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Ne(t,n,"all")]:Array.isArray(t)?[Ne(e,n,"all"),...t]:X(e)&&X(t)?_i([e,t]):`${e}${t}`},"getAllSync"),f0=o(async(e,t)=>{const[n,r]=await h0(e);return t.isForcefullyTerminated??(t.isForcefullyTerminated=!1),[n,r]},"waitForExit"),h0=o(async e=>{const[t,n]=await Promise.allSettled([G(e,"spawn"),G(e,"exit")]);return t.status==="rejected"?[]:n.status==="rejected"?Ya(e):n.value},"waitForExitOrError"),Ya=o(async e=>{try{return await G(e,"exit")}catch{return Ya(e)}},"waitForSubprocessExit"),D0=o(async e=>{const[t,n]=await e;if(!p0(t,n)&&qa(t,n))throw new ye;return[t,n]},"waitForSuccessfulExit"),p0=o((e,t)=>e===void 0&&t===void 0,"isSubprocessErrorExit"),qa=o((e,t)=>e!==0||t!==null,"isFailedExit"),m0=o(({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{const s=g0(e,t,n),a=s?.code==="ETIMEDOUT",u=YD(s,r,i);return{resultError:s,exitCode:t,signal:n,timedOut:a,isMaxBuffer:u}},"getExitResultSync"),g0=o((e,t,n)=>e!==void 0?e:qa(t,n)?new ye:void 0,"getResultError"),F0=o((e,t,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:a,startTime:u,verboseInfo:c,options:d,fileDescriptors:l}=w0(e,t,n),f=b0({file:r,commandArguments:i,options:d,command:s,escapedCommand:a,verboseInfo:c,fileDescriptors:l,startTime:u});return pr(f,c,d)},"execaCoreSync"),w0=o((e,t,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=Ji(e,t,n),u=y0(n),{file:c,commandArguments:d,options:l}=Us(e,t,u);E0(l);const f=Cm(l,a);return{file:c,commandArguments:d,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:f}},"handleSyncArguments"),y0=o(e=>e.node&&!e.ipc?{...e,ipc:!1}:e,"normalizeSyncOptions"),E0=o(({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Lt("ipcInput"),e&&Lt("ipc: true"),n&&Lt("detached: true"),r&&Lt("cancelSignal")},"validateSyncOptions"),Lt=o(e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},"throwInvalidSyncOption"),b0=o(({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:a,startTime:u})=>{const c=C0({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:u});if(c.failed)return c;const{resultError:d,exitCode:l,signal:f,timedOut:h,isMaxBuffer:p}=m0(c,n),{output:D,error:m=d}=i0({fileDescriptors:a,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:s}),F=D.map((w,E)=>Ne(w,n,E)),g=Ne(d0(D,n),n,"all");return v0({error:m,exitCode:l,signal:f,timedOut:h,isMaxBuffer:p,stdio:F,all:g,options:n,command:r,escapedCommand:i,startTime:u})},"spawnSubprocessSync"),C0=o(({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:a})=>{try{Zm(s,n);const u=S0(n);return Ic(...js(e,t,u))}catch(u){return hr({error:u,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:a,isSync:!0})}},"runSubprocessSync"),S0=o(({encoding:e,maxBuffer:t,...n})=>({...n,encoding:"buffer",maxBuffer:fr(t)}),"normalizeSpawnSyncOptions"),v0=o(({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:s,all:a,options:u,command:c,escapedCommand:d,startTime:l})=>e===void 0?ca({command:c,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:u,startTime:l}):Dr({error:e,command:c,escapedCommand:d,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:s,all:a,ipcOutput:[],options:u,startTime:l,isSync:!0}),"getSyncResult"),A0=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(Zn({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:Is(e)}),$0({anyProcess:e,channel:t,isSubprocess:n,filter:s,reference:i})),"getOneMessage"),$0=o(async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Bs(t,i);const s=At(e,t,n),a=new AbortController;try{return await Promise.race([B0(s,r,a),T0(s,n,a),I0(s,n,a)])}catch(u){throw Jn(e),u}finally{a.abort(),Ts(t,i)}},"getOneMessageAsync"),B0=o(async(e,t,{signal:n})=>{if(t===void 0){const[r]=await G(e,"message",{signal:n});return r}for await(const[r]of Dt(e,"message",{signal:n}))if(t(r))return r},"getMessage"),T0=o(async(e,t,{signal:n})=>{await G(e,"disconnect",{signal:n}),eh(t)},"throwOnDisconnect"),I0=o(async(e,t,{signal:n})=>{const[r]=await G(e,"strict:error",{signal:n});throw Cs(r,t)},"throwOnStrictError"),O0=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>Ka({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),"getEachMessage"),Ka=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{Zn({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:Is(e)}),Bs(t,s);const a=At(e,t,n),u=new AbortController,c={};return R0(e,a,u),M0({ipcEmitter:a,isSubprocess:n,controller:u,state:c}),_0({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:n,shouldAwait:i,controller:u,state:c,reference:s})},"loopOnMessages"),R0=o(async(e,t,n)=>{try{await G(t,"disconnect",{signal:n.signal}),n.abort()}catch{}},"stopOnDisconnect"),M0=o(async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{const[i]=await G(e,"strict:error",{signal:n.signal});r.error=Cs(i,t),n.abort()}catch{}},"abortOnStrictError"),_0=o(async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:a,reference:u}){try{for await(const[c]of Dt(n,"message",{signal:s.signal}))Za(a),yield c}catch{Za(a)}finally{s.abort(),Ts(t,u),r||Jn(e),i&&await e}},"iterateOnMessages"),Za=o(({error:e})=>{if(e)throw e},"throwIfStrictError"),P0=o((e,{ipc:t})=>{Object.assign(e,Ja(e,!1,t))},"addIpcMethods"),L0=o(()=>{const e=I,t=!0,n=I.channel!==void 0;return{...Ja(e,t,n),getCancelSignal:_h.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}},"getIpcExport"),Ja=o((e,t,n)=>({sendMessage:Rs.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:A0.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:O0.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),"getIpcMethods"),N0=o(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:a})=>{Ta(r);const u=new Bo;k0(u,r),Object.assign(u,{readable:U0,writable:j0,duplex:W0});const c=hr({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),d=G0(c,a,i);return{subprocess:u,promise:d}},"handleEarlyError"),k0=o((e,t)=>{const n=ot(),r=ot(),i=ot(),s=Array.from({length:t.length-3},ot),a=ot(),u=[n,r,i,...s];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:a,stdio:u})},"createDummyStreams"),ot=o(()=>{const e=new Wo;return e.end(),e},"createDummyStream"),U0=o(()=>new ge({read(){}}),"readable"),j0=o(()=>new dn({write(){}}),"writable"),W0=o(()=>new ln({read(){},write(){}}),"duplex"),G0=o(async(e,t,n)=>pr(e,t,n),"handleDummyPromise"),z0=o((e,t)=>Ba(V0,e,t,!1),"handleStdioAsync"),it=o(({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${Pt[e]}.`)},"forbiddenIfAsync"),Xa={fileNumber:it,generator:Wa,asyncGenerator:Wa,nodeStream:o(({value:e})=>({stream:e}),"nodeStream"),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){const r=t||n;return{stream:ln.fromWeb(e,{objectMode:r})}},duplex:o(({value:{transform:e}})=>({stream:e}),"duplex"),native(){}},V0={input:{...Xa,fileUrl:o(({value:e})=>({stream:jo(e)}),"fileUrl"),filePath:o(({value:{file:e}})=>({stream:jo(e)}),"filePath"),webStream:o(({value:e})=>({stream:ge.fromWeb(e)}),"webStream"),iterable:o(({value:e})=>({stream:ge.from(e)}),"iterable"),asyncIterable:o(({value:e})=>({stream:ge.from(e)}),"asyncIterable"),string:o(({value:e})=>({stream:ge.from(e)}),"string"),uint8Array:o(({value:e})=>({stream:ge.from(fn.from(e))}),"uint8Array")},output:{...Xa,fileUrl:o(({value:e})=>({stream:Uo(e)}),"fileUrl"),filePath:o(({value:{file:e,append:t}})=>({stream:Uo(e,t?{flags:"a"}:{})}),"filePath"),webStream:o(({value:e})=>({stream:dn.fromWeb(e)}),"webStream"),iterable:it,asyncIterable:it,string:it,uint8Array:it}};var Qa=o(e=>{throw TypeError(e)},"__typeError$1"),xa=o((e,t,n)=>t.has(e)||Qa("Cannot "+n),"__accessCheck$1"),V=o((e,t,n)=>(xa(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet$1"),ke=o((e,t,n)=>t.has(e)?Qa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd$1"),H0=o((e,t,n,r)=>(xa(e,t,"write to private field"),t.set(e,n),n),"__privateSet$1"),$e,Sr,vr,st,Nt,at;function Ar(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const i of e)Br(i);const t=e.some(({readableObjectMode:i})=>i),n=Y0(e,t),r=new $r({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of e)r.add(i);return r}o(Ar,"mergeStreams");const Y0=o((e,t)=>{if(e.length===0)return pt(t);const n=e.filter(({readableObjectMode:r})=>r===t).map(({readableHighWaterMark:r})=>r);return Math.max(...n)},"getHighWaterMark"),wo=class wo extends Wo{constructor(){super(...arguments),ke(this,$e,new Set([])),ke(this,Sr,new Set([])),ke(this,vr,new Set([])),ke(this,st),ke(this,Nt,Symbol("unpipe")),ke(this,at,new WeakMap)}add(t){if(Br(t),V(this,$e).has(t))return;V(this,$e).add(t),V(this,st)??H0(this,st,q0(this,V(this,$e),V(this,Nt)));const n=J0({passThroughStream:this,stream:t,streams:V(this,$e),ended:V(this,Sr),aborted:V(this,vr),onFinished:V(this,st),unpipeEvent:V(this,Nt)});V(this,at).set(t,n),t.pipe(this,{end:!1})}async remove(t){if(Br(t),!V(this,$e).has(t))return!1;const n=V(this,at).get(t);return n===void 0?!1:(V(this,at).delete(t),t.unpipe(this),await n,!0)}};o(wo,"MergedStream");let $r=wo;$e=new WeakMap,Sr=new WeakMap,vr=new WeakMap,st=new WeakMap,Nt=new WeakMap,at=new WeakMap;const q0=o(async(e,t,n)=>{kt(e,ru);const r=new AbortController;try{await Promise.race([K0(e,r),Z0(e,t,n,r)])}finally{r.abort(),kt(e,-ru)}},"onMergedStreamFinished"),K0=o(async(e,{signal:t})=>{try{await le(e,{signal:t,cleanup:!0})}catch(n){throw eu(e,n),n}},"onMergedStreamEnd"),Z0=o(async(e,t,n,{signal:r})=>{for await(const[i]of Dt(e,"unpipe",{signal:r}))t.has(i)&&i.emit(n)},"onInputStreamsUnpipe"),Br=o(e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},"validateStream"),J0=o(async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:a})=>{kt(e,ou);const u=new AbortController;try{await Promise.race([X0(s,t,u),Q0({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:u}),x0({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:a,controller:u})])}finally{u.abort(),kt(e,-ou)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Tr(e):e2(e))},"endWhenStreamsDone"),X0=o(async(e,t,{signal:n})=>{try{await e,n.aborted||Tr(t)}catch(r){n.aborted||eu(t,r)}},"afterMergedStreamFinished"),Q0=o(async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await le(t,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(a){if(s.aborted||!n.has(t))return;tu(a)?i.add(t):nu(e,a)}},"onInputStreamEnd"),x0=o(async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await G(e,i,{signal:s}),!e.readable)return G(s,"abort",{signal:s});t.delete(e),n.delete(e),r.delete(e)},"onInputStreamUnpipe"),e2=o(e=>{e.writable&&e.end()},"endStream"),eu=o((e,t)=>{tu(t)?Tr(e):nu(e,t)},"errorOrAbortStream"),tu=o(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isAbortError"),Tr=o(e=>{(e.readable||e.writable)&&e.destroy()},"abortStream"),nu=o((e,t)=>{e.destroyed||(e.once("error",t2),e.destroy(t))},"errorStream"),t2=o(()=>{},"noop"),kt=o((e,t)=>{const n=e.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&e.setMaxListeners(n+t)},"updateMaxListeners"),ru=2,ou=1,Ut=o((e,t)=>{e.pipe(t),n2(e,t),r2(e,t)},"pipeStreams"),n2=o(async(e,t)=>{if(!(Fe(e)||Fe(t))){try{await le(e,{cleanup:!0,readable:!0,writable:!1})}catch{}iu(t)}},"onSourceFinish"),iu=o(e=>{e.writable&&e.end()},"endDestinationStream"),r2=o(async(e,t)=>{if(!(Fe(e)||Fe(t))){try{await le(t,{cleanup:!0,readable:!1,writable:!0})}catch{}su(e)}},"onDestinationFinish"),su=o(e=>{e.readable&&e.destroy()},"abortSourceStream"),o2=o((e,t,n)=>{const r=new Map;for(const[i,{stdioItems:s,direction:a}]of Object.entries(t)){for(const{stream:u}of s.filter(({type:c})=>Ae.has(c)))i2(e,u,a,i);for(const{stream:u}of s.filter(({type:c})=>!Ae.has(c)))a2({subprocess:e,stream:u,direction:a,fdNumber:i,pipeGroups:r,controller:n})}for(const[i,s]of r.entries()){const a=s.length===1?s[0]:Ar(s);Ut(a,i)}},"pipeOutputAsync"),i2=o((e,t,n,r)=>{n==="output"?Ut(e.stdio[r],t):Ut(t,e.stdio[r]);const i=s2[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},"pipeTransform"),s2=["stdin","stdout","stderr"],a2=o(({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(t===void 0)return;u2(t,s);const[a,u]=n==="output"?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(a)??[];i.set(a,[...c,u])},"pipeStdioItem"),u2=o((e,{signal:t})=>{Fe(e)&&St(e,c2,t)},"setStandardStreamMaxListeners"),c2=2,Ue=[];Ue.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&Ue.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&Ue.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var l2=Object.defineProperty,au=o(e=>{throw TypeError(e)},"__typeError"),d2=o((e,t,n)=>t in e?l2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$1"),jt=o((e,t,n)=>d2(e,typeof t!="symbol"?t+"":t,n),"__publicField$1"),Ir=o((e,t,n)=>t.has(e)||au("Cannot "+n),"__accessCheck"),B=o((e,t,n)=>(Ir(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet"),De=o((e,t,n)=>t.has(e)?au("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd"),je=o((e,t,n,r)=>(Ir(e,t,"write to private field"),t.set(e,n),n),"__privateSet"),uu=o((e,t,n)=>(Ir(e,t,"access private method"),n),"__privateMethod"),Or,Z,L,ut,ct,We,Be,Wt,cu,lu;const Gt=o(e=>!!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","processOk"),Rr=Symbol.for("signal-exit emitter"),Mr=globalThis,f2=Object.defineProperty.bind(Object),yo=class yo{constructor(){if(jt(this,"emitted",{afterExit:!1,exit:!1}),jt(this,"listeners",{afterExit:[],exit:[]}),jt(this,"count",0),jt(this,"id",Math.random()),Mr[Rr])return Mr[Rr];f2(Mr,Rr,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,n){this.listeners[t].push(n)}removeListener(t,n){const r=this.listeners[t],i=r.indexOf(n);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(t,n,r){if(this.emitted[t])return!1;this.emitted[t]=!0;let i=!1;for(const s of this.listeners[t])i=s(n,r)===!0||i;return t==="exit"&&(i=this.emit("afterExit",n,r)||i),i}};o(yo,"Emitter");let _r=yo;const Eo=class Eo{};o(Eo,"SignalExitBase");let zt=Eo;const h2=o(e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),"signalExitWrap"),bo=class bo extends zt{onExit(){return()=>{}}load(){}unload(){}};o(bo,"SignalExitFallback");let Pr=bo;const Co=class Co extends zt{constructor(t){super(),De(this,Wt),De(this,Or,Nr.platform==="win32"?"SIGINT":"SIGHUP"),De(this,Z,new _r),De(this,L),De(this,ut),De(this,ct),De(this,We,{}),De(this,Be,!1),je(this,L,t),je(this,We,{});for(const n of Ue)B(this,We)[n]=()=>{const r=B(this,L).listeners(n);let{count:i}=B(this,Z);const s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();const a=B(this,Z).emit("exit",null,n),u=n==="SIGHUP"?B(this,Or):n;a||t.kill(t.pid,u)}};je(this,ct,t.reallyExit),je(this,ut,t.emit)}onExit(t,n){if(!Gt(B(this,L)))return()=>{};B(this,Be)===!1&&this.load();const r=n?.alwaysLast?"afterExit":"exit";return B(this,Z).on(r,t),()=>{B(this,Z).removeListener(r,t),B(this,Z).listeners.exit.length===0&&B(this,Z).listeners.afterExit.length===0&&this.unload()}}load(){if(!B(this,Be)){je(this,Be,!0),B(this,Z).count+=1;for(const t of Ue)try{const n=B(this,We)[t];n&&B(this,L).on(t,n)}catch{}B(this,L).emit=(t,...n)=>uu(this,Wt,lu).call(this,t,...n),B(this,L).reallyExit=t=>uu(this,Wt,cu).call(this,t)}}unload(){B(this,Be)&&(je(this,Be,!1),Ue.forEach(t=>{const n=B(this,We)[t];if(!n)throw new Error("Listener not defined for signal: "+t);try{B(this,L).removeListener(t,n)}catch{}}),B(this,L).emit=B(this,ut),B(this,L).reallyExit=B(this,ct),B(this,Z).count-=1)}};o(Co,"SignalExit");let Lr=Co;Or=new WeakMap,Z=new WeakMap,L=new WeakMap,ut=new WeakMap,ct=new WeakMap,We=new WeakMap,Be=new WeakMap,Wt=new WeakSet,cu=o(function(e){return Gt(B(this,L))?(B(this,L).exitCode=e||0,B(this,Z).emit("exit",B(this,L).exitCode,null),B(this,ct).call(B(this,L),B(this,L).exitCode)):0},"processReallyExit_fn"),lu=o(function(e,...t){const n=B(this,ut);if(e==="exit"&&Gt(B(this,L))){typeof t[0]=="number"&&(B(this,L).exitCode=t[0]);const r=n.call(B(this,L),e,...t);return B(this,Z).emit("exit",B(this,L).exitCode,null),r}else return n.call(B(this,L),e,...t)},"processEmit_fn");const Nr=globalThis.process,{onExit:D2}=h2(Gt(Nr)?new Lr(Nr):new Pr),p2=o((e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;const i=D2(()=>{e.kill()});ko(r,()=>{i()})},"cleanupOnExit"),m2=o(({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{const s=Ki(),{destination:a,destinationStream:u,destinationError:c,from:d,unpipeSignal:l}=g2(n,r,i),{sourceStream:f,sourceError:h}=w2(e,d),{options:p,fileDescriptors:D}=Ee.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:p,sourceError:h,destination:a,destinationStream:u,destinationError:c,unpipeSignal:l,fileDescriptors:D,startTime:s}},"normalizePipeArguments"),g2=o((e,t,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:a}={}}=F2(e,t,...n),u=Ss(r,s);return{destination:r,destinationStream:u,from:i,unpipeSignal:a}}catch(r){return{destinationError:r}}},"getDestinationStream"),F2=o((e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(du,e)(n,...r),pipeOptions:e};if(typeof n=="string"||n instanceof URL||Bi(n)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[i,s,a]=Ii(n,...r);return{destination:t(du)(i,s,a),pipeOptions:a}}if(Ee.has(n)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},"getDestination"),du=o(({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),"mapDestinationArguments"),w2=o((e,t)=>{try{return{sourceStream:Xn(e,t)}}catch(n){return{sourceError:n}}},"getSourceStream"),y2=o(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:a})=>{const u=E2({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(u!==void 0)throw fu({error:u,fileDescriptors:i,sourceOptions:s,startTime:a})},"handlePipeArgumentsError"),E2=o(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return su(e),r;if(t!==void 0)return iu(n),t},"getPipeArgumentsError"),fu=o(({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>hr({error:e,command:hu,escapedCommand:hu,fileDescriptors:t,options:n,startTime:r,isSync:!1}),"createNonCommandError"),hu="source.pipe(destination)",b2=o(async e=>{const[{status:t,reason:n,value:r=n},{status:i,reason:s,value:a=s}]=await e;if(a.pipedFrom.includes(r)||a.pipedFrom.push(r),i==="rejected")throw a;if(t==="rejected")throw r;return a},"waitForBothSubprocesses"),C2=o((e,t,n)=>{const r=Vt.has(t)?v2(e,t):S2(e,t);return St(e,$2,n.signal),St(t,B2,n.signal),A2(t),r},"pipeSubprocessStream"),S2=o((e,t)=>{const n=Ar([e]);return Ut(n,t),Vt.set(t,n),n},"pipeFirstSubprocessStream"),v2=o((e,t)=>{const n=Vt.get(t);return n.add(e),n},"pipeMoreSubprocessStream"),A2=o(async e=>{try{await le(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Vt.delete(e)},"cleanupMergedStreamsMap"),Vt=new WeakMap,$2=2,B2=1,T2=o((e,t)=>e===void 0?[]:[I2(e,t)],"unpipeOnAbort"),I2=o(async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await _c(e,t),await n.remove(t);const a=new Error("Pipe canceled by `unpipeSignal` option.");throw fu({error:a,fileDescriptors:r,sourceOptions:i,startTime:s})},"unpipeOnSignalAbort"),kr=o((e,...t)=>{if(K(t[0]))return kr.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});const{destination:n,...r}=m2(e,...t),i=O2({...r,destination:n});return i.pipe=kr.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},"pipeToSubprocess"),O2=o(async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:a,unpipeSignal:u,fileDescriptors:c,startTime:d})=>{const l=R2(e,i);y2({sourceStream:t,sourceError:r,destinationStream:s,destinationError:a,fileDescriptors:c,sourceOptions:n,startTime:d});const f=new AbortController;try{const h=C2(t,s,f);return await Promise.race([b2(l),...T2(u,{sourceStream:t,mergedStream:h,sourceOptions:n,fileDescriptors:c,startTime:d})])}finally{f.abort()}},"handlePipePromise"),R2=o((e,t)=>Promise.allSettled([e,t]),"getSubprocessPromises"),Du=o(({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const a=new AbortController;return M2(t,a),mu({stream:e,controller:a,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},"iterateOnSubprocessStream"),M2=o(async(e,t)=>{try{await e}catch{}finally{t.abort()}},"stopReadingOnExit"),pu=o(({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const a=new AbortController;_2(t,a,e);const u=e.readableObjectMode&&!s;return mu({stream:e,controller:a,binary:r==="buffer",shouldEncode:!u,encoding:r,shouldSplit:!u&&n,preserveNewlines:!i})},"iterateForResult"),_2=o(async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},"stopReadingOnStreamEnd"),mu=o(({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})=>{const u=Dt(e,"data",{signal:t.signal,highWaterMark:Fu,highWatermark:Fu});return P2({onStdoutChunk:u,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})},"iterateOnStream"),gu=pt(!0),Fu=gu,P2=o(async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a}){const u=L2({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a});try{for await(const[c]of e)yield*rt(c,u,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*Cr(u)}},"iterateOnData"),L2=o(({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[ka(e,n,!t),Ma(e,i,!r,{})].filter(Boolean),"getGenerators"),N2=o(async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:s,lines:a,allMixed:u,stripFinalNewline:c,verboseInfo:d,streamInfo:l})=>{const f=k2({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:u,verboseInfo:d,streamInfo:l});if(!i){await Promise.all([U2(e),f]);return}const h=Ra(c,n),p=pu({stream:e,onStreamEnd:t,lines:a,encoding:r,stripFinalNewline:h,allMixed:u}),[D]=await Promise.all([j2({stream:e,iterable:p,fdNumber:n,encoding:r,maxBuffer:s,lines:a}),f]);return D},"getStreamOutput"),k2=o(async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!Va({stdioItems:a[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const u=pu({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await n0(u,e,n,s)},"logOutputAsync"),U2=o(async e=>{await Uc(),e.readableFlowing===null&&e.resume()},"resumeStream"),j2=o(async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:a})=>{try{return t||a?await yD(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await vD(n,{maxBuffer:s})):await PD(n,{maxBuffer:s})}catch(u){return yu(WD({error:u,stream:e,readableObjectMode:t,lines:a,encoding:i,fdNumber:r}))}},"getStreamContents"),wu=o(async e=>{try{return await e}catch(t){return yu(t)}},"getBufferedData"),yu=o(({bufferedData:e})=>Ql(e)?new Uint8Array(e):e,"handleBufferedData"),Ur=o(async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=W2(e,n),a=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],le(e,{cleanup:!0,signal:a.signal})])}catch(u){s.stdinCleanedUp||V2(u,t,n,r)}finally{a.abort()}},"waitForStream"),W2=o((e,{originalStreams:[t],subprocess:n})=>{const r={stdinCleanedUp:!1};return e===t&&G2(e,n,r),r},"handleStdinDestroy"),G2=o((e,t,n)=>{const{_destroy:r}=e;e._destroy=(...i)=>{z2(t,n),r.call(e,...i)}},"spyOnStdinDestroy"),z2=o(({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},"setStdinCleanedUp"),V2=o((e,t,n,r)=>{if(!H2(e,t,n,r))throw e},"handleStreamError"),H2=o((e,t,n,r=!0)=>n.propagating?bu(e)||jr(e):(n.propagating=!0,Eu(n,t)===r?bu(e):jr(e)),"shouldIgnoreStreamError"),Eu=o(({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input","isInputFileDescriptor"),jr=o(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isStreamAbort"),bu=o(e=>e?.code==="EPIPE","isStreamEpipe"),Y2=o(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:u})=>e.stdio.map((c,d)=>Cu({stream:c,fdNumber:d,encoding:t,buffer:n[d],maxBuffer:r[d],lines:i[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:u})),"waitForStdioStreams"),Cu=o(async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:d})=>{if(!e)return;const l=Ur(e,t,d);if(Eu(d,t)){await l;return}const[f]=await Promise.all([N2({stream:e,onStreamEnd:l,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:d}),l]);return f},"waitForSubprocessStream"),q2=o(({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Ar([e,t].filter(Boolean)):void 0,"makeAllStream"),K2=o(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:u})=>Cu({...Z2(e,n),fdNumber:"all",encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:J2(e),stripFinalNewline:s,verboseInfo:a,streamInfo:u}),"waitForAllStream"),Z2=o(({stdout:e,stderr:t,all:n},[,r,i])=>{const s=r||i;return s?r?i?{stream:n,buffer:s}:{stream:e,buffer:s}:{stream:t,buffer:s}:{stream:n,buffer:s}},"getAllStream"),J2=o(({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,"getAllMixed"),X2=o(e=>Tn(e,"ipc"),"shouldLogIpc"),Q2=o((e,t)=>{const n=qi(e);Je({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:t})},"logIpcOutput"),x2=o(async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const a=X2(s),u=Ze(t,"ipc"),c=Ze(n,"ipc");for await(const d of Ka({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))u&&(zD(e,i,c),i.push(d)),a&&Q2(d,s);return i},"waitForIpcOutput"),eg=o(async(e,t)=>(await Promise.allSettled([e]),t),"getBufferedIpcOutput"),tg=o(async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:s,cancelSignal:a,gracefulCancel:u,forceKillAfterDelay:c,stripFinalNewline:d,ipc:l,ipcInput:f},context:h,verboseInfo:p,fileDescriptors:D,originalStreams:m,onInternalError:F,controller:g})=>{const w=f0(e,h),E={originalStreams:m,fileDescriptors:D,subprocess:e,exitPromise:w,propagating:!1},y=Y2({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:d,verboseInfo:p,streamInfo:E}),b=K2({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:d,verboseInfo:p,streamInfo:E}),v=[],S=x2({subprocess:e,buffer:n,maxBuffer:r,ipc:l,ipcOutput:v,verboseInfo:p}),A=ng(m,e,E),_=rg(D,E);try{return await Promise.race([Promise.all([{},D0(w),Promise.all(y),b,S,Jh(e,f),...A,..._]),F,og(e,g),...Gh(e,s,h,g),...Xf({subprocess:e,cancelSignal:a,gracefulCancel:u,context:h,controller:g}),...kh({subprocess:e,cancelSignal:a,gracefulCancel:u,forceKillAfterDelay:c,context:h,controller:g})])}catch(J){return h.terminationReason??(h.terminationReason="other"),Promise.all([{error:J},w,Promise.all(y.map(H=>wu(H))),wu(b),eg(S,v),Promise.allSettled(A),Promise.allSettled(_)])}},"waitForSubprocessResult"),ng=o((e,t,n)=>e.map((r,i)=>r===t.stdio[i]?void 0:Ur(r,i,n)),"waitForOriginalStreams"),rg=o((e,t)=>e.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>Ce(s,{checkOpen:!1})&&!Fe(s)).map(({type:i,value:s,stream:a=s})=>Ur(a,r,t,{isSameDirection:Ae.has(i),stopOnExit:i==="native"}))),"waitForCustomStreamsEnd"),og=o(async(e,{signal:t})=>{const[n]=await G(e,"error",{signal:t});throw n},"throwOnSubprocessError"),ig=o(()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),"initializeConcurrentStreams"),Wr=o((e,t,n)=>{const r=e[n];r.has(t)||r.set(t,[]);const i=r.get(t),s=xe();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},"addConcurrentStream"),Ht=o(async({resolve:e,promises:t},n)=>{e();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},"waitForConcurrentStreams"),Su=o(async e=>{if(e!==void 0)try{await vu(e)}catch{}},"safeWaitForSubprocessStdin"),sg=o(async e=>{if(e!==void 0)try{await Au(e)}catch{}},"safeWaitForSubprocessStdout"),vu=o(async e=>{await le(e,{cleanup:!0,readable:!1,writable:!0})},"waitForSubprocessStdin"),Au=o(async e=>{await le(e,{cleanup:!0,readable:!0,writable:!1})},"waitForSubprocessStdout"),$u=o(async(e,t)=>{if(await e,t)throw t},"waitForSubprocess"),Bu=o((e,t,n)=>{n&&!jr(n)?e.destroy(n):t&&e.destroy()},"destroyOtherStream"),ag=o(({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||be.has(n),{subprocessStdout:u,waitReadableDestroy:c}=Tu(e,r,t),{readableEncoding:d,readableObjectMode:l,readableHighWaterMark:f}=Iu(u,a),{read:h,onStdoutDataDone:p}=Ou({subprocessStdout:u,subprocess:e,binary:a,encoding:n,preserveNewlines:s}),D=new ge({read:h,destroy:Re(Mu.bind(void 0,{subprocessStdout:u,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:l,encoding:d});return Ru({subprocessStdout:u,onStdoutDataDone:p,readable:D,subprocess:e}),D},"createReadable"),Tu=o((e,t,n)=>{const r=Xn(e,t),i=Wr(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},"getSubprocessStdout"),Iu=o(({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:gu},"getReadableOptions"),Ou=o(({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{const s=xe(),a=Du({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){ug(this,a,s)},onStdoutDataDone:s}},"getReadableMethods"),ug=o(async(e,t,n)=>{try{const{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},"onRead"),Ru=o(async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Au(e),await r,await Su(i),await t,n.readable&&n.push(null)}catch(s){await Su(i),_u(n,s)}},"onStdoutFinished"),Mu=o(async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Ht(n,t)&&(_u(e,r),await $u(t,r))},"onReadableDestroy"),_u=o((e,t)=>{Bu(e,e.readable,t)},"destroyOtherReadable"),cg=o(({subprocess:e,concurrentStreams:t},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=Pu(e,n,t),a=new dn({...Lu(r,e,i),destroy:Re(ku.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Nu(r,a),a},"createWritable"),Pu=o((e,t,n)=>{const r=Ss(e,t),i=Wr(n,r,"writableFinal"),s=Wr(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},"getSubprocessStdin"),Lu=o((e,t,n)=>({write:lg.bind(void 0,e),final:Re(dg.bind(void 0,e,t,n))}),"getWritableMethods"),lg=o((e,t,n,r)=>{e.write(t,n)?r():e.once("drain",r)},"onWrite"),dg=o(async(e,t,n)=>{await Ht(n,t)&&(e.writable&&e.end(),await t)},"onWritableFinal"),Nu=o(async(e,t,n)=>{try{await vu(e),t.writable&&t.end()}catch(r){await sg(n),Uu(t,r)}},"onStdinFinished"),ku=o(async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Ht(n,t),await Ht(r,t)&&(Uu(e,i),await $u(t,i))},"onWritableDestroy"),Uu=o((e,t)=>{Bu(e,e.writable,t)},"destroyOtherWritable"),fg=o(({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:a=!0}={})=>{const u=s||be.has(n),{subprocessStdout:c,waitReadableDestroy:d}=Tu(e,r,t),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:h}=Pu(e,i,t),{readableEncoding:p,readableObjectMode:D,readableHighWaterMark:m}=Iu(c,u),{read:F,onStdoutDataDone:g}=Ou({subprocessStdout:c,subprocess:e,binary:u,encoding:n,preserveNewlines:a}),w=new ln({read:F,...Lu(l,e,f),destroy:Re(hg.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:e,waitReadableDestroy:d,waitWritableFinal:f,waitWritableDestroy:h})),readableHighWaterMark:m,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:D,writableObjectMode:l.writableObjectMode,encoding:p});return Ru({subprocessStdout:c,onStdoutDataDone:g,readable:w,subprocess:e,subprocessStdin:l}),Nu(l,w,c),w},"createDuplex"),hg=o(async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},a)=>{await Promise.all([Mu({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},a),ku({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},a)])},"onDuplexDestroy"),ju=o((e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||be.has(t),a=Xn(e,n),u=Du({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:i});return Dg(u,a,e)},"createIterable"),Dg=o(async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},"iterateOnStdoutData"),pg=o((e,{encoding:t})=>{const n=ig();e.readable=ag.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=cg.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=fg.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=ju.bind(void 0,e,t),e[Symbol.asyncIterator]=ju.bind(void 0,e,t,{})},"addConvertedStreams"),mg=o((e,t)=>{for(const[n,r]of Fg){const i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},"mergePromise"),gg=(async()=>{})().constructor.prototype,Fg=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(gg,e)]),wg=o((e,t,n,r)=>{const{file:i,commandArguments:s,command:a,escapedCommand:u,startTime:c,verboseInfo:d,options:l,fileDescriptors:f}=yg(e,t,n),{subprocess:h,promise:p}=bg({file:i,commandArguments:s,options:l,startTime:c,verboseInfo:d,command:a,escapedCommand:u,fileDescriptors:f});return h.pipe=kr.bind(void 0,{source:h,sourcePromise:p,boundOptions:{},createNested:r}),mg(h,p),Ee.set(h,{options:l,fileDescriptors:f}),h},"execaCoreAsync"),yg=o((e,t,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=Ji(e,t,n),{file:u,commandArguments:c,options:d}=Us(e,t,n),l=Eg(d),f=z0(l,a);return{file:u,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:f}},"handleAsyncArguments"),Eg=o(({timeout:e,signal:t,...n})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:e}},"handleAsyncOptions"),bg=o(({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:a,fileDescriptors:u})=>{let c;try{c=Oc(...js(e,t,n))}catch(D){return N0({error:D,command:s,escapedCommand:a,fileDescriptors:u,options:n,startTime:r,verboseInfo:i})}const d=new AbortController;Wc(Number.POSITIVE_INFINITY,d.signal);const l=[...c.stdio];o2(c,u,d),p2(c,n,d);const f={},h=xe();c.kill=Yf.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:h,context:f,controller:d}),c.all=q2(c,n),pg(c,n),P0(c,n);const p=Cg({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:u,originalStreams:l,command:s,escapedCommand:a,context:f,onInternalError:h,controller:d});return{subprocess:c,promise:p}},"spawnSubprocessAsync"),Cg=o(async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:s,command:a,escapedCommand:u,context:c,onInternalError:d,controller:l})=>{const[f,[h,p],D,m,F]=await tg({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:d,controller:l});l.abort(),d.resolve();const g=D.map((y,b)=>Ne(y,t,b)),w=Ne(m,t,"all"),E=Sg({errorInfo:f,exitCode:h,signal:p,stdio:g,all:w,ipcOutput:F,context:c,options:t,command:a,escapedCommand:u,startTime:n});return pr(E,r,t)},"handlePromise"),Sg=o(({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:s,context:a,options:u,command:c,escapedCommand:d,startTime:l})=>"error"in e?Dr({error:e.error,command:c,escapedCommand:d,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof _e,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:s,options:u,startTime:l,isSync:!1}):ca({command:c,escapedCommand:d,stdio:r,all:i,ipcOutput:s,options:u,startTime:l}),"getAsyncResult"),Gr=o((e,t)=>{const n=Object.fromEntries(Object.entries(t).map(([r,i])=>[r,vg(r,e[r],i)]));return{...e,...n}},"mergeOptions"),vg=o((e,t,n)=>Ag.has(e)&&K(t)&&K(n)?{...t,...n}:n,"mergeOption"),Ag=new Set(["env",...Gi]),Te=o((e,t,n,r)=>{const i=o((a,u,c)=>Te(a,u,n,c),"createNested"),s=o((...a)=>$g({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a),"boundExeca");return r!==void 0&&r(s,i,t),s},"createExeca"),$g=o(({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...a)=>{if(K(s))return i(e,Gr(n,s),r);const{file:u,commandArguments:c,options:d,isSync:l}=Bg({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:n});return l?F0(u,c,d):wg(u,c,d,i)},"callBoundExeca"),Bg=o(({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=id(t)?sd(t,n):[t,...n],[a,u,c]=Ii(...s),d=Gr(Gr(r,i),c),{file:l=a,commandArguments:f=u,options:h=d,isSync:p=!1}=e({file:a,commandArguments:u,options:d});return{file:l,commandArguments:f,options:h,isSync:p}},"parseArguments"),Tg=o(({file:e,commandArguments:t})=>Wu(e,t),"mapCommandAsync"),Ig=o(({file:e,commandArguments:t})=>({...Wu(e,t),isSync:!0}),"mapCommandSync"),Wu=o((e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);const[n,...r]=Og(e);return{file:n,commandArguments:r}},"parseCommand"),Og=o(e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);const t=e.trim();if(t==="")return[];const n=[];for(const r of t.split(Rg)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},"parseCommandString"),Rg=/ +/g,Mg=o((e,t,n)=>{e.sync=t(Pg,n),e.s=e.sync},"setScriptSync"),_g=o(({options:e})=>Gu(e),"mapScriptAsync"),Pg=o(({options:e})=>({...Gu(e),isSync:!0}),"mapScriptSync"),Gu=o(e=>({options:{...Lg(e),...e}}),"getScriptOptions"),Lg=o(({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},"getScriptStdinOption"),Ng={preferLocal:!0},Ge=Te(()=>({}));Te(()=>({isSync:!0})),Te(Tg),Te(Ig),Te(Vh),Te(_g,{},Ng,Mg),L0();let Ie=!0;const ze=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let lt=0;if(ze.process&&ze.process.env&&ze.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:n,TERM:r,COLORTERM:i}=ze.process.env;t||n||e==="0"?Ie=!1:e==="1"||e==="2"||e==="3"?Ie=!0:r==="dumb"?Ie=!1:"CI"in ze.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in ze.process.env)?Ie=!0:Ie=process.stdout.isTTY,Ie&&(process.platform==="win32"||i&&(i==="truecolor"||i==="24bit")?lt=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?lt=2:lt=1)}let zu={enabled:Ie,supportLevel:lt};function dt(e,t,n=1){const r=`\x1B[${e}m`,i=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return a=>zu.enabled&&zu.supportLevel>=n?r+(""+a).replace(s,r)+i:""+a}o(dt,"kolorist");const zr=dt(2,22),Vu=dt(30,39),Yt=dt(31,39),ft=dt(32,39),Hu=dt(46,49),kg=o(e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,"isAmbiguous"),Ug=o(e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,"isFullWidth"),jg=o(e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,"isWide"),Vr=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,qt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Kt=/\t{1,1000}/y,Hr=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),Zt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Wg=new RegExp("\\p{M}+","gu"),Gg={limit:1/0,ellipsis:""},Yu=o((e,t={},n={})=>{const r=t.limit??1/0,i=t.ellipsis??"",s=t?.ellipsisWidth??(i?Yu(i,Gg,n).width:0),a=n.ansiWidth??0,u=n.controlWidth??0,c=n.tabWidth??8,d=n.ambiguousWidth??1,l=n.emojiWidth??2,f=n.fullWidthWidth??2,h=n.regularWidth??1,p=n.wideWidth??2;let D=0,m=0,F=e.length,g=0,w=!1,E=F,y=Math.max(0,r-s),b=0,v=0,S=0,A=0;e:for(;;){if(v>b||m>=F&&m>D){const _=e.slice(b,v)||e.slice(D,m);g=0;for(const J of _.replaceAll(Wg,"")){const H=J.codePointAt(0)||0;if(Ug(H)?A=f:jg(H)?A=p:d!==h&&kg(H)?A=d:A=h,S+A>y&&(E=Math.min(E,Math.max(b,D)+g)),S+A>r){w=!0;break e}g+=J.length,S+=A}b=v=0}if(m>=F)break;if(Zt.lastIndex=m,Zt.test(e)){if(g=Zt.lastIndex-m,A=g*h,S+A>y&&(E=Math.min(E,m+Math.floor((y-S)/h))),S+A>r){w=!0;break}S+=A,b=D,v=m,m=D=Zt.lastIndex;continue}if(Vr.lastIndex=m,Vr.test(e)){if(S+a>y&&(E=Math.min(E,m)),S+a>r){w=!0;break}S+=a,b=D,v=m,m=D=Vr.lastIndex;continue}if(qt.lastIndex=m,qt.test(e)){if(g=qt.lastIndex-m,A=g*u,S+A>y&&(E=Math.min(E,m+Math.floor((y-S)/u))),S+A>r){w=!0;break}S+=A,b=D,v=m,m=D=qt.lastIndex;continue}if(Kt.lastIndex=m,Kt.test(e)){if(g=Kt.lastIndex-m,A=g*c,S+A>y&&(E=Math.min(E,m+Math.floor((y-S)/c))),S+A>r){w=!0;break}S+=A,b=D,v=m,m=D=Kt.lastIndex;continue}if(Hr.lastIndex=m,Hr.test(e)){if(S+l>y&&(E=Math.min(E,m)),S+l>r){w=!0;break}S+=l,b=D,v=m,m=D=Hr.lastIndex;continue}m+=1}return{width:w?y:S,index:w?E:F,truncated:w,ellipsed:w&&r>=s}},"getStringTruncatedWidth"),zg={limit:1/0,ellipsis:"",ellipsisWidth:0},pe=o((e,t={})=>Yu(e,zg,t).width,"fastStringWidth"),Jt="\x1B",qu="\x9B",Vg=39,Yr="\x07",Ku="[",Hg="]",Zu="m",qr=`${Hg}8;;`,Ju=new RegExp(`(?:\\${Ku}(?<code>\\d+)m|\\${qr}(?<uri>.*)${Yr})`,"y"),Xu=o(e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},"getClosingCode"),Qu=o(e=>`${Jt}${Ku}${e}${Zu}`,"wrapAnsiCode"),xu=o(e=>`${Jt}${qr}${e}${Yr}`,"wrapAnsiHyperlink"),Kr=o((e,t,n)=>{const r=t[Symbol.iterator]();let i=!1,s=!1,a=e.at(-1),u=a===void 0?0:pe(a),c=r.next(),d=r.next(),l=0;for(;!c.done;){const f=c.value,h=pe(f);u+h<=n?e[e.length-1]+=f:(e.push(f),u=0),(f===Jt||f===qu)&&(i=!0,s=t.startsWith(qr,l+1)),i?s?f===Yr&&(i=!1,s=!1):f===Zu&&(i=!1):(u+=h,u===n&&!d.done&&(e.push(""),u=0)),c=d,d=r.next(),l+=f.length}a=e.at(-1),!u&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},"wrapWord"),Yg=o(e=>{const t=e.split(" ");let n=t.length;for(;n&&!pe(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},"stringVisibleTrimSpacesRight"),qg=o((e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",i,s;const a=e.split(" ");let u=[""],c=0;for(let f=0;f<a.length;f++){const h=a[f];if(n.trim!==!1){const D=u.at(-1)??"",m=D.trimStart();D.length!==m.length&&(u[u.length-1]=m,c=pe(m))}f!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(u.push(""),c=0),(c||n.trim===!1)&&(u[u.length-1]+=" ",c++));const p=pe(h);if(n.hard&&p>t){const D=t-c,m=1+Math.floor((p-D-1)/t);Math.floor((p-1)/t)<m&&u.push(""),Kr(u,h,t),c=pe(u.at(-1)??"");continue}if(c+p>t&&c&&p){if(n.wordWrap===!1&&c<t){Kr(u,h,t),c=pe(u.at(-1)??"");continue}u.push(""),c=0}if(c+p>t&&n.wordWrap===!1){Kr(u,h,t),c=pe(u.at(-1)??"");continue}u[u.length-1]+=h,c+=p}n.trim!==!1&&(u=u.map(f=>Yg(f)));const d=u.join(`
|
|
65
|
+
`);let l=!1;for(let f=0;f<d.length;f++){const h=d[f];if(r+=h,!l)l=h>="\uD800"&&h<="\uDBFF";else continue;if(h===Jt||h===qu){Ju.lastIndex=f+1;const D=Ju.exec(d)?.groups;if(D?.code!==void 0){const m=Number.parseFloat(D.code);i=m===Vg?void 0:m}else D?.uri!==void 0&&(s=D.uri.length===0?void 0:D.uri)}if(d[f+1]===`
|
|
66
|
+
`){s&&(r+=xu(""));const p=i?Xu(i):void 0;i&&p&&(r+=Qu(p))}else h===`
|
|
67
67
|
`&&(i&&Xu(i)&&(r+=Qu(i)),s&&(r+=xu(s)))}return r},"exec"),Kg=/\r?\n/;function Ve(e,t,n){return String(e).normalize().split(Kg).map(r=>qg(r,t,n)).join(`
|
|
68
68
|
`)}o(Ve,"wrapAnsi");var Zr,ec;function Zg(){if(ec)return Zr;ec=1;const e="\x1B",t=`${e}[`,n="\x07",r={to(a,u){return u?`${t}${u+1};${a+1}H`:`${t}${a+1}G`},move(a,u){let c="";return a<0?c+=`${t}${-a}D`:a>0&&(c+=`${t}${a}C`),u<0?c+=`${t}${-u}A`:u>0&&(c+=`${t}${u}B`),c},up:o((a=1)=>`${t}${a}A`,"up"),down:o((a=1)=>`${t}${a}B`,"down"),forward:o((a=1)=>`${t}${a}C`,"forward"),backward:o((a=1)=>`${t}${a}D`,"backward"),nextLine:o((a=1)=>`${t}E`.repeat(a),"nextLine"),prevLine:o((a=1)=>`${t}F`.repeat(a),"prevLine"),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${e}7`,restore:`${e}8`},i={up:o((a=1)=>`${t}S`.repeat(a),"up"),down:o((a=1)=>`${t}T`.repeat(a),"down")},s={screen:`${t}2J`,up:o((a=1)=>`${t}1J`.repeat(a),"up"),down:o((a=1)=>`${t}J`.repeat(a),"down"),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(a){let u="";for(let c=0;c<a;c++)u+=this.line+(c<a-1?r.up():"");return a&&(u+=r.left),u}};return Zr={cursor:r,scroll:i,erase:s,beep:n},Zr}o(Zg,"requireSrc");var U=Zg(),Jg=Object.defineProperty,Xg=o((e,t,n)=>t in e?Jg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp"),j=o((e,t,n)=>Xg(e,typeof t!="symbol"?t+"":t,n),"__publicField");function Xt(e,t,n){if(!n.some(a=>!a.disabled))return e;const r=e+t,i=Math.max(n.length-1,0),s=r<0?i:r>i?0:r;return n[s].disabled?Xt(s,t<0?-1:1,n):s}o(Xt,"d$1");const Qg=["up","down","left","right","space","enter","cancel"],ae={actions:new Set(Qg),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function Jr(e,t){if(typeof e=="string")return ae.aliases.get(e)===t;for(const n of e)if(n!==void 0&&Jr(n,t))return!0;return!1}o(Jr,"V$1");function xg(e,t){if(e===t)return;const n=e.split(`
|
|
69
69
|
`),r=t.split(`
|
|
@@ -74,8 +74,8 @@ Instead, \`yield\` should either be called with a value, or not be called at all
|
|
|
74
74
|
`).length-1;this.output.write(U.cursor.move(-999,t*-1))}render(){const t=Ve(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(U.cursor.hide);else{const n=xg(this._prevFrame,t),r=nc(this.output);if(this.restoreCursor(),n){const i=Math.max(0,n.numLinesAfter-r),s=Math.max(0,n.numLinesBefore-r);let a=n.lines.find(u=>u>=i);if(a===void 0){this._prevFrame=t;return}if(n.lines.length===1){this.output.write(U.cursor.move(0,a-s)),this.output.write(U.erase.lines(1));const u=t.split(`
|
|
75
75
|
`);this.output.write(u[a]),this._prevFrame=t,this.output.write(U.cursor.move(0,u.length-a-1));return}else if(n.lines.length>1){if(i<s)a=i;else{const c=a-s;c>0&&this.output.write(U.cursor.move(0,c))}this.output.write(U.erase.down());const u=t.split(`
|
|
76
76
|
`).slice(a);this.output.write(u.join(`
|
|
77
|
-
`)),this._prevFrame=t;return}}this.output.write(U.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}},o(Ye,"p"),Ye);const So=class So extends rc{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",n=>{this.output.write(U.cursor.move(0,-1)),this.value=n,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};o(So,"Q");let xr=So;const vo=class vo extends rc{constructor(t){super(t,!1),j(this,"options"),j(this,"cursor",0),this.options=t.options;const n=this.options.findIndex(({value:i})=>i===t.initialValue),r=n===-1?0:n;this.cursor=this.options[r].disabled?Xt(r,1,this.options):r,this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=Xt(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Xt(this.cursor,1,this.options);break}this.changeValue()})}get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}};o(vo,"nt");let eo=vo;function n1(){return I.platform!=="win32"?I.env.TERM!=="linux":!!I.env.CI||!!I.env.WT_SESSION||!!I.env.TERMINUS_SUBLIME||I.env.ConEmuTask==="{cmd::Cmder}"||I.env.TERM_PROGRAM==="Terminus-Sublime"||I.env.TERM_PROGRAM==="vscode"||I.env.TERM==="xterm-256color"||I.env.TERM==="alacritty"||I.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}o(n1,"Ze");const to=n1(),r1=o(()=>process.env.CI==="true","ae"),ue=o((e,t)=>to?e:t,"w"),o1=ue("\u25C6","*"),oc=ue("\u25A0","x"),ic=ue("\u25B2","x"),sc=ue("\u25C7","o"),i1=ue("\u250C","T"),k=ue("\u2502","|"),no=ue("\u2514","\u2014"),ro=ue("\u25CF",">"),en=ue("\u25CB"," "),ac=o(e=>{switch(e){case"initial":case"active":return C("cyan",o1);case"cancel":return C("red",oc);case"error":return C("yellow",ic);case"submit":return C("green",sc)}},"V"),s1=o(e=>{switch(e){case"initial":case"active":return C("cyan",k);case"cancel":return C("red",k);case"error":return C("yellow",k);case"submit":return C("green",k)}},"ye"),a1=o((e,t,n,r,i)=>{let s=t,a=0;for(let u=n;u<r;u++){const c=e[u];if(s=s-c.length,a++,s<=i)break}return{lineCount:s,removals:a}},"et"),u1=o(({cursor:e,options:t,style:n,output:r=process.stdout,maxItems:i=Number.POSITIVE_INFINITY,columnPadding:s=0,rowPadding:a=4})=>{const u=Qr(r)-s,c=nc(r),d=C("dim","..."),l=Math.max(c-a,0),f=Math.max(Math.min(i,l),5);let h=0;e>=f-3&&(h=Math.max(Math.min(e-f+3,t.length-f),0));let
|
|
78
|
-
`);F.push(v),g+=v.length}if(g>l){let b=0,v=0,S=g;const A=e-w,_=o((J,H)=>a1(F,S,J,H,l),"R");
|
|
77
|
+
`)),this._prevFrame=t;return}}this.output.write(U.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}},o(Ye,"p"),Ye);const So=class So extends rc{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",n=>{this.output.write(U.cursor.move(0,-1)),this.value=n,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};o(So,"Q");let xr=So;const vo=class vo extends rc{constructor(t){super(t,!1),j(this,"options"),j(this,"cursor",0),this.options=t.options;const n=this.options.findIndex(({value:i})=>i===t.initialValue),r=n===-1?0:n;this.cursor=this.options[r].disabled?Xt(r,1,this.options):r,this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=Xt(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Xt(this.cursor,1,this.options);break}this.changeValue()})}get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}};o(vo,"nt");let eo=vo;function n1(){return I.platform!=="win32"?I.env.TERM!=="linux":!!I.env.CI||!!I.env.WT_SESSION||!!I.env.TERMINUS_SUBLIME||I.env.ConEmuTask==="{cmd::Cmder}"||I.env.TERM_PROGRAM==="Terminus-Sublime"||I.env.TERM_PROGRAM==="vscode"||I.env.TERM==="xterm-256color"||I.env.TERM==="alacritty"||I.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}o(n1,"Ze");const to=n1(),r1=o(()=>process.env.CI==="true","ae"),ue=o((e,t)=>to?e:t,"w"),o1=ue("\u25C6","*"),oc=ue("\u25A0","x"),ic=ue("\u25B2","x"),sc=ue("\u25C7","o"),i1=ue("\u250C","T"),k=ue("\u2502","|"),no=ue("\u2514","\u2014"),ro=ue("\u25CF",">"),en=ue("\u25CB"," "),ac=o(e=>{switch(e){case"initial":case"active":return C("cyan",o1);case"cancel":return C("red",oc);case"error":return C("yellow",ic);case"submit":return C("green",sc)}},"V"),s1=o(e=>{switch(e){case"initial":case"active":return C("cyan",k);case"cancel":return C("red",k);case"error":return C("yellow",k);case"submit":return C("green",k)}},"ye"),a1=o((e,t,n,r,i)=>{let s=t,a=0;for(let u=n;u<r;u++){const c=e[u];if(s=s-c.length,a++,s<=i)break}return{lineCount:s,removals:a}},"et"),u1=o(({cursor:e,options:t,style:n,output:r=process.stdout,maxItems:i=Number.POSITIVE_INFINITY,columnPadding:s=0,rowPadding:a=4})=>{const u=Qr(r)-s,c=nc(r),d=C("dim","..."),l=Math.max(c-a,0),f=Math.max(Math.min(i,l),5);let h=0;e>=f-3&&(h=Math.max(Math.min(e-f+3,t.length-f),0));let p=f<t.length&&h>0,D=f<t.length&&h+f<t.length;const m=Math.min(h+f,t.length),F=[];let g=0;p&&g++,D&&g++;const w=h+(p?1:0),E=m-(D?1:0);for(let b=w;b<E;b++){const v=Ve(n(t[b],b===e),u,{hard:!0,trim:!1}).split(`
|
|
78
|
+
`);F.push(v),g+=v.length}if(g>l){let b=0,v=0,S=g;const A=e-w,_=o((J,H)=>a1(F,S,J,H,l),"R");p?({lineCount:S,removals:b}=_(0,A),S>l&&({lineCount:S,removals:v}=_(A+1,F.length))):({lineCount:S,removals:v}=_(A+1,F.length),S>l&&({lineCount:S,removals:b}=_(0,A))),b>0&&(p=!0,F.splice(0,b)),v>0&&(D=!0,F.splice(F.length-v,v))}const y=[];p&&y.push(d);for(const b of F)for(const v of b)y.push(v);return D&&y.push(d),y},"Y"),c1=o(e=>{const t=e.active??"Yes",n=e.inactive??"No";return new xr({active:t,inactive:n,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){const r=e.withGuide??ae.withGuide,i=`${ac(this.state)} `,s=r?`${C("gray",k)} `:"",a=xt(e.output,e.message,s,i),u=`${r?`${C("gray",k)}
|
|
79
79
|
`:""}${a}
|
|
80
80
|
`,c=this.value?t:n;switch(this.state){case"submit":{const d=r?`${C("gray",k)} `:"";return`${u}${d}${C("dim",c)}`}case"cancel":{const d=r?`${C("gray",k)} `:"";return`${u}${d}${C(["strikethrough","dim"],c)}${r?`
|
|
81
81
|
${C("gray",k)}`:""}`}default:{const d=r?`${C("cyan",k)} `:"",l=r?C("cyan",no):"";return`${u}${d}${this.value?`${C("green",ro)} ${t}`:`${C("dim",en)} ${C("dim",t)}`}${e.vertical?r?`
|
|
@@ -86,12 +86,12 @@ ${l}
|
|
|
86
86
|
`)},"mt"),Oe=o((e="",t)=>{const n=process.stdout,r=`${C("gray",k)}
|
|
87
87
|
${C("gray",no)} `;n.write(`${r}${e}
|
|
88
88
|
|
|
89
|
-
`)},"gt"),l1=o(e=>C("magenta",e),"Ct"),oo=o(({indicator:e="dots",onCancel:t,output:n=process.stdout,cancelMessage:r,errorMessage:i,frames:s=to?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=to?80:120,signal:u,...c}={})=>{const d=r1();let l,f,h=!1,
|
|
89
|
+
`)},"gt"),l1=o(e=>C("magenta",e),"Ct"),oo=o(({indicator:e="dots",onCancel:t,output:n=process.stdout,cancelMessage:r,errorMessage:i,frames:s=to?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=to?80:120,signal:u,...c}={})=>{const d=r1();let l,f,h=!1,p=!1,D="",m,F=performance.now();const g=Qr(n),w=c?.styleFrame??l1,E=o(P=>{const q=P>1?i??ae.messages.error:r??ae.messages.cancel;p=P===1,h&&(qe(q,P),p&&typeof t=="function"&&t())},"T"),y=o(()=>E(2),"C"),b=o(()=>E(1),"b"),v=o(()=>{process.on("uncaughtExceptionMonitor",y),process.on("unhandledRejection",y),process.on("SIGINT",b),process.on("SIGTERM",b),process.on("exit",E),u&&u.addEventListener("abort",b)},"x"),S=o(()=>{process.removeListener("uncaughtExceptionMonitor",y),process.removeListener("unhandledRejection",y),process.removeListener("SIGINT",b),process.removeListener("SIGTERM",b),process.removeListener("exit",E),u&&u.removeEventListener("abort",b)},"G"),A=o(()=>{if(m===void 0)return;d&&n.write(`
|
|
90
90
|
`);const P=Ve(m,g,{hard:!0,trim:!1}).split(`
|
|
91
|
-
`);P.length>1&&n.write(U.cursor.up(P.length-1)),n.write(U.cursor.to(0)),n.write(U.erase.down())},"M"),_=o(P=>P.replace(/\.+$/,""),"R"),J=o(P=>{const q=(performance.now()-P)/1e3,re=Math.floor(q/60),oe=Math.floor(q%60);return re>0?`[${re}m ${oe}s]`:`[${oe}s]`},"j"),H=c.withGuide??ae.withGuide,Sc=o((P="")=>{h=!0,l=t1({output:n}),
|
|
92
|
-
`);let q=0,re=0;v(),f=setInterval(()=>{if(d&&
|
|
93
|
-
`):n.write(`${oe} ${
|
|
94
|
-
`)),S(),l()},"W");return{start:Sc,stop:o((P="")=>qe(P,0),"stop"),message:o((P="")=>{
|
|
91
|
+
`);P.length>1&&n.write(U.cursor.up(P.length-1)),n.write(U.cursor.to(0)),n.write(U.erase.down())},"M"),_=o(P=>P.replace(/\.+$/,""),"R"),J=o(P=>{const q=(performance.now()-P)/1e3,re=Math.floor(q/60),oe=Math.floor(q%60);return re>0?`[${re}m ${oe}s]`:`[${oe}s]`},"j"),H=c.withGuide??ae.withGuide,Sc=o((P="")=>{h=!0,l=t1({output:n}),D=_(P),F=performance.now(),H&&n.write(`${C("gray",k)}
|
|
92
|
+
`);let q=0,re=0;v(),f=setInterval(()=>{if(d&&D===m)return;A(),m=D;const oe=w(s[q]);let ht;if(d)ht=`${oe} ${D}...`;else if(e==="timer")ht=`${oe} ${D} ${J(F)}`;else{const Ac=".".repeat(Math.floor(re)).slice(0,3);ht=`${oe} ${D}${Ac}`}const vc=Ve(ht,g,{hard:!0,trim:!1});n.write(vc),q=q+1<s.length?q+1:0,re=re<4?re+.125:0},a)},"ie"),qe=o((P="",q=0,re=!1)=>{if(!h)return;h=!1,clearInterval(f),A();const oe=q===0?C("green",sc):q===1?C("red",oc):C("red",ic);D=P??D,re||(e==="timer"?n.write(`${oe} ${D} ${J(F)}
|
|
93
|
+
`):n.write(`${oe} ${D}
|
|
94
|
+
`)),S(),l()},"W");return{start:Sc,stop:o((P="")=>qe(P,0),"stop"),message:o((P="")=>{D=_(P??D)},"message"),cancel:o((P="")=>qe(P,1),"cancel"),error:o((P="")=>qe(P,2),"error"),clear:o(()=>qe("",0,!0),"clear"),get isCancelled(){return p}}},"fe"),tn=o((e,t)=>e.includes(`
|
|
95
95
|
`)?e.split(`
|
|
96
96
|
`).map(n=>t(n)).join(`
|
|
97
97
|
`):t(e),"re"),d1=o(e=>{const t=o((n,r)=>{const i=n.label??String(n.value);switch(r){case"disabled":return`${C("gray",en)} ${tn(i,s=>C("gray",s))}${n.hint?` ${C("dim",`(${n.hint??"disabled"})`)}`:""}`;case"selected":return`${tn(i,s=>C("dim",s))}`;case"active":return`${C("green",ro)} ${i}${n.hint?` ${C("dim",`(${n.hint})`)}`:""}`;case"cancelled":return`${tn(i,s=>C(["strikethrough","dim"],s))}`;default:return`${C("dim",en)} ${tn(i,s=>C("dim",s))}`}},"i");return new eo({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){const n=e.withGuide??ae.withGuide,r=`${ac(this.state)} `,i=`${s1(this.state)} `,s=xt(e.output,e.message,i,r),a=`${n?`${C("gray",k)}
|
|
@@ -108,16 +108,16 @@ ${io}${zr(`aicommit v${Sn.version}`)}`),console.error(`
|
|
|
108
108
|
${io}Please open a Bug report with the information above:`),console.error(`${io}https://github.com/NegoZiatoR/ai-commit/issues/new/choose`))},"handleCliError"),so=o(async()=>{const{stdout:e,failed:t}=await Ge("git",["rev-parse","--show-toplevel"],{reject:!1});if(t)throw new O("The current directory must be a Git repository!");return e},"assertGitRepo"),ao=o(e=>`:(exclude)${e}`,"excludeFromDiff"),cc=["package-lock.json","*.lock"].map(ao),lc=o(async e=>{const t=["diff","--cached","--diff-algorithm=minimal"],{stdout:n}=await Ge("git",[...t,"--name-only",...cc,...e?e.map(ao):[]]);if(!n)return;const{stdout:r}=await Ge("git",[...t,...cc,...e?e.map(ao):[]]);return{files:n.split(`
|
|
109
109
|
`),diff:r}},"getStagedDiff"),f1=o(e=>`Detected ${e.length.toLocaleString()} staged file${e.length>1?"s":""}`,"getDetectedMessage");var uo,dc;function h1(){if(dc)return uo;dc=1;const{hasOwnProperty:e}=Object.prototype,t=o((u,c={})=>{typeof c=="string"&&(c={section:c}),c.align=c.align===!0,c.newline=c.newline===!0,c.sort=c.sort===!0,c.whitespace=c.whitespace===!0||c.align===!0,c.platform=c.platform||typeof process<"u"&&process.platform,c.bracketedArray=c.bracketedArray!==!1;const d=c.platform==="win32"?`\r
|
|
110
110
|
`:`
|
|
111
|
-
`,l=c.whitespace?" = ":"=",f=[],h=c.sort?Object.keys(u).sort():Object.keys(u);let
|
|
112
|
-
`);for(const r of n){const i=r.trim();if(!i||i.startsWith("#"))continue;const s=i.match(/^([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/i);if(!s)continue;const[,a,u]=s;let c=u.trim();(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),t[a]=c}return t}o(p1,"parseEnvContent");async function hc(e){const{filename:t=".env",directory:n=process.cwd(),override:r=!1}=e||{},i=ce.join(n,t);if(!await rn(i))return{};try{const a=await W.readFile(i,"utf8"),u=p1(a);for(const[c,d]of Object.entries(u))(r||process.env[c]===void 0)&&(process.env[c]=d);return u}catch{return{}}}o(hc,"loadEnvFile");async function m1(){process.env.NODE_ENV==="test"?await hc({filename:".env.local"}):await hc({filename:".env"})}o(m1,"loadEnvironment");const Dc=["openai","anthropic","azure-openai","ollama","custom"],g1=["","conventional"],{hasOwnProperty:F1}=Object.prototype,pc=o((e,t)=>F1.call(e,t),"hasOwn"),
|
|
113
|
-
${a.files.map(
|
|
114
|
-
`)}`);const{env:u}=process,c=await fo({OPENAI_KEY:u.OPENAI_KEY||u.OPENAI_API_KEY,proxy:u.https_proxy||u.HTTPS_PROXY||u.http_proxy||u.HTTP_PROXY,generate:e?.toString(),type:r?.toString()}),d=oo();d.start("The AI is analyzing your changes");let l;try{const
|
|
111
|
+
`,l=c.whitespace?" = ":"=",f=[],h=c.sort?Object.keys(u).sort():Object.keys(u);let p=0;c.align&&(p=s(h.filter(F=>u[F]===null||Array.isArray(u[F])||typeof u[F]!="object").map(F=>Array.isArray(u[F])?`${F}[]`:F).concat([""]).reduce((F,g)=>s(F).length>=s(g).length?F:g)).length);let D="";const m=c.bracketedArray?"[]":"";for(const F of h){const g=u[F];if(g&&Array.isArray(g))for(const w of g)D+=s(`${F}${m}`).padEnd(p," ")+l+s(w)+d;else g&&typeof g=="object"?f.push(F):D+=s(F).padEnd(p," ")+l+s(g)+d}c.section&&D.length&&(D="["+s(c.section)+"]"+(c.newline?d+d:d)+D);for(const F of f){const g=n(F,".").join("\\."),w=(c.section?c.section+".":"")+g,E=t(u[F],{...c,section:w});D.length&&E.length&&(D+=d),D+=E}return D},"encode");function n(u,c){var d=0,l=0,f=0,h=[];do if(f=u.indexOf(c,d),f!==-1){if(d=f+c.length,f>0&&u[f-1]==="\\")continue;h.push(u.slice(l,f)),l=f+c.length}while(f!==-1);return h.push(u.slice(l)),h}o(n,"splitSections");const r=o((u,c={})=>{c.bracketedArray=c.bracketedArray!==!1;const d=Object.create(null);let l=d,f=null;const h=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,p=u.split(/[\r\n]+/g),D={};for(const F of p){if(!F||F.match(/^\s*[;#]/)||F.match(/^\s*$/))continue;const g=F.match(h);if(!g)continue;if(g[1]!==void 0){if(f=a(g[1]),f==="__proto__"){l=Object.create(null);continue}l=d[f]=d[f]||Object.create(null);continue}const w=a(g[2]);let E;c.bracketedArray?E=w.length>2&&w.slice(-2)==="[]":(D[w]=(D?.[w]||0)+1,E=D[w]>1);const y=E&&w.endsWith("[]")?w.slice(0,-2):w;if(y==="__proto__")continue;const b=g[3]?a(g[4]):!0,v=b==="true"||b==="false"||b==="null"?JSON.parse(b):b;E&&(e.call(l,y)?Array.isArray(l[y])||(l[y]=[l[y]]):l[y]=[]),Array.isArray(l[y])?l[y].push(v):l[y]=v}const m=[];for(const F of Object.keys(d)){if(!e.call(d,F)||typeof d[F]!="object"||Array.isArray(d[F]))continue;const g=n(F,".");l=d;const w=g.pop(),E=w.replace(/\\\./g,".");for(const y of g)y!=="__proto__"&&((!e.call(l,y)||typeof l[y]!="object")&&(l[y]=Object.create(null)),l=l[y]);l===d&&E===w||(l[E]=d[F],m.push(F))}for(const F of m)delete d[F];return d},"decode"),i=o(u=>u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"),"isQuoted"),s=o(u=>typeof u!="string"||u.match(/[=\r\n]/)||u.match(/^\[/)||u.length>1&&i(u)||u!==u.trim()?JSON.stringify(u):u.split(";").join("\\;").split("#").join("\\#"),"safe"),a=o(u=>{if(u=(u||"").trim(),i(u)){u.charAt(0)==="'"&&(u=u.slice(1,-1));try{u=JSON.parse(u)}catch{}}else{let c=!1,d="";for(let l=0,f=u.length;l<f;l++){const h=u.charAt(l);if(c)"\\;#".indexOf(h)!==-1?d+=h:d+="\\"+h,c=!1;else{if(";#".indexOf(h)!==-1)break;h==="\\"?c=!0:d+=h}}return c&&(d+="\\"),d.trim()}return u},"unsafe");return uo={parse:r,decode:r,stringify:t,encode:t,safe:s,unsafe:a},uo}o(h1,"requireIni");var D1=h1(),fc=Xi(D1);const rn=o(e=>W.lstat(e).then(()=>!0,()=>!1),"fileExists"),co=o(async e=>{try{let t;try{t=e||await so()}catch(a){if(a instanceof O&&a.message.includes("Git repository"))return;throw a}const n=ce.join(t,".ai-commit.json");if(!await rn(n))return;const i=await W.readFile(n,"utf8");return JSON.parse(i)}catch(t){if(t instanceof O)throw t;return}},"getProjectConfig");function p1(e){const t={},n=e.split(`
|
|
112
|
+
`);for(const r of n){const i=r.trim();if(!i||i.startsWith("#"))continue;const s=i.match(/^([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/i);if(!s)continue;const[,a,u]=s;let c=u.trim();(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),t[a]=c}return t}o(p1,"parseEnvContent");async function hc(e){const{filename:t=".env",directory:n=process.cwd(),override:r=!1}=e||{},i=ce.join(n,t);if(!await rn(i))return{};try{const a=await W.readFile(i,"utf8"),u=p1(a);for(const[c,d]of Object.entries(u))(r||process.env[c]===void 0)&&(process.env[c]=d);return u}catch{return{}}}o(hc,"loadEnvFile");async function m1(){process.env.NODE_ENV==="test"?await hc({filename:".env.local"}):await hc({filename:".env"})}o(m1,"loadEnvironment");const Dc=["openai","anthropic","azure-openai","ollama","custom"],g1=["","conventional"],{hasOwnProperty:F1}=Object.prototype,pc=o((e,t)=>F1.call(e,t),"hasOwn"),R=o((e,t,n)=>{if(!t)throw new O(`Invalid config property ${e}: ${n}`)},"parseAssert"),on={provider(e){return e?(R("provider",Dc.includes(e),`Must be one of: ${Dc.join(", ")}`),e):"openai"},OPENAI_KEY(e){if(e)return R("OPENAI_KEY",e.startsWith("sk-"),'Must start with "sk-"'),e},ANTHROPIC_KEY(e){if(e)return R("ANTHROPIC_KEY",e.startsWith("sk-ant-"),'Must start with "sk-ant-"'),e},AZURE_OPENAI_KEY(e){return e},AZURE_ENDPOINT(e){if(e)return R("AZURE_ENDPOINT",/^https?:\/\//.test(e),"Must be a valid URL"),e},OLLAMA_ENDPOINT(e){return e?(R("OLLAMA_ENDPOINT",/^https?:\/\//.test(e),"Must be a valid URL"),e):"http://localhost:11434"},CUSTOM_ENDPOINT(e){if(e)return R("CUSTOM_ENDPOINT",/^https?:\/\//.test(e),"Must be a valid URL"),e},CUSTOM_KEY(e){return e},locale(e){return e?(R("locale",e,"Cannot be empty"),R("locale",/^[a-z-]+$/i.test(e),"Must be a valid locale (letters and dashes/underscores). You can consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes"),e):"en"},generate(e){if(!e)return 1;R("generate",/^\d+$/.test(e),"Must be an integer");const t=Number(e);return R("generate",t>0,"Must be greater than 0"),R("generate",t<=5,"Must be less or equal to 5"),t},type(e){return e?(R("type",g1.includes(e),"Invalid commit type"),e):""},proxy(e){if(!(!e||e.length===0))return R("proxy",/^https?:\/\//.test(e),"Must be a valid URL"),e},model(e){return!e||e.length===0?"gpt-4o-mini":e},timeout(e){if(!e)return 1e4;R("timeout",/^\d+$/.test(e),"Must be an integer");const t=Number(e);return R("timeout",t>=500,"Must be greater than 500ms"),t},temperature(e){if(!e)return .2;R("temperature",/^(2|\d)(\.\d{1,2})?$/.test(e),"Must be decimal between 0 and 2");const t=Number(e);return R("temperature",t>0,"Must be greater than 0"),R("temperature",t<=2,"Must be less than or equal to 2"),t},"max-length"(e){if(!e)return 50;R("max-length",/^\d+$/.test(e),"Must be an integer");const t=Number(e);return R("max-length",t>=20,"Must be greater than 20 characters"),t},"max-completion-tokens"(e){if(!e)return 1e4;R("max-completion-tokens",/^\d+$/.test(e),"Must be an integer");const t=Number(e);return R("max-completion-tokens",t>0,"Must be greater than 0"),t},"auto-confirm"(e){return e?typeof e=="boolean"?e:(R("auto-confirm",/^(?:true|false)$/.test(e),"Must be a boolean"),e==="true"):!1},"prepend-reference"(e){return e?typeof e=="boolean"?e:(R("prepend-reference",/^(?:true|false)$/.test(e),"Must be a boolean"),e==="true"):!1},signoff(e){return e?typeof e=="boolean"?e:(R("signoff",/^(?:true|false)$/.test(e),"Must be a boolean"),e==="true"):!1}},lo=ce.join(Kc.homedir(),".aicommit"),mc=o(async()=>{if(!await rn(lo))return Object.create(null);const t=await W.readFile(lo,"utf8");return fc.parse(t)},"readConfigFile"),w1=o(e=>{const t=e.provider;switch(t){case"openai":if(!e.OPENAI_KEY)throw new O("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");break;case"anthropic":if(!e.ANTHROPIC_KEY)throw new O("Please set your Anthropic API key via `aicommit config set ANTHROPIC_KEY=<your token>`\nGet your API key from: https://console.anthropic.com/");break;case"azure-openai":if(!e.AZURE_OPENAI_KEY)throw new O("Please set your Azure OpenAI API key via `aicommit config set AZURE_OPENAI_KEY=<your token>`");if(!e.AZURE_ENDPOINT)throw new O("Please set your Azure OpenAI endpoint via `aicommit config set AZURE_ENDPOINT=<your endpoint>`");break;case"ollama":break;case"custom":if(!e.CUSTOM_ENDPOINT)throw new O("Please set your custom endpoint via `aicommit config set CUSTOM_ENDPOINT=<your endpoint>`");break;default:throw new O(`Unknown provider: ${t}`)}},"validateProviderConfig"),fo=o(async(e,t)=>{await m1();const n=await mc(),r=await co(),i={};for(const a of Object.keys(on)){const u=on[a];let c=r?.[a]??e?.[a]??process.env[a]??n[a];if(typeof c=="boolean"&&(c=c.toString()),t)try{i[a]=u(c)}catch{}else i[a]=u(c)}const s=i;return t||w1(s),s},"getConfig"),y1=o(async e=>{const t=await mc();for(const[n,r]of e){if(!pc(on,n))throw new O(`Invalid config property: ${n}`);const i=on[n](r);t[n]=i}await W.writeFile(lo,fc.stringify(t),"utf8")},"setConfigs"),gc={openai:o(()=>import("./openai-Zu2hwLw7.mjs"),"openai"),anthropic:o(()=>import("./anthropic-Bflyvw43.mjs"),"anthropic"),"azure-openai":o(()=>import("./azure-openai-DherjF_r.mjs"),"azure-openai"),ollama:o(()=>import("./ollama-B_kUc-33.mjs"),"ollama"),custom:o(()=>import("./custom-BGtaR9LL.mjs"),"custom")};async function Fc(e,t){const n=gc[e];if(!n)throw new O(`Unknown provider type: ${e}. Supported providers: ${Object.keys(gc).join(", ")}`);try{const i=(await n()).default;return new i(t)}catch(r){throw r instanceof O?r:r.code==="ERR_MODULE_NOT_FOUND"?new O(`Provider "${e}" is not yet implemented. Currently supported: openai`):new O(`Failed to initialize provider "${e}": ${r.message}`)}}o(Fc,"createProvider");var E1=o(async(e,t,n,r,i)=>(async()=>{uc(Hu(Vu(" aicommit "))),await so();const s=oo();n&&await Ge("git",["add","--update"]),s.start("Detecting staged files");const a=await lc(t);if(!a)throw s.stop("Detecting staged files"),new O("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");s.stop(`${f1(a.files)}:
|
|
113
|
+
${a.files.map(p=>` ${p}`).join(`
|
|
114
|
+
`)}`);const{env:u}=process,c=await fo({OPENAI_KEY:u.OPENAI_KEY||u.OPENAI_API_KEY,proxy:u.https_proxy||u.HTTPS_PROXY||u.http_proxy||u.HTTP_PROXY,generate:e?.toString(),type:r?.toString()}),d=oo();d.start("The AI is analyzing your changes");let l;try{const p={model:c.model,locale:c.locale,maxLength:c["max-length"],type:c.type,timeout:c.timeout,temperature:c.temperature,maxCompletionTokens:c["max-completion-tokens"],proxy:c.proxy};let D;switch(c.provider){case"openai":D={...p,apiKey:c.OPENAI_KEY};break;case"anthropic":D={...p,apiKey:c.ANTHROPIC_KEY};break;case"azure-openai":D={...p,apiKey:c.AZURE_OPENAI_KEY,endpoint:c.AZURE_ENDPOINT};break;case"ollama":D={...p,endpoint:c.OLLAMA_ENDPOINT};break;case"custom":D={...p,endpoint:c.CUSTOM_ENDPOINT,apiKey:c.CUSTOM_KEY};break;default:D={...p,apiKey:c.OPENAI_KEY}}const m=await Fc(c.provider,D),F=await co();l=(await m.generateCommitMessage({diff:a.diff,completions:c.generate,projectConfig:F})).messages}finally{d.stop("Changes analyzed")}if(l.length===0)throw new O("No commit messages were generated. Try again.");let f;if(l.length===1){[f]=l;let p;if(c["auto-confirm"]?(p=!0,Oe(`${ft("\u2714")} Auto confirmed commit message.
|
|
115
115
|
|
|
116
116
|
${f}
|
|
117
|
-
`)):
|
|
117
|
+
`)):p=await c1({message:`Use this commit message?
|
|
118
118
|
|
|
119
119
|
${f}
|
|
120
|
-
`}),!
|
|
120
|
+
`}),!p||tc(p)){Oe("Commit cancelled");return}}else{const p=await d1({message:`Pick a commit message to use: ${zr("(Ctrl+c to exit)")}`,options:l.map(D=>({label:D,value:D}))});if(tc(p)){Oe("Commit cancelled");return}f=p}if(c["prepend-reference"]){const{stdout:p}=await Ge("git",["branch","--show-current"]),D=p.match(/([a-zA-Z])+-([0-9]+)/)?.[0];D?.length&&(f=`${D?.toUpperCase()}: ${f}`)}const h=["commit","-m",f,...i];c.signoff&&h.push("--signoff"),await Ge("git",h),Oe(`${ft("\u2714")} Successfully committed!`)})().catch(s=>{Oe(`${Yt("\u2716")} ${s.message}`),nn(s),process.exit(1)}),"aicommit");const[ho,b1]=process.argv.slice(2);var C1=o(()=>(async()=>{if(!ho)throw new O('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(b1)return;const e=await lc();if(!e)return;uc(Hu(Vu(" aicommit ")));const{env:t}=process,n=await fo({proxy:t.https_proxy||t.HTTPS_PROXY||t.http_proxy||t.HTTP_PROXY}),r=oo();r.start("The AI is analyzing your changes");let i;try{const d={model:n.model,locale:n.locale,maxLength:n["max-length"],type:n.type,timeout:n.timeout,temperature:n.temperature,maxCompletionTokens:n["max-completion-tokens"],proxy:n.proxy};let l;switch(n.provider){case"openai":l={...d,apiKey:n.OPENAI_KEY};break;case"anthropic":l={...d,apiKey:n.ANTHROPIC_KEY};break;case"azure-openai":l={...d,apiKey:n.AZURE_OPENAI_KEY,endpoint:n.AZURE_ENDPOINT};break;case"ollama":l={...d,endpoint:n.OLLAMA_ENDPOINT};break;case"custom":l={...d,endpoint:n.CUSTOM_ENDPOINT,apiKey:n.CUSTOM_KEY};break;default:l={...d,apiKey:n.OPENAI_KEY}}const f=await Fc(n.provider,l),h=await co();i=(await f.generateCommitMessage({diff:e.diff,completions:n.generate,projectConfig:h})).messages}finally{r.stop("Changes analyzed")}const a=await W.readFile(ho,"utf8")!=="",u=i.length>1;let c="";a&&(c=`# \u{1F916} AI generated commit${u?"s":""}
|
|
121
121
|
`),u?(a&&(c+=`# Select one of the following messages by uncommeting:
|
|
122
122
|
`),c+=`
|
|
123
123
|
${i.map(d=>`# ${d}`).join(`
|
package/dist/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./cli-
|
|
2
|
+
import"./cli-BKUAQIcs.mjs";import"tty";import"node:url";import"node:child_process";import"node:string_decoder";import"node:util";import"node:process";import"node:tty";import"node:path";import"child_process";import"path";import"fs";import"node:timers/promises";import"node:os";import"node:events";import"node:v8";import"node:fs";import"node:stream";import"node:buffer";import"node:stream/promises";import"node:readline";import"fs/promises";import"os";import"url";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var M=Object.defineProperty;var d=(l,t)=>M(l,"name",{value:t,configurable:!0});import T from"http";import N from"https";import{L as O,g as P}from"./prompt-BGI0PV0L.mjs";import{K as m}from"./cli-
|
|
1
|
+
var M=Object.defineProperty;var d=(l,t)=>M(l,"name",{value:t,configurable:!0});import T from"http";import N from"https";import{L as O,g as P}from"./prompt-BGI0PV0L.mjs";import{K as m}from"./cli-BKUAQIcs.mjs";import"tty";import"node:url";import"node:child_process";import"node:string_decoder";import"node:util";import"node:process";import"node:tty";import"node:path";import"child_process";import"path";import"fs";import"node:timers/promises";import"node:os";import"node:events";import"node:v8";import"node:fs";import"node:stream";import"node:buffer";import"node:stream/promises";import"node:readline";import"fs/promises";import"os";import"url";const g=class g extends O{get name(){return"custom"}validateConfig(){const{endpoint:t}=this.config;if(!t)throw new m("Please set your custom endpoint via `aicommit config set CUSTOM_ENDPOINT=<your endpoint>`")}async generateCommitMessage(t){try{const o=[{role:"system",content:P(this.config.locale,this.config.maxLength,this.config.type,t.projectConfig)},{role:"user",content:t.diff}],s=[];for(let i=0;i<t.completions;i++){const e=await this.createChatCompletion(o);let n;e.choices&&e.choices[0]?.message?.content?n=e.choices[0].message.content:e.message?.content?n=e.message.content:e.content?n=e.content:typeof e=="string"&&(n=e),n&&s.push(this.sanitizeMessage(n))}return{messages:this.deduplicateMessages(s)}}catch(r){const o=r;throw o.code==="ECONNREFUSED"?new m(`Cannot connect to custom endpoint at ${this.config.endpoint}. Make sure your endpoint is running and accessible.`):o.code==="ENOTFOUND"?new m(`Error connecting to ${o.hostname} (${o.syscall}). Check your CUSTOM_ENDPOINT configuration.`):o}}async createChatCompletion(t){const r={model:this.config.model,messages:t,temperature:this.config.temperature,max_tokens:this.config.maxCompletionTokens},o={...this.config.headers||{}};this.config.apiKey&&(o.Authorization=`Bearer ${this.config.apiKey}`);const{response:s,data:a}=await this.httpPost(this.config.endpoint,"",o,r);if(!s.statusCode||s.statusCode<200||s.statusCode>299){let i=`Custom API Error: ${s.statusCode} - ${s.statusMessage}`;throw a&&(i+=`
|
|
2
2
|
|
|
3
3
|
${a}`),new m(i)}return JSON.parse(a)}async httpPost(t,r,o,s){return new Promise((a,i)=>{const e=new URL(t),n=e.protocol==="https:",y=n?N:T,C=e.pathname+(r||""),f=JSON.stringify(s),c=y.request({hostname:e.hostname,port:e.port||(n?443:80),path:C,method:"POST",headers:{...o,"Content-Type":"application/json","Content-Length":Buffer.byteLength(f)},timeout:this.config.timeout},p=>{const u=[];p.on("data",w=>u.push(w)),p.on("end",()=>{a({request:c,response:p,data:Buffer.concat(u).toString()})})});c.on("error",i),c.on("timeout",()=>{c.destroy(),i(new m(`Time out error: request took over ${this.config.timeout}ms. Try increasing the \`timeout\` config.`))}),c.write(f),c.end()})}sanitizeMessage(t){return t.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1")}deduplicateMessages(t){return Array.from(new Set(t))}};d(g,"CustomProvider");let h=g;export{h as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var C=Object.defineProperty;var f=(d,t)=>C(d,"name",{value:t,configurable:!0});import M from"http";import O from"https";import{L as $,g as L}from"./prompt-BGI0PV0L.mjs";import{K as m}from"./cli-
|
|
1
|
+
var C=Object.defineProperty;var f=(d,t)=>C(d,"name",{value:t,configurable:!0});import M from"http";import O from"https";import{L as $,g as L}from"./prompt-BGI0PV0L.mjs";import{K as m}from"./cli-BKUAQIcs.mjs";import"tty";import"node:url";import"node:child_process";import"node:string_decoder";import"node:util";import"node:process";import"node:tty";import"node:path";import"child_process";import"path";import"fs";import"node:timers/promises";import"node:os";import"node:events";import"node:v8";import"node:fs";import"node:stream";import"node:buffer";import"node:stream/promises";import"node:readline";import"fs/promises";import"os";import"url";const g=class g extends ${get name(){return"ollama"}validateConfig(){const{endpoint:t}=this.config;if(!t)throw new m("Ollama endpoint is not configured. Using default: http://localhost:11434")}async generateCommitMessage(t){try{const e=[{role:"system",content:L(this.config.locale,this.config.maxLength,this.config.type,t.projectConfig)},{role:"user",content:t.diff}],o=[];for(let s=0;s<t.completions;s++){const a=(await this.createChatCompletion(e)).message.content;a&&o.push(this.sanitizeMessage(a))}return{messages:this.deduplicateMessages(o)}}catch(r){const e=r;throw e.code==="ECONNREFUSED"?new m(`Cannot connect to Ollama at ${this.config.endpoint}. Make sure Ollama is running. Install from: https://ollama.com`):e.code==="ENOTFOUND"?new m(`Error connecting to ${e.hostname} (${e.syscall}). Check your OLLAMA_ENDPOINT configuration.`):e}}async createChatCompletion(t){const r={model:this.config.model,messages:t,stream:!1,options:{temperature:this.config.temperature,num_predict:this.config.maxCompletionTokens}},{response:e,data:o}=await this.httpPost(this.config.endpoint,"/api/chat",{},r);if(!e.statusCode||e.statusCode<200||e.statusCode>299){let n=`Ollama API Error: ${e.statusCode} - ${e.statusMessage}`;if(o)try{const s=JSON.parse(o);s.error&&(n+=`
|
|
2
2
|
|
|
3
3
|
${s.error}`)}catch{n+=`
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var d=Object.defineProperty;var g=(u,t)=>d(u,"name",{value:t,configurable:!0});import y from"https";import{d as w}from"./index-B3_BP8RZ.mjs";import{L as C,g as A}from"./prompt-BGI0PV0L.mjs";import{K as i}from"./cli-
|
|
1
|
+
var d=Object.defineProperty;var g=(u,t)=>d(u,"name",{value:t,configurable:!0});import y from"https";import{d as w}from"./index-B3_BP8RZ.mjs";import{L as C,g as A}from"./prompt-BGI0PV0L.mjs";import{K as i}from"./cli-BKUAQIcs.mjs";import"net";import"tls";import"assert";import"tty";import"util";import"os";import"http";import"url";import"node:url";import"node:child_process";import"node:string_decoder";import"node:util";import"node:process";import"node:tty";import"node:path";import"child_process";import"path";import"fs";import"node:timers/promises";import"node:os";import"node:events";import"node:v8";import"node:fs";import"node:stream";import"node:buffer";import"node:stream/promises";import"node:readline";import"fs/promises";const m=class m extends C{get name(){return"openai"}validateConfig(){const{apiKey:t}=this.config;if(!t)throw new i("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");if(!t.startsWith("sk-"))throw new i('Invalid OpenAI API key: Must start with "sk-"')}async generateCommitMessage(t){try{const e=await this.createChatCompletion({model:this.config.model,messages:[{role:"system",content:A(this.config.locale,this.config.maxLength,this.config.type,t.projectConfig)},{role:"user",content:t.diff}],temperature:this.config.temperature,top_p:1,frequency_penalty:0,presence_penalty:0,max_completion_tokens:this.config.maxCompletionTokens,stream:!1,n:t.completions});return{messages:this.deduplicateMessages(e.choices.filter(s=>s.message?.content).map(s=>this.sanitizeMessage(s.message.content)))}}catch(e){const o=e;throw o.code==="ENOTFOUND"?new i(`Error connecting to ${o.hostname} (${o.syscall}). Are you connected to the internet?`):o}}async createChatCompletion(t){const{response:e,data:o}=await this.httpsPost("api.openai.com","/v1/chat/completions",{Authorization:`Bearer ${this.config.apiKey}`},t);if(!e.statusCode||e.statusCode<200||e.statusCode>299){let s=`OpenAI API Error: ${e.statusCode} - ${e.statusMessage}`;throw o&&(s+=`
|
|
2
2
|
|
|
3
3
|
${o}`),e.statusCode===500&&(s+=`
|
|
4
4
|
|