@negoziator/ai-commit 2.43.0 → 2.44.1
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-BvdjyTO3.mjs → anthropic-CMTD-N0Y.mjs} +1 -1
- package/dist/{azure-openai-C-JrV234.mjs → azure-openai-CiUSPVuR.mjs} +1 -1
- package/dist/{cli-DnoFtzxM.mjs → cli-CNTPumTf.mjs} +14 -14
- package/dist/cli.mjs +1 -1
- package/dist/{custom-CLrK7hHB.mjs → custom-blUU1NGU.mjs} +1 -1
- package/dist/{ollama-D4JpKAJ3.mjs → ollama-DoBdy1Lw.mjs} +1 -1
- package/dist/{openai-3rmNO1cL.mjs → openai-CXIeQUC6.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-CNTPumTf.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-CNTPumTf.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,4 +1,4 @@
|
|
|
1
|
-
var zc=Object.defineProperty;var o=(e,t)=>zc(e,"name",{value:t,configurable:!0});var We;import Vc from"tty";import{fileURLToPath as No}from"node:url";import{ChildProcess as jo,execFile as qc,spawnSync as Kc,spawn as Yc}from"node:child_process";import{StringDecoder as Uo}from"node:string_decoder";import{debuglog as Hc,stripVTControlCharacters as Zc,inspect as Wo,promisify as Go,callbackify as Oe,aborted as Jc,styleText as $}from"node:util";import x,{platform as Xc,hrtime as zo,execPath as Qc,execArgv as el,stdout as ln,stdin as Vo}from"node:process";import qo,{ReadStream as Ko}from"node:tty";import K from"node:path";import tl from"child_process";import ce from"path";import dn from"fs";import{setTimeout as Yo,scheduler as Ho,setImmediate as nl}from"node:timers/promises";import{constants as De}from"node:os";import{once as z,addAbortListener as Zo,EventEmitter as rl,on as ht,setMaxListeners as ol}from"node:events";import{serialize as il}from"node:v8";import{statSync as sl,readFileSync as fn,appendFileSync as al,writeFileSync as ul,createWriteStream as Jo,createReadStream as Xo}from"node:fs";import{Transform as cl,getDefaultHighWaterMark as pt,Duplex as hn,Writable as pn,Readable as me,PassThrough as Qo}from"node:stream";import{Buffer as Dn}from"node:buffer";import{finished as le}from"node:stream/promises";import*as Dt from"node:readline";import ll from"node:readline";import W from"fs/promises";import dl from"os";import{fileURLToPath as fl,pathToFileURL as hl}from"url";var pl=Object.defineProperty,L=o((e,t)=>pl(e,"name",{value:t,configurable:!0}),"a$1");const Dl="known-flag",ml="unknown-flag",gl="argument",Fl=/\B([A-Z])/g,wl=L(e=>e.replaceAll(Fl,"-$1").toLowerCase(),"camelToKebab"),{hasOwnProperty:yl}=Object.prototype,ze=L((e,t)=>yl.call(e,t),"hasOwn"),mn=L(e=>typeof e=="function"?[e,!1]:Array.isArray(e)?[e[0],!0]:mn(e.type),"parseFlagType"),ei=L((e,t)=>e===Boolean?t!=="false":t,"normalizeBoolean"),ti=L((e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),"applyParser"),El=/[\s.:=]/,bl=L(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(El);if(n)throw new Error(`${t} cannot contain "${n?.[0]}"`)},"validateFlagName"),gn=L((e,t,n)=>{if(ze(e,t))throw new Error(`Duplicate flags named "${t}"`);e[t]=n},"setFlag"),Cl=L(e=>{const t={};for(const n in e){if(!ze(e,n))continue;bl(n);const r=e[n],i=[[],...mn(r),r];gn(t,n,i);const s=wl(n);if(n!==s&&gn(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`);gn(t,a,i)}}return t},"createRegistry"),Sl=L((e,t)=>{const n={};for(const r in e){if(!ze(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"),mt="--",vl=3,$l=/^-{1,2}\w/,ni=L(e=>{if(!$l.test(e))return;const t=!e.startsWith(mt);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"),ri=L((e,{onFlag:t,onArgument:n})=>{let r;const i=L((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===mt){i();const c=e.slice(s+1);n?.(c,[s],!0);break}const u=ni(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"),oi=L((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"),Al=L((e,t=process.argv.slice(2),{ignore:n}={})=>{const r=[],i=Cl(e),s={},a=[];return a[mt]=[],ri(t,{onFlag(u,c,d){const l=(d.length===vl||u.length>1)&&ze(i,u);if(!n?.(l?Dl:ml,u,c)){if(l){const[f,h]=i[u],D=ei(h,c),p=L((m,g)=>{r.push(d),g&&r.push(g),f.push(ti(h,m||""))},"getFollowingValue");return D===void 0?p:p(D)}ze(s,u)||(s[u]=[]),s[u].push(c===void 0?!0:c),r.push(d)}},onArgument:L((u,c,d)=>{n?.(gl,t[c[0]])||(a.push(...u),d?(a[mt]=u,t.splice(c[0])):r.push(c))},"onArgument")}),oi(t,r),{flags:Sl(e,i),unknownFlags:s,_:a}},"typeFlag");L((e,t,n=process.argv.slice(2))=>{const r=new Set(e.split(",").map(c=>ni(c)?.[0])),[i,s]=mn(t),a=[],u=[];return ri(n,{onFlag:L((c,d,l)=>{if(!r.has(c)||!s&&a.length>0)return;const f=ei(i,d),h=L((D,p)=>{u.push(l),p&&u.push(p),a.push(ti(i,D||""))},"getFollowingValue");return f===void 0?h:h(f)},"onFlag")}),oi(n,u),s?a:a[0]},"getFlag");var Bl=Object.defineProperty,A=o((e,t)=>Bl(e,"name",{value:t,configurable:!0}),"n$1");const Tl=A(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 ii({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(ii,"j$1"),A(ii,"ansiRegex");const xl=ii();function Fn(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(xl,"")}o(Fn,"w"),A(Fn,"stripAnsi");function si(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(si,"P$2"),A(si,"isAmbiguous");function ai(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}o(ai,"z$3"),A(ai,"isFullWidth");function ui(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(ui,"G$2"),A(ui,"isWide");function ci(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}o(ci,"Z$2"),A(ci,"validate");function li(e,{ambiguousAsWide:t=!1}={}){return ci(e),ai(e)||ui(e)||t&&si(e)?2:1}o(li,"V$2"),A(li,"eastAsianWidth");var Ol=A(()=>/[#*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 Il=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=Fn(e)),e.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:a}of Il.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(Ol().test(a)){i+=2;continue}i+=li(u,s)}}return i}o(de,"d"),A(de,"stringWidth");const di=A(e=>Math.max(...e.split(`
|
|
1
|
+
var zc=Object.defineProperty;var o=(e,t)=>zc(e,"name",{value:t,configurable:!0});var Ge;import Vc from"tty";import{fileURLToPath as No}from"node:url";import{ChildProcess as jo,execFile as qc,spawnSync as Kc,spawn as Yc}from"node:child_process";import{StringDecoder as Uo}from"node:string_decoder";import{debuglog as Hc,stripVTControlCharacters as Zc,inspect as Wo,promisify as Go,callbackify as Oe,aborted as Jc,styleText as $}from"node:util";import x,{platform as Xc,hrtime as zo,execPath as Qc,execArgv as el,stdout as ln,stdin as Vo}from"node:process";import qo,{ReadStream as Ko}from"node:tty";import K from"node:path";import tl from"child_process";import ce from"path";import dn from"fs";import{setTimeout as Yo,scheduler as Ho,setImmediate as nl}from"node:timers/promises";import{constants as De}from"node:os";import{once as z,addAbortListener as Zo,EventEmitter as rl,on as ht,setMaxListeners as ol}from"node:events";import{serialize as il}from"node:v8";import{statSync as sl,readFileSync as fn,appendFileSync as al,writeFileSync as ul,createWriteStream as Jo,createReadStream as Xo}from"node:fs";import{Transform as cl,getDefaultHighWaterMark as pt,Duplex as hn,Writable as pn,Readable as me,PassThrough as Qo}from"node:stream";import{Buffer as Dn}from"node:buffer";import{finished as le}from"node:stream/promises";import*as Dt from"node:readline";import ll from"node:readline";import W from"fs/promises";import dl from"os";import{fileURLToPath as fl,pathToFileURL as hl}from"url";var pl=Object.defineProperty,L=o((e,t)=>pl(e,"name",{value:t,configurable:!0}),"c$1");const Dl="known-flag",ml="unknown-flag",gl="argument",Fl=/\B([A-Z])/g,wl=L(e=>e.replaceAll(Fl,"-$1").toLowerCase(),"camelToKebab"),{hasOwnProperty:yl}=Object.prototype,Ie=L((e,t)=>yl.call(e,t),"hasOwn"),mn=L(e=>typeof e=="function"?[e,!1]:Array.isArray(e)?[e[0],!0]:mn(e.type),"parseFlagType"),ei=L((e,t)=>e===Boolean?t!=="false":t,"normalizeBoolean"),ti=L((e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),"applyParser"),El=/[\s.:=]/,bl=L(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(El);if(n)throw new Error(`${t} cannot contain "${n?.[0]}"`)},"validateFlagName"),gn=L((e,t,n)=>{if(Ie(e,t))throw new Error(`Duplicate flags named "${t}"`);e[t]=n},"setFlag"),Cl=L(e=>{const t={};for(const n in e){if(!Ie(e,n))continue;bl(n);const r=e[n],i=[[],...mn(r),r];gn(t,n,i);const s=wl(n);if(n!==s&&gn(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`);gn(t,a,i)}}return t},"createRegistry"),Sl=L((e,t)=>{const n={};for(const r in e){if(!Ie(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"),mt="--",vl=3,$l=/^-{1,2}\w/,ni=L(e=>{if(!$l.test(e))return;const t=!e.startsWith(mt);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"),ri=L((e,{onFlag:t,onArgument:n})=>{let r;const i=L((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===mt){i();const c=e.slice(s+1);n?.(c,[s],!0);break}const u=ni(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"),oi=L((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"),Al=L((e,t=process.argv.slice(2),{ignore:n,booleanNegation:r}={})=>{const i=[],s=Cl(e),a={},u=[];return u[mt]=[],ri(t,{onFlag(c,d,l){const f=l.length===vl,h=(f||c.length>1)&&Ie(s,c);let D;if(!h&&r&&!f&&c.length>3&&c.startsWith("no-")){const p=c.slice(3);Ie(s,p)&&s[p][1]===Boolean&&(D=p)}if(!n?.(h||D?Dl:ml,c,d)){if(h){const[p,m]=s[c],g=ei(m,d),F=L((w,E)=>{i.push(l),E&&i.push(E),p.push(ti(m,w||""))},"getFollowingValue");return g===void 0?F:F(g)}if(D){s[D][0].push(!1),i.push(l);return}Ie(a,c)||(a[c]=[]),a[c].push(d===void 0?!0:d),i.push(l)}},onArgument:L((c,d,l)=>{n?.(gl,t[d[0]])||(u.push(...c),l?(u[mt]=c,t.splice(d[0])):i.push(d))},"onArgument")}),oi(t,i),{flags:Sl(e,s),unknownFlags:a,_:u}},"typeFlag");L((e,t,n=process.argv.slice(2))=>{const r=new Set(e.split(",").map(c=>ni(c)?.[0])),[i,s]=mn(t),a=[],u=[];return ri(n,{onFlag:L((c,d,l)=>{if(!r.has(c)||!s&&a.length>0)return;const f=ei(i,d),h=L((D,p)=>{u.push(l),p&&u.push(p),a.push(ti(i,D||""))},"getFollowingValue");return f===void 0?h:h(f)},"onFlag")}),oi(n,u),s?a:a[0]},"getFlag");var Bl=Object.defineProperty,A=o((e,t)=>Bl(e,"name",{value:t,configurable:!0}),"n$1");const Tl=A(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 ii({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(ii,"j$1"),A(ii,"ansiRegex");const xl=ii();function Fn(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(xl,"")}o(Fn,"w"),A(Fn,"stripAnsi");function si(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(si,"P$2"),A(si,"isAmbiguous");function ai(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}o(ai,"z$3"),A(ai,"isFullWidth");function ui(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(ui,"G$2"),A(ui,"isWide");function ci(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}o(ci,"Z$2"),A(ci,"validate");function li(e,{ambiguousAsWide:t=!1}={}){return ci(e),ai(e)||ui(e)||t&&si(e)?2:1}o(li,"V$2"),A(li,"eastAsianWidth");var Ol=A(()=>/[#*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 Il=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=Fn(e)),e.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:a}of Il.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(Ol().test(a)){i+=2;continue}i+=li(u,s)}}return i}o(de,"d"),A(de,"stringWidth");const di=A(e=>Math.max(...e.split(`
|
|
2
2
|
`).map(t=>de(t))),"getLongestLineWidth"),Rl=A(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=di(n[s]);a>t[s]&&(t[s]=a)}}return t},"getColumnContentWidths"),fi=/^\d+%$/,hi={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},_l=A((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"&&fi.test(i)){n.push({...hi,width:i,contentWidth:e[r]});continue}if(i&&typeof i=="object"){const s={...hi,...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"),Pl=A((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"&&fi.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"),pi=A(()=>Object.assign([],{columns:0}),"makeRow"),Ll=A((e,t)=>{const n=[pi()];let[r]=n;for(const i of e){const s=i.width+i.horizontalPadding;r.columns+s>t&&(r=pi(),n.push(r)),r.push(i),r.columns+=s}for(const i of n){const s=i.reduce((h,D)=>h+D.width+D.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,D)=>h+D.autoOverflow,0),l=Math.min(d,a);for(const h of c){const D=Math.floor(h.autoOverflow/d*l);h.width+=D,a-=D}const f=Math.floor(a/u.length);for(let h=0;h<u.length;h+=1){const D=u[h];h===u.length-1?D.width+=a:D.width+=f,a-=f}}return n},"balanceAuto"),kl=A((e,t,n)=>{const r=_l(n,t);return Pl(r,e),Ll(r,e)},"computeColumnWidths"),wn=10,Di=A((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),mi=A((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"wrapAnsi256"),gi=A((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 Nl=Object.keys(M.color),jl=Object.keys(M.bgColor);[...Nl,...jl];function Fi(){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=Di(),M.color.ansi256=mi(),M.color.ansi16m=gi(),M.bgColor.ansi=Di(wn),M.bgColor.ansi256=mi(wn),M.bgColor.ansi16m=gi(wn),Object.defineProperties(M,{rgbToAnsi256:{value:A((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:A(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:A(t=>M.rgbToAnsi256(...M.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value:A(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:A((t,n,r)=>M.ansi256ToAnsi(M.rgbToAnsi256(t,n,r)),"value"),enumerable:!1},hexToAnsi:{value:A(t=>M.ansi256ToAnsi(M.hexToAnsi256(t)),"value"),enumerable:!1}}),M}o(Fi,"FD"),A(Fi,"assembleStyles");const Ul=Fi(),gt=new Set(["\x1B","\x9B"]),Wl=39,yn="\x07",wi="[",Gl="]",yi="m",Ft=`${Gl}8;;`,Ei=A(e=>`${gt.values().next().value}${wi}${e}${yi}`,"wrapAnsiCode"),bi=A(e=>`${gt.values().next().value}${Ft}${e}${yn}`,"wrapAnsiHyperlink"),zl=A(e=>e.split(" ").map(t=>de(t)),"wordLengths"),En=A((e,t,n)=>{const r=[...t];let i=!1,s=!1,a=de(Fn(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),gt.has(c)&&(i=!0,s=r.slice(u+1,u+1+Ft.length).join("")===Ft),i){s?c===yn&&(i=!1,s=!1):c===yi&&(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"),Vl=A(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"),ql=A((e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",i,s;const a=zl(e);let u=[""];for(const[f,h]of e.split(" ").entries()){n.trim!==!1&&(u[u.length-1]=u.at(-1).trimStart());let D=de(u.at(-1));if(f!==0&&(D>=t&&(n.wordWrap===!1||n.trim===!1)&&(u.push(""),D=0),(D>0||n.trim===!1)&&(u[u.length-1]+=" ",D++)),n.hard&&a[f]>t){const p=t-D,m=1+Math.floor((a[f]-p-1)/t);Math.floor((a[f]-1)/t)<m&&u.push(""),En(u,h,t);continue}if(D+a[f]>t&&D>0&&a[f]>0){if(n.wordWrap===!1&&D<t){En(u,h,t);continue}u.push("")}if(D+a[f]>t&&n.wordWrap===!1){En(u,h,t);continue}u[u.length-1]+=h}n.trim!==!1&&(u=u.map(f=>Vl(f)));const c=u.join(`
|
|
3
3
|
`),d=[...c];let l=0;for(const[f,h]of d.entries()){if(r+=h,gt.has(h)){const{groups:p}=new RegExp(`(?:\\${wi}(?<code>\\d+)m|\\${Ft}(?<uri>.*)${yn})`).exec(c.slice(l))||{groups:{}};if(p.code!==void 0){const m=Number.parseFloat(p.code);i=m===Wl?void 0:m}else p.uri!==void 0&&(s=p.uri.length===0?void 0:p.uri)}const D=Ul.codes.get(Number(i));d[f+1]===`
|
|
4
4
|
`?(s&&(r+=bi("")),i&&D&&(r+=Ei(D))):h===`
|
|
@@ -15,11 +15,11 @@ var zc=Object.defineProperty;var o=(e,t)=>zc(e,"name",{value:t,configurable:!0})
|
|
|
15
15
|
`}}o(xi,"Z$1"),T(xi,"getDescription");function Oi(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=[Bi(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(`
|
|
17
17
|
`)}}}}o(Oi,"G$1"),T(Oi,"getUsage");function Ii(e){return!("commands"in e)||!e.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:e.commands.map(t=>{const{help:n}=t.options;return[t.options.name,typeof n=="object"&&n.description||""]}),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}o(Ii,"Q$1"),T(Ii,"getCommands");function Mi(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:$i(e.flags),indentBody:0}}}o(Mi,"X$2"),T(Mi,"getFlags");function Ri(e){const{help:t}=e;if(!t||!t.examples||t.examples.length===0)return;let{examples:n}=t;if(Array.isArray(n)&&(n=n.join(`
|
|
18
|
-
`)),n)return{id:"examples",type:"section",data:{title:"Examples:",body:n}}}o(Ri,"Y"),T(Ri,"getExamples");function _i(e){if(!("alias"in e)||!e.alias)return;const{alias:t}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(t)?t.join(", "):t}}}o(_i,"ee$1"),T(_i,"getAliases");const id=T(e=>[Ti,xi,Oi,Ii,Mi,Ri,_i].map(t=>t(e)).filter(Boolean),"generateHelp"),sd=Vc.WriteStream.prototype.hasColors(),Pi=(
|
|
18
|
+
`)),n)return{id:"examples",type:"section",data:{title:"Examples:",body:n}}}o(Ri,"Y"),T(Ri,"getExamples");function _i(e){if(!("alias"in e)||!e.alias)return;const{alias:t}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(t)?t.join(", "):t}}}o(_i,"ee$1"),T(_i,"getAliases");const id=T(e=>[Ti,xi,Oi,Ii,Mi,Ri,_i].map(t=>t(e)).filter(Boolean),"generateHelp"),sd=Vc.WriteStream.prototype.hasColors(),Pi=(Ge=class{text(t){return t}bold(t){return sd?`\x1B[1m${t}\x1B[22m`:t.toLocaleUpperCase()}indentText({text:t,spaces:n}){return t.replaceAll(/^/gm," ".repeat(n))}heading(t){return this.bold(t)}section({title:t,body:n,indentBody:r=2}){return`${(t?`${this.heading(t)}
|
|
19
19
|
`:"")+(n?this.indentText({text:this.render(n),spaces:r}):"")}
|
|
20
20
|
`}table({tableData:t,tableOptions:n,tableBreakpoints:r}){return Yl(t.map(i=>i.map(s=>this.render(s))),r?Jl(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
|
-
`);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(
|
|
22
|
-
`),r(),process.exit(1);e[c]=d}}o(Sn,"S$1"),T(Sn,"mapParametersToArguments");function Li(e){return e!==!1}o(Li,"se"),T(Li,"helpEnabled");const cd=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"),ld=T((e,t)=>{if(e.length<3||t.length===0)return;const n=td(e,t);return vi(e,n)<=2?n:void 0},"findClosestFlag"),dd=T((e,t)=>{const n=Object.keys(e);if(n.length!==0){for(const r of n){const i=ld(r,t),s=i?` (Did you mean --${i}?)`:"";console.error(`Error: Unknown flag: --${r}.${s}`)}process.exit(1)}},"handleUnknownFlags");function vn(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=Li(a);u&&!("help"in i)&&(i.help={type:Boolean,alias:"h",description:"Show help"});const c=Al(i,r,{ignore:t.ignoreArgv}),d=T(()=>{console.log(t.version)},"showVersion");if(s&&c.flags.version===!0)return d(),process.exit(0);const l=new ad,f=u&&a?.render?a.render:m=>l.render(m),h=T(m=>{const g=id({...t,...m?{help:m}:{},flags:i});console.log(f(g,l))},"showHelp");if(u&&c.flags.help===!0)return h(),process.exit(0);if((t.strictFlags??t.parent?.strictFlags)&&dd(c.unknownFlags,cd(i)),t.parameters){let{parameters:m}=t,g=c._;const F=m.indexOf("--"),w=m.slice(F+1),E=Object.create(null);let y=[];F>-1&&w.length>0&&(m=m.slice(0,F),y=c._["--"],g=g.slice(0,-y.length||void 0)),Sn(E,Cn(m),g,h),F>-1&&w.length>0&&Sn(E,Cn(w),y,h),Object.assign(c._,E)}const D={...c,showVersion:d,showHelp:h},p={command:e,...D};if(typeof n=="function"){const m=n(D);if(m&&"then"in m)return Object.assign(Promise.resolve(m),p)}return p}o(vn,"I$1"),T(vn,"cliBase");function ki(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: ${Q(a)}`);n.set(a,r)}}return n.get(e)}o(ki,"ce$1"),T(ki,"getCommand");function Ni(e,t,n=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!bn(e.name)))throw new Error(`Invalid script name: ${Q(e.name)}`);const r=n[0];if(e.commands&&r&&bn(r)){const i=ki(r,e.commands);if(i)return vn(i.options.name,{...i.options,parent:e},i.callback,n.slice(1))}return vn(void 0,e,t,n)}o(Ni,"fe"),T(Ni,"cli");function $n(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(!bn(n))throw new Error(`Invalid command name ${JSON.stringify(n)}. Command names must be one word.`);return{options:e,callback:t}}o($n,"de$1"),T($n,"command");var fd="2.
|
|
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(Ge,"_ne"),Ge);T(Pi,"Renderers");let ad=Pi;const bn=T(e=>e.length>0&&!e.includes(" "),"isValidScriptName"),{stringify:Q}=JSON,ud=/[|\\{}()[\]^$+*?.]/;function Cn(e){const t=[];let n,r;for(const i of e){if(r)throw new Error(`Invalid parameter: Spread parameter ${Q(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 ${Q(i)} cannot come after optional parameter ${Q(n)}`);if(s==="["&&a==="]"&&(u=!1,n=i),u===void 0)throw new Error(`Invalid parameter: ${Q(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(ud);if(l)throw new Error(`Invalid parameter: ${Q(i)}. Invalid character found ${Q(l[0])}`);t.push({name:c,required:u,spread:d})}return t}o(Cn,"P$1"),T(Cn,"parseParameters");function Sn(e,t,n,r){for(let i=0;i<t.length;i+=1){const{name:s,required:a,spread:u}=t[i],c=nd(s);if(c in e)throw new Error(`Invalid parameter: ${Q(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 ${Q(s)}
|
|
22
|
+
`),r(),process.exit(1);e[c]=d}}o(Sn,"S$1"),T(Sn,"mapParametersToArguments");function Li(e){return e!==!1}o(Li,"se"),T(Li,"helpEnabled");const cd=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"),ld=T((e,t)=>{if(e.length<3||t.length===0)return;const n=td(e,t);return vi(e,n)<=2?n:void 0},"findClosestFlag"),dd=T((e,t)=>{const n=Object.keys(e);if(n.length!==0){for(const r of n){const i=ld(r,t),s=i?` (Did you mean --${i}?)`:"";console.error(`Error: Unknown flag: --${r}.${s}`)}process.exit(1)}},"handleUnknownFlags");function vn(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=Li(a);u&&!("help"in i)&&(i.help={type:Boolean,alias:"h",description:"Show help"});const c=Al(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 ad,f=u&&a?.render?a.render:m=>l.render(m),h=T(m=>{const g=id({...t,...m?{help:m}:{},flags:i});console.log(f(g,l))},"showHelp");if(u&&c.flags.help===!0)return h(),process.exit(0);if((t.strictFlags??t.parent?.strictFlags)&&dd(c.unknownFlags,cd(i)),t.parameters){let{parameters:m}=t,g=c._;const F=m.indexOf("--"),w=m.slice(F+1),E=Object.create(null);let y=[];F>-1&&w.length>0&&(m=m.slice(0,F),y=c._["--"],g=g.slice(0,-y.length||void 0)),Sn(E,Cn(m),g,h),F>-1&&w.length>0&&Sn(E,Cn(w),y,h),Object.assign(c._,E)}const D={...c,showVersion:d,showHelp:h},p={command:e,...D};if(typeof n=="function"){const m=n(D);if(m&&"then"in m)return Object.assign(Promise.resolve(m),p)}return p}o(vn,"I$1"),T(vn,"cliBase");function ki(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: ${Q(a)}`);n.set(a,r)}}return n.get(e)}o(ki,"ce$1"),T(ki,"getCommand");function Ni(e,t,n=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!bn(e.name)))throw new Error(`Invalid script name: ${Q(e.name)}`);const r=n[0];if(e.commands&&r&&bn(r)){const i=ki(r,e.commands);if(i)return vn(i.options.name,{...i.options,parent:e},i.callback,n.slice(1))}return vn(void 0,e,t,n)}o(Ni,"fe"),T(Ni,"cli");function $n(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(!bn(n))throw new Error(`Invalid command name ${JSON.stringify(n)}. Command names must be one word.`);return{options:e,callback:t}}o($n,"de$1"),T($n,"command");var fd="2.44.1",hd="Writes your git commit messages for you with AI",An={version:fd,description:hd};function H(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(H,"isPlainObject");const Bn=o((e,t)=>{const n=Ui(pd(e));if(typeof n!="string")throw new TypeError(`${t} must be a string or a file URL: ${n}.`);return n},"safeNormalizeFileUrl"),pd=o(e=>ji(e)?e.toString():e,"normalizeDenoExecPath"),ji=o(e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,"isDenoExecPath"),Ui=o(e=>e instanceof URL?No(e):e,"normalizeFileUrl"),Wi=o((e,t=[],n={})=>{const r=Bn(e,"First argument"),[i,s]=H(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(!H(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,a,s]},"normalizeParameters"),{toString:Gi}=Object.prototype,Dd=o(e=>Gi.call(e)==="[object ArrayBuffer]","isArrayBuffer"),J=o(e=>Gi.call(e)==="[object Uint8Array]","isUint8Array"),Ve=o(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"bufferToUint8Array"),md=new TextEncoder,zi=o(e=>md.encode(e),"stringToUint8Array"),gd=new TextDecoder,Vi=o(e=>gd.decode(e),"uint8ArrayToString"),Fd=o((e,t)=>wd(e,t).join(""),"joinToString"),wd=o((e,t)=>{if(t==="utf8"&&e.every(s=>typeof s=="string"))return e;const n=new Uo(t),r=e.map(s=>typeof s=="string"?zi(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},"uint8ArraysToStrings"),Tn=o(e=>e.length===1&&J(e[0])?e[0]:qi(yd(e)),"joinToUint8Array"),yd=o(e=>e.map(t=>typeof t=="string"?zi(t):t),"stringsToUint8Arrays"),qi=o(e=>{const t=new Uint8Array(Ed(e));let n=0;for(const r of e)t.set(r,n),n+=r.length;return t},"concatUint8Arrays"),Ed=o(e=>{let t=0;for(const n of e)t+=n.length;return t},"getJoinLength"),bd=o(e=>Array.isArray(e)&&Array.isArray(e.raw),"isTemplateString"),Cd=o((e,t)=>{let n=[];for(const[s,a]of e.entries())n=Sd({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"),Sd=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}=vd(i,e.raw[r]),c=Yi(n,s,a);if(r===t.length)return c;const d=t[r],l=Array.isArray(d)?d.map(f=>Hi(f)):[Hi(d)];return Yi(c,l,u)},"parseTemplate"),vd=o((e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=Ki.has(t[0]);for(let a=0,u=0;a<e.length;a+=1,u+=1){const c=t[u];if(Ki.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+=$d[d]??1}}const s=r===e.length;return s||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},"splitByWhitespaces"),Ki=new Set([" "," ","\r",`
|
|
24
24
|
`]),$d={x:3,u:5},Yi=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"),Hi=o(e=>{const t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(H(e)&&("stdout"in e||"isMaxBuffer"in e))return Ad(e);throw e instanceof jo||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"),Ad=o(({stdout:e})=>{if(typeof e=="string")return e;if(J(e))return Vi(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"),ge=o(e=>xn.includes(e),"isStandardStream"),xn=[x.stdin,x.stdout,x.stderr],ee=["stdin","stdout","stderr"],Zi=o(e=>ee[e]??`stdio[${e}]`,"getStreamName"),Bd=o(e=>{const t={...e};for(const n of es)t[n]=Ji(e,n);return t},"normalizeFdSpecificOptions"),Ji=o((e,t)=>{const n=Array.from({length:Td(e)+1}),r=xd(e[t],n,t);return _d(r,t)},"normalizeFdSpecificOption"),Td=o(({stdio:e})=>Array.isArray(e)?Math.max(e.length,ee.length):ee.length,"getStdioLength"),xd=o((e,t,n)=>H(e)?Od(e,t,n):t.fill(e),"normalizeFdSpecificValue"),Od=o((e,t,n)=>{for(const r of Object.keys(e).sort(Id))for(const i of Md(r,n,t))t[i]=e[r];return t},"normalizeOptionObject"),Id=o((e,t)=>Xi(e)<Xi(t)?1:-1,"compareFdName"),Xi=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=Qi(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.
|
|
@@ -49,19 +49,19 @@ ${e.message}`,e}},"getDefaultCwd"),Fp=o((e,t)=>{if(t===Zs())return e;let n;try{n
|
|
|
49
49
|
${r.message}
|
|
50
50
|
${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
|
|
51
51
|
${e}`},"fixCwdError"),Js=o((e,t,n)=>{n.cwd=gp(n.cwd);const[r,i,s]=up(e,t,n),{command:a,args:u,options:c}=Pf._parse(r,i,s),d=Bd(c),l=wp(d);return op(l),pp(l),cp(l),hh(l),ep(l),l.shell=Ui(l.shell),l.env=yp(l),l.killSignal=eh(l.killSignal),l.forceKillAfterDelay=ah(l.forceKillAfterDelay),l.lines=l.lines.map((f,h)=>f&&!Ee.has(l.encoding)&&l.buffer[h]),x.platform==="win32"&&K.basename(a,".exe")==="cmd"&&u.unshift("/q"),{file:a,commandArguments:u,options:l}},"normalizeOptions"),wp=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:D=h!==void 0||f,serialization:p="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:D,serialization:p}),"addDefaultOptions"),yp=o(({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const a=t?{...x.env,...e}:e;return n||r?Uf({env:a,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):a},"getEnv"),Xs=o((e,t,n)=>n.shell&&t.length>0?[[e,...t].join(" "),[],n]:[e,t,n],"concatenateShell");function ur(e){if(typeof e=="string")return Ep(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return bp(e)}o(ur,"stripFinalNewline");const Ep=o(e=>e.at(-1)===Qs?e.slice(0,e.at(-2)===ea?-2:-1):e,"stripFinalNewlineString"),bp=o(e=>e.at(-1)===Cp?e.subarray(0,e.at(-2)===Sp?-2:-1):e,"stripFinalNewlineBinary"),Qs=`
|
|
52
|
-
`,Cp=Qs.codePointAt(0),ea="\r",Sp=ea.codePointAt(0);function be(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(be,"isStream");function ta(e,{checkOpen:t=!0}={}){return be(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(ta,"isWritableStream$1");function xt(e,{checkOpen:t=!0}={}){return be(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(xt,"isReadableStream$1");function na(e,t){return ta(e,t)&&xt(e,t)}o(na,"isDuplexStream");var ra=o(e=>{throw TypeError(e)},"__typeError$2"),cr=o((e,t,n)=>t.has(e)||ra("Cannot "+n),"__accessCheck$2"),V=o((e,t,n)=>(cr(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet$2"),Qe=o((e,t,n)=>t.has(e)?ra("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)=>(cr(e,t,"write to private field"),t.set(e,n),n),"__privateSet$2"),oa=o((e,t,n)=>(cr(e,t,"access private method"),n),"__privateMethod$1"),se,Ot,Ce,te,It,ia,sa;const vp=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),Bo=class Bo{constructor(t,n){Qe(this,It),Qe(this,se),Qe(this,Ot),Qe(this,Ce,!1),Qe(this,te),he(this,se,t),he(this,Ot,n)}next(){const t=o(()=>oa(this,It,ia).call(this),"e");return he(this,te,V(this,te)?V(this,te).then(t,t):t()),V(this,te)}return(t){const n=o(()=>oa(this,It,sa).call(this,t),"t");return V(this,te)?V(this,te).then(n,n):n()}};o(Bo,"c");let lr=Bo;se=new WeakMap,Ot=new WeakMap,Ce=new WeakMap,te=new WeakMap,It=new WeakSet,ia=o(async function(){if(V(this,Ce))return{done:!0,value:void 0};let e;try{e=await V(this,se).read()}catch(t){throw he(this,te,void 0),he(this,Ce,!0),V(this,se).releaseLock(),t}return e.done&&(he(this,te,void 0),he(this,Ce,!0),V(this,se).releaseLock()),e},"s_fn"),sa=o(async function(e){if(V(this,Ce))return{done:!0,value:e};if(he(this,Ce,!0),!V(this,Ot)){const t=V(this,se).cancel(e);return V(this,se).releaseLock(),await t,{done:!0,value:e}}return V(this,se).releaseLock(),{done:!0,value:e}},"i_fn");const dr=Symbol();function aa(){return this[dr].next()}o(aa,"i"),Object.defineProperty(aa,"name",{value:"next"});function ua(e){return this[dr].return(e)}o(ua,"o"),Object.defineProperty(ua,"name",{value:"return"});const $p=Object.create(vp,{next:{enumerable:!0,configurable:!0,writable:!0,value:aa},return:{enumerable:!0,configurable:!0,writable:!0,value:ua}});function Ap({preventCancel:e=!1}={}){const t=this.getReader(),n=new lr(t,e),r=Object.create($p);return r[dr]=n,r}o(Ap,"h$1");const Bp=o(e=>{if(xt(e,{checkOpen:!1})&&fr.on!==void 0)return xp(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(Tp.call(e)==="[object ReadableStream]")return Ap.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},"getAsyncIterable"),{toString:Tp}=Object.prototype,xp=o(async function*(e){const t=new AbortController,n={};Op(e,t,n);try{for await(const[r]of fr.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"),Op=o(async(e,t,n)=>{try{await fr.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{t.abort()}},"handleStreamEnd"),fr={};var Ip=Object.defineProperty,Mp=o((e,t,n)=>t in e?Ip(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$2"),Rp=o((e,t,n)=>Mp(e,t+"",n),"__publicField$2");const hr=o(async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,finalize:u},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const d=Bp(e),l=t();l.length=0;try{for await(const f of d){const h=Pp(f),D=n[h](f,l);ca({convertedChunk:D,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:c})}return _p({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"),_p=o(({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const a=i(e);a!==void 0&&ca({convertedChunk:a,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:s})},"appendFinalChunk"),ca=o(({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const a=n(e),u=t.length+a;if(u<=s){la(e,t,i,u);return}const c=r(e,s-t.length);throw c!==void 0&&la(c,t,i,s),new
|
|
52
|
+
`,Cp=Qs.codePointAt(0),ea="\r",Sp=ea.codePointAt(0);function be(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(be,"isStream");function ta(e,{checkOpen:t=!0}={}){return be(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(ta,"isWritableStream$1");function xt(e,{checkOpen:t=!0}={}){return be(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(xt,"isReadableStream$1");function na(e,t){return ta(e,t)&&xt(e,t)}o(na,"isDuplexStream");var ra=o(e=>{throw TypeError(e)},"__typeError$2"),cr=o((e,t,n)=>t.has(e)||ra("Cannot "+n),"__accessCheck$2"),V=o((e,t,n)=>(cr(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet$2"),Qe=o((e,t,n)=>t.has(e)?ra("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)=>(cr(e,t,"write to private field"),t.set(e,n),n),"__privateSet$2"),oa=o((e,t,n)=>(cr(e,t,"access private method"),n),"__privateMethod$1"),se,Ot,Ce,te,It,ia,sa;const vp=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),Bo=class Bo{constructor(t,n){Qe(this,It),Qe(this,se),Qe(this,Ot),Qe(this,Ce,!1),Qe(this,te),he(this,se,t),he(this,Ot,n)}next(){const t=o(()=>oa(this,It,ia).call(this),"e");return he(this,te,V(this,te)?V(this,te).then(t,t):t()),V(this,te)}return(t){const n=o(()=>oa(this,It,sa).call(this,t),"t");return V(this,te)?V(this,te).then(n,n):n()}};o(Bo,"c");let lr=Bo;se=new WeakMap,Ot=new WeakMap,Ce=new WeakMap,te=new WeakMap,It=new WeakSet,ia=o(async function(){if(V(this,Ce))return{done:!0,value:void 0};let e;try{e=await V(this,se).read()}catch(t){throw he(this,te,void 0),he(this,Ce,!0),V(this,se).releaseLock(),t}return e.done&&(he(this,te,void 0),he(this,Ce,!0),V(this,se).releaseLock()),e},"s_fn"),sa=o(async function(e){if(V(this,Ce))return{done:!0,value:e};if(he(this,Ce,!0),!V(this,Ot)){const t=V(this,se).cancel(e);return V(this,se).releaseLock(),await t,{done:!0,value:e}}return V(this,se).releaseLock(),{done:!0,value:e}},"i_fn");const dr=Symbol();function aa(){return this[dr].next()}o(aa,"i"),Object.defineProperty(aa,"name",{value:"next"});function ua(e){return this[dr].return(e)}o(ua,"o"),Object.defineProperty(ua,"name",{value:"return"});const $p=Object.create(vp,{next:{enumerable:!0,configurable:!0,writable:!0,value:aa},return:{enumerable:!0,configurable:!0,writable:!0,value:ua}});function Ap({preventCancel:e=!1}={}){const t=this.getReader(),n=new lr(t,e),r=Object.create($p);return r[dr]=n,r}o(Ap,"h$1");const Bp=o(e=>{if(xt(e,{checkOpen:!1})&&fr.on!==void 0)return xp(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(Tp.call(e)==="[object ReadableStream]")return Ap.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},"getAsyncIterable"),{toString:Tp}=Object.prototype,xp=o(async function*(e){const t=new AbortController,n={};Op(e,t,n);try{for await(const[r]of fr.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"),Op=o(async(e,t,n)=>{try{await fr.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{t.abort()}},"handleStreamEnd"),fr={};var Ip=Object.defineProperty,Mp=o((e,t,n)=>t in e?Ip(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$2"),Rp=o((e,t,n)=>Mp(e,t+"",n),"__publicField$2");const hr=o(async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,finalize:u},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const d=Bp(e),l=t();l.length=0;try{for await(const f of d){const h=Pp(f),D=n[h](f,l);ca({convertedChunk:D,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:c})}return _p({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"),_p=o(({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const a=i(e);a!==void 0&&ca({convertedChunk:a,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:s})},"appendFinalChunk"),ca=o(({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const a=n(e),u=t.length+a;if(u<=s){la(e,t,i,u);return}const c=r(e,s-t.length);throw c!==void 0&&la(c,t,i,s),new Me},"appendChunk"),la=o((e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},"addNewChunk"),Pp=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=da.call(e);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&da.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},"getChunkType"),{toString:da}=Object.prototype,To=class To extends Error{constructor(){super("maxBuffer exceeded"),Rp(this,"name","MaxBufferError")}};o(To,"MaxBufferError");let Me=To;const Se=o(e=>e,"identity"),pr=o(()=>{},"noop$1"),fa=o(({contents:e})=>e,"getContentsProperty"),ha=o(e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},"throwObjectStream"),pa=o(e=>e.length,"getLengthProperty");async function Lp(e,t){return hr(e,Up,t)}o(Lp,"getStreamAsArray");const kp=o(()=>({contents:[]}),"initArray"),Np=o(()=>1,"increment"),jp=o((e,{contents:t})=>(t.push(e),t),"addArrayChunk"),Up={init:kp,convertChunk:{string:Se,buffer:Se,arrayBuffer:Se,dataView:Se,typedArray:Se,others:Se},getSize:Np,truncateChunk:pr,addChunk:jp,getFinalChunk:pr,finalize:fa};async function Wp(e,t){return hr(e,Jp,t)}o(Wp,"getStreamAsArrayBuffer");const Gp=o(()=>({contents:new ArrayBuffer(0)}),"initArrayBuffer"),zp=o(e=>Vp.encode(e),"useTextEncoder"),Vp=new TextEncoder,Da=o(e=>new Uint8Array(e),"useUint8Array"),ma=o(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"useUint8ArrayWithOffset"),qp=o((e,t)=>e.slice(0,t),"truncateArrayBufferChunk"),Kp=o((e,{contents:t,length:n},r)=>{const i=wa()?Hp(t,r):Yp(t,r);return new Uint8Array(i).set(e,n),i},"addArrayBufferChunk"),Yp=o((e,t)=>{if(t<=e.byteLength)return e;const n=new ArrayBuffer(ga(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},"resizeArrayBufferSlow"),Hp=o((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;const n=new ArrayBuffer(t,{maxByteLength:ga(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},"resizeArrayBuffer"),ga=o(e=>Fa**Math.ceil(Math.log(e)/Math.log(Fa)),"getNewContentsLength"),Fa=2,Zp=o(({contents:e,length:t})=>wa()?e:e.slice(0,t),"finalizeArrayBuffer"),wa=o(()=>"resize"in ArrayBuffer.prototype,"hasArrayBufferResize"),Jp={init:Gp,convertChunk:{string:zp,buffer:Da,arrayBuffer:Da,dataView:ma,typedArray:ma,others:ha},getSize:pa,truncateChunk:qp,addChunk:Kp,getFinalChunk:pr,finalize:Zp};async function Xp(e,t){return hr(e,rD,t)}o(Xp,"getStreamAsString");const Qp=o(()=>({contents:"",textDecoder:new TextDecoder}),"initString"),Mt=o((e,{textDecoder:t})=>t.decode(e,{stream:!0}),"useTextDecoder"),eD=o((e,{contents:t})=>t+e,"addStringChunk"),tD=o((e,t)=>e.slice(0,t),"truncateStringChunk"),nD=o(({textDecoder:e})=>{const t=e.decode();return t===""?void 0:t},"getFinalStringChunk"),rD={init:Qp,convertChunk:{string:Se,buffer:Mt,arrayBuffer:Mt,dataView:Mt,typedArray:Mt,others:ha},getSize:pa,truncateChunk:tD,addChunk:eD,getFinalChunk:nD,finalize:fa},oD=o(({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(e instanceof Me))throw e;if(s==="all")return e;const a=iD(n,r,i);throw e.maxBufferInfo={fdNumber:s,unit:a},t.destroy(),e},"handleMaxBuffer"),iD=o((e,t,n)=>e?"objects":t?"lines":n==="buffer"?"bytes":"characters","getMaxBufferUnit"),sD=o((e,t,n)=>{if(t.length!==n)return;const r=new Me;throw r.maxBufferInfo={fdNumber:"ipc"},r},"checkIpcMaxBuffer"),aD=o((e,t)=>{const{streamName:n,threshold:r,unit:i}=uD(e,t);return`Command's ${n} was larger than ${r} ${i}`},"getMaxBufferMessage"),uD=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=qe(t,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:Zi(n),threshold:i,unit:r}},"getMaxBufferInfo"),cD=o((e,t,n)=>e?.code==="ENOBUFS"&&t!==null&&t.some(r=>r!==null&&r.length>Dr(n)),"isMaxBufferSync"),lD=o((e,t,n)=>{if(!t)return e;const r=Dr(n);return e.length>r?e.slice(0,r):e},"truncateMaxBufferSync"),Dr=o(([,e])=>e,"getMaxBufferSync"),dD=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:D,killSignal:p,maxBuffer:m,timeout:g,cwd:F})=>{const w=r?.code,E=fD({originalError:r,timedOut:c,timeout:g,isMaxBuffer:f,maxBuffer:m,errorCode:w,signal:i,signalDescription:s,exitCode:a,isCanceled:d,isGracefullyCanceled:l,isForcefullyTerminated:h,forceKillAfterDelay:D,killSignal:p}),y=pD(r,F),b=y===void 0?"":`
|
|
53
53
|
${y}`,v=`${E}: ${u}${b}`,C=t===void 0?[e[2],e[1]]:[t],S=[v,...C,...e.slice(3),n.map(O=>DD(O)).join(`
|
|
54
54
|
`)].map(O=>Pn(ur(mD(O)))).filter(Boolean).join(`
|
|
55
55
|
|
|
56
56
|
`);return{originalMessage:y,shortMessage:v,message:S}},"createMessages"),fD=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:D})=>{const p=hD(f,h);return t?`Command timed out after ${n} milliseconds${p}`:l?a===void 0?`Command was gracefully canceled with exit code ${c}`:f?`Command was gracefully canceled${p}`:`Command was gracefully canceled with ${a} (${u})`:d?`Command was canceled${p}`:r?`${aD(e,i)}${p}`:s!==void 0?`Command failed with ${s}${p}`:f?`Command was killed with ${D} (${Os(D)})${p}`:a!==void 0?`Command was killed with ${a} (${u})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},"getErrorPrefix"),hD=o((e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"","getForcefulSuffix"),pD=o((e,t)=>{if(e instanceof we)return;const n=Gf(e)?e.originalMessage:String(e?.message??e),r=Pn(Fp(n,t));return r===""?void 0:r},"getOriginalMessage"),DD=o(e=>typeof e=="string"?e:Wo(e),"serializeIpcMessage"),mD=o(e=>Array.isArray(e)?e.map(t=>ur(ya(t))).filter(Boolean).join(`
|
|
57
|
-
`):ya(e),"serializeMessagePart"),ya=o(e=>typeof e=="string"?e:J(e)?Vi(e):"","serializeMessageItem"),Ea=o(({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:a})=>ba({command:e,escapedCommand:t,cwd:s,durationMs:as(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"),mr=o(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:a})=>gr({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"),gr=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:g,killSignal:F,cwd:w,maxBuffer:E},isSync:y})=>{const{exitCode:b,signal:v,signalDescription:C}=FD(d,l),{originalMessage:S,shortMessage:O,message:G}=dD({stdio:f,all:h,ipcOutput:D,originalError:e,signal:v,signalDescription:C,exitCode:b,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:F,maxBuffer:E,timeout:m,cwd:w}),N=Wf(e,G,y);return Object.assign(N,gD({error:N,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:b,signal:v,signalDescription:C,stdio:f,all:h,ipcOutput:D,cwd:w,originalMessage:S,shortMessage:O})),N},"makeError"),gD=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:g,shortMessage:F})=>ba({shortMessage:F,originalMessage:g,command:t,escapedCommand:n,cwd:m,durationMs:as(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"),ba=o(e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),"omitUndefinedProperties"),FD=o((e,t)=>{const n=e===null?void 0:e,r=t===null?void 0:t,i=r===void 0?void 0:Os(t);return{exitCode:n,signal:r,signalDescription:i}},"normalizeExitPayload"),Ca=o(e=>Number.isFinite(e)?e:0,"toZeroIfInfinity");function wD(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(Ca(e*1e3)%1e3),nanoseconds:Math.trunc(Ca(e*1e6)%1e3)}}o(wD,"parseNumber");function yD(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(yD,"parseBigint");function ED(e){switch(typeof e){case"number":{if(Number.isFinite(e))return wD(e);break}case"bigint":return yD(e)}throw new TypeError("Expected a finite number or bigint")}o(ED,"parseMilliseconds");const bD=o(e=>e===0||e===0n,"isZero"),CD=o((e,t)=>t===1||t===1n?e:`${e}s`,"pluralize"),SD=1e-7,vD=24n*60n*60n*1000n;function $D(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+SD);return(Math.round(h)/10**f).toFixed(f)},"floorDecimals"),a=o((l,f,h,D)=>{if(!((i.length===0||!t.colonNotation)&&bD(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?" "+CD(f,l):h;i.push(D)}},"add"),u=ED(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,g=p>=1?Math.round(p):Math.ceil(p),F=m?p.toFixed(m):g;a(Number.parseFloat(F),"millisecond","ms",F)}}else{const l=(n?Number(e%vD):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($D,"prettyMilliseconds");const AD=o((e,t)=>{e.failed&&Ke({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})},"logError"),BD=o((e,t)=>{On(t)&&(AD(e,t),TD(e,t))},"logResult"),TD=o((e,t)=>{const n=`(done in ${$D(e.durationMs)})`;Ke({type:"duration",verboseMessage:n,verboseInfo:t,result:e})},"logDuration"),Fr=o((e,t,{reject:n})=>{if(BD(e,t),e.failed&&n)throw e;return e},"handleResult"),xD=o((e,t)=>Me(e)?"asyncGenerator":Ba(e)?"generator":yr(e)?"fileUrl":PD(e)?"filePath":jD(e)?"webStream":be(e,{checkOpen:!1})?"native":J(e)?"uint8Array":UD(e)?"asyncIterable":WD(e)?"iterable":br(e)?Sa({},t):RD(e)?OD(e,t):"native","getStdioItemType"),OD=o((e,t)=>na(e.transform,{checkOpen:!1})?ID(e,t):br(e.transform)?Sa(e,t):MD(e,t),"getTransformObjectType"),ID=o((e,t)=>(va(e,t,"Duplex stream"),"duplex"),"getDuplexType"),Sa=o((e,t)=>(va(e,t,"web TransformStream"),"webTransform"),"getTransformStreamType"),va=o(({final:e,binary:t,objectMode:n},r,i)=>{$a(e,`${r}.final`,i),$a(t,`${r}.binary`,i),wr(n,`${r}.objectMode`)},"validateNonGeneratorType"),$a=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"),MD=o(({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!Aa(e))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(na(t,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(br(t))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Aa(t))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return wr(n,`${i}.binary`),wr(r,`${i}.objectMode`),Me(e)||Me(t)?"asyncGenerator":"generator"},"getGeneratorObjectType"),wr=o((e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},"checkBooleanOption"),Aa=o(e=>Me(e)||Ba(e),"isGenerator"),Me=o(e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]","isAsyncGenerator"),Ba=o(e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]","isSyncGenerator"),RD=o(e=>H(e)&&(e.transform!==void 0||e.final!==void 0),"isTransformOptions"),yr=o(e=>Object.prototype.toString.call(e)==="[object URL]","isUrl"),_D=o(e=>yr(e)&&e.protocol!=="file:","isRegularUrl"),PD=o(e=>H(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>LD.has(t))&&Ta(e.file),"isFilePathObject"),LD=new Set(["file","append"]),Ta=o(e=>typeof e=="string","isFilePathString"),kD=o((e,t)=>e==="native"&&typeof t=="string"&&!ND.has(t),"isUnknownStdioString"),ND=new Set(["ipc","ignore","inherit","overlapped","pipe"]),xa=o(e=>Object.prototype.toString.call(e)==="[object ReadableStream]","isReadableStream"),Er=o(e=>Object.prototype.toString.call(e)==="[object WritableStream]","isWritableStream"),jD=o(e=>xa(e)||Er(e),"isWebStream"),br=o(e=>xa(e?.readable)&&Er(e?.writable),"isTransformStream"),UD=o(e=>Oa(e)&&typeof e[Symbol.asyncIterator]=="function","isAsyncIterableObject"),WD=o(e=>Oa(e)&&typeof e[Symbol.iterator]=="function","isIterableObject"),Oa=o(e=>typeof e=="object"&&e!==null,"isObject"),ve=new Set(["generator","asyncGenerator","duplex","webTransform"]),Ia=new Set(["fileUrl","filePath","fileNumber"]),Ma=new Set(["fileUrl","filePath"]),GD=new Set([...Ma,"webStream","nodeStream"]),zD=new Set(["webTransform","duplex"]),Rt={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"},Ra=o((e,t,n,r)=>r==="output"?VD(e,t,n):qD(e,t,n),"getTransformObjectModes"),VD=o((e,t,n)=>{const r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},"getOutputObjectModes"),qD=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"),KD=o((e,t)=>{const n=e.findLast(({type:r})=>ve.has(r));return n===void 0?!1:t==="input"?n.value.writableObjectMode:n.value.readableObjectMode},"getFdObjectMode"),YD=o((e,t,n,r)=>[...e.filter(({type:i})=>!ve.has(i)),...HD(e,t,n,r)],"normalizeTransforms"),HD=o((e,t,n,{encoding:r})=>{const i=e.filter(({type:a})=>ve.has(a)),s=Array.from({length:i.length});for(const[a,u]of Object.entries(i))s[a]=ZD({stdioItem:u,index:Number(a),newTransforms:s,optionName:t,direction:n,encoding:r});return e2(s,n)},"getTransforms"),ZD=o(({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:s,encoding:a})=>t==="duplex"?JD({stdioItem:e,optionName:i}):t==="webTransform"?XD({stdioItem:e,index:n,newTransforms:r,direction:s}):QD({stdioItem:e,index:n,newTransforms:r,direction:s,encoding:a}),"normalizeTransform"),JD=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"),XD=o(({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:a}=H(t)?t:{transform:t},{writableObjectMode:u,readableObjectMode:c}=Ra(a,n,r,i);return{...e,value:{transform:s,writableObjectMode:u,readableObjectMode:c}}},"normalizeTransformStream"),QD=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}=H(t)?t:{transform:t},f=c||Ee.has(s),{writableObjectMode:h,readableObjectMode:D}=Ra(l,n,r,i);return{...e,value:{transform:a,final:u,binary:f,preserveNewlines:d,writableObjectMode:h,readableObjectMode:D}}},"normalizeGenerator"),e2=o((e,t)=>t==="input"?e.reverse():e,"sortTransforms"),t2=o((e,t,n)=>{const r=e.map(i=>n2(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)??i2},"getStreamDirection"),n2=o(({type:e,value:t},n)=>r2[n]??_a[e](t),"getStdioItemDirection"),r2=["input","output","output"],Re=o(()=>{},"anyDirection"),Cr=o(()=>"input","alwaysInput"),_a={generator:Re,asyncGenerator:Re,fileUrl:Re,filePath:Re,iterable:Cr,asyncIterable:Cr,uint8Array:Cr,webStream:o(e=>Er(e)?"output":"input","webStream"),nodeStream(e){return xt(e,{checkOpen:!1})?ta(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:Re,duplex:Re,native(e){const t=o2(e);if(t!==void 0)return t;if(be(e,{checkOpen:!1}))return _a.nodeStream(e)}},o2=o(e=>{if([0,x.stdin].includes(e))return"input";if([1,2,x.stdout,x.stderr].includes(e))return"output"},"getStandardStreamDirection"),i2="output",s2=o((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e,"normalizeIpcStdioArray"),a2=o(({stdio:e,ipc:t,buffer:n,...r},i,s)=>{const a=u2(e,r).map((u,c)=>Pa(u,c));return s?l2(a,n,i):s2(a,t)},"normalizeStdioOption"),u2=o((e,t)=>{if(e===void 0)return ee.map(r=>t[r]);if(c2(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"),c2=o(e=>ee.some(t=>e[t]!==void 0),"hasAlias"),Pa=o((e,t)=>Array.isArray(e)?e.map(n=>Pa(n,t)):e??(t>=ee.length?"ignore":"pipe"),"addDefaultValue"),l2=o((e,t,n)=>e.map((r,i)=>!t[i]&&i!==0&&!In(n,i)&&d2(r)?"ignore":r),"normalizeStdioSync"),d2=o(e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe"),"isOutputPipeOnly"),f2=o(({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||t!=="native"?e:s?h2({stdioItem:e,fdNumber:r,direction:i}):m2({stdioItem:e,fdNumber:r}),"handleNativeStream"),h2=o(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{const s=p2({value:t,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(be(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"),p2=o(({value:e,optionName:t,fdNumber:n,direction:r})=>{const i=D2(e,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:t};if(qo.isatty(i))throw new TypeError(`The \`${t}: ${tr(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Ve(fn(i)),optionName:t}}},"getTargetFd"),D2=o((e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;const n=xn.indexOf(e);if(n!==-1)return n},"getTargetFdNumber"),m2=o(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t==="inherit"?{type:"nodeStream",value:La(r,t,n),optionName:n}:typeof t=="number"?{type:"nodeStream",value:La(t,t,n),optionName:n}:be(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:n}:e,"handleNativeStreamAsync"),La=o((e,t,n)=>{const r=xn[e];if(r===void 0)throw new TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},"getStandardStream"),g2=o(({input:e,inputFile:t},n)=>n===0?[...F2(e),...y2(t)]:[],"handleInputOptions"),F2=o(e=>e===void 0?[]:[{type:w2(e),value:e,optionName:"input"}],"handleInputOption"),w2=o(e=>{if(xt(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(J(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},"getInputType"),y2=o(e=>e===void 0?[]:[{...E2(e),optionName:"inputFile"}],"handleInputFileOption"),E2=o(e=>{if(yr(e))return{type:"fileUrl",value:e};if(Ta(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},"getInputFileType"),b2=o(e=>e.filter((t,n)=>e.every((r,i)=>t.value!==r.value||n>=i||t.type==="generator"||t.type==="asyncGenerator")),"filterDuplicates"),C2=o(({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const a=S2(i,e);if(a.length!==0){if(s){v2({otherStdioItems:a,type:e,value:t,optionName:n,direction:r});return}if(GD.has(e))return ka({otherStdioItems:a,type:e,value:t,optionName:n,direction:r});zD.has(e)&&A2({otherStdioItems:a,type:e,value:t,optionName:n})}},"getDuplicateStream"),S2=o((e,t)=>e.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===t).map((i=>({...i,direction:n})))),"getOtherStdioItems"),v2=o(({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{Ma.has(t)&&ka({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},"validateDuplicateStreamSync"),ka=o(({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{const s=e.filter(u=>$2(u,n));if(s.length===0)return;const a=s.find(u=>u.direction!==i);return Na(a,r,t),i==="output"?s[0].stream:void 0},"getDuplicateStreamInstance"),$2=o(({type:e,value:t},n)=>e==="filePath"?t.file===n.file:e==="fileUrl"?t.href===n.href:t===n,"hasSameValue"),A2=o(({otherStdioItems:e,type:t,value:n,optionName:r})=>{const i=e.find(({value:{transform:s}})=>s===n.transform);Na(i,r,t)},"validateDuplicateTransform"),Na=o((e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Rt[n]} that is the same.`)},"throwOnDuplicateStream"),ja=o((e,t,n,r)=>{const s=a2(t,n,r).map((u,c)=>B2({stdioOption:u,fdNumber:c,options:t,isSync:r})),a=P2({initialFileDescriptors:s,addProperties:e,options:t,isSync:r});return t.stdio=a.map(({stdioItems:u})=>N2(u)),a},"handleStdio"),B2=o(({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{const i=Zi(t),{stdioItems:s,isStdioArray:a}=T2({stdioOption:e,fdNumber:t,options:n,optionName:i}),u=t2(s,t,i),c=s.map(f=>f2({stdioItem:f,isStdioArray:a,fdNumber:t,direction:u,isSync:r})),d=YD(c,i,u,n),l=KD(d,u);return _2(d,l),{direction:u,objectMode:l,stdioItems:d}},"getFileDescriptor"),T2=o(({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{const s=[...(Array.isArray(e)?e:[e]).map(c=>x2(c,r)),...g2(n,t)],a=b2(s),u=a.length>1;return O2(a,u,r),M2(a),{stdioItems:a,isStdioArray:u}},"initializeStdioItems"),x2=o((e,t)=>({type:xD(e,t),value:e,optionName:t}),"initializeStdioItem"),O2=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(I2.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},"validateStdioArray"),I2=new Set(["ignore","ipc"]),M2=o(e=>{for(const t of e)R2(t)},"validateStreams"),R2=o(({type:e,value:t,optionName:n})=>{if(_D(t))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
58
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(kD(e,t))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},"validateFileStdio"),_2=o((e,t)=>{if(!t)return;const n=e.find(({type:r})=>Ia.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},"validateFileObjectMode"),P2=o(({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{const i=[];try{for(const s of e)i.push(L2({fileDescriptor:s,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(s){throw Ua(i),s}},"getFinalFileDescriptors"),L2=o(({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:a})=>{const u=n.map(c=>k2({stdioItem:c,addProperties:i,direction:e,options:s,fileDescriptors:r,isSync:a}));return{direction:e,objectMode:t,stdioItems:u}},"getFinalFileDescriptor"),k2=o(({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const a=C2({stdioItem:e,direction:n,fileDescriptors:i,isSync:s});return a!==void 0?{...e,stream:a}:{...e,...t[n][e.type](e,r)}},"addStreamProperties"),Ua=o(e=>{for(const{stdioItems:t}of e)for(const{stream:n}of t)n!==void 0&&!ge(n)&&n.destroy()},"cleanupCustomStreams"),N2=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"),j2=o((e,t)=>ja(W2,e,t,!0),"handleStdioSync"),ne=o(({type:e,optionName:t})=>{Wa(t,Rt[e])},"forbiddenIfSync"),U2=o(({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&Wa(e,`"${t}"`),{}),"forbiddenNativeIfSync"),Wa=o((e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},"throwInvalidSyncValue"),Ga={generator(){},asyncGenerator:ne,webStream:ne,nodeStream:ne,webTransform:ne,duplex:ne,asyncIterable:ne,native:U2},W2={input:{...Ga,fileUrl:o(({value:e})=>({contents:[Ve(fn(e))]}),"fileUrl"),filePath:o(({value:{file:e}})=>({contents:[Ve(fn(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:{...Ga,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}},
|
|
57
|
+
`):ya(e),"serializeMessagePart"),ya=o(e=>typeof e=="string"?e:J(e)?Vi(e):"","serializeMessageItem"),Ea=o(({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:a})=>ba({command:e,escapedCommand:t,cwd:s,durationMs:as(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"),mr=o(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:a})=>gr({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"),gr=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:g,killSignal:F,cwd:w,maxBuffer:E},isSync:y})=>{const{exitCode:b,signal:v,signalDescription:C}=FD(d,l),{originalMessage:S,shortMessage:O,message:G}=dD({stdio:f,all:h,ipcOutput:D,originalError:e,signal:v,signalDescription:C,exitCode:b,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:F,maxBuffer:E,timeout:m,cwd:w}),N=Wf(e,G,y);return Object.assign(N,gD({error:N,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:b,signal:v,signalDescription:C,stdio:f,all:h,ipcOutput:D,cwd:w,originalMessage:S,shortMessage:O})),N},"makeError"),gD=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:g,shortMessage:F})=>ba({shortMessage:F,originalMessage:g,command:t,escapedCommand:n,cwd:m,durationMs:as(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"),ba=o(e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),"omitUndefinedProperties"),FD=o((e,t)=>{const n=e===null?void 0:e,r=t===null?void 0:t,i=r===void 0?void 0:Os(t);return{exitCode:n,signal:r,signalDescription:i}},"normalizeExitPayload"),Ca=o(e=>Number.isFinite(e)?e:0,"toZeroIfInfinity");function wD(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(Ca(e*1e3)%1e3),nanoseconds:Math.trunc(Ca(e*1e6)%1e3)}}o(wD,"parseNumber");function yD(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(yD,"parseBigint");function ED(e){switch(typeof e){case"number":{if(Number.isFinite(e))return wD(e);break}case"bigint":return yD(e)}throw new TypeError("Expected a finite number or bigint")}o(ED,"parseMilliseconds");const bD=o(e=>e===0||e===0n,"isZero"),CD=o((e,t)=>t===1||t===1n?e:`${e}s`,"pluralize"),SD=1e-7,vD=24n*60n*60n*1000n;function $D(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+SD);return(Math.round(h)/10**f).toFixed(f)},"floorDecimals"),a=o((l,f,h,D)=>{if(!((i.length===0||!t.colonNotation)&&bD(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?" "+CD(f,l):h;i.push(D)}},"add"),u=ED(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,g=p>=1?Math.round(p):Math.ceil(p),F=m?p.toFixed(m):g;a(Number.parseFloat(F),"millisecond","ms",F)}}else{const l=(n?Number(e%vD):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($D,"prettyMilliseconds");const AD=o((e,t)=>{e.failed&&Ke({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})},"logError"),BD=o((e,t)=>{On(t)&&(AD(e,t),TD(e,t))},"logResult"),TD=o((e,t)=>{const n=`(done in ${$D(e.durationMs)})`;Ke({type:"duration",verboseMessage:n,verboseInfo:t,result:e})},"logDuration"),Fr=o((e,t,{reject:n})=>{if(BD(e,t),e.failed&&n)throw e;return e},"handleResult"),xD=o((e,t)=>Re(e)?"asyncGenerator":Ba(e)?"generator":yr(e)?"fileUrl":PD(e)?"filePath":jD(e)?"webStream":be(e,{checkOpen:!1})?"native":J(e)?"uint8Array":UD(e)?"asyncIterable":WD(e)?"iterable":br(e)?Sa({},t):RD(e)?OD(e,t):"native","getStdioItemType"),OD=o((e,t)=>na(e.transform,{checkOpen:!1})?ID(e,t):br(e.transform)?Sa(e,t):MD(e,t),"getTransformObjectType"),ID=o((e,t)=>(va(e,t,"Duplex stream"),"duplex"),"getDuplexType"),Sa=o((e,t)=>(va(e,t,"web TransformStream"),"webTransform"),"getTransformStreamType"),va=o(({final:e,binary:t,objectMode:n},r,i)=>{$a(e,`${r}.final`,i),$a(t,`${r}.binary`,i),wr(n,`${r}.objectMode`)},"validateNonGeneratorType"),$a=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"),MD=o(({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!Aa(e))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(na(t,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(br(t))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Aa(t))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return wr(n,`${i}.binary`),wr(r,`${i}.objectMode`),Re(e)||Re(t)?"asyncGenerator":"generator"},"getGeneratorObjectType"),wr=o((e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},"checkBooleanOption"),Aa=o(e=>Re(e)||Ba(e),"isGenerator"),Re=o(e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]","isAsyncGenerator"),Ba=o(e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]","isSyncGenerator"),RD=o(e=>H(e)&&(e.transform!==void 0||e.final!==void 0),"isTransformOptions"),yr=o(e=>Object.prototype.toString.call(e)==="[object URL]","isUrl"),_D=o(e=>yr(e)&&e.protocol!=="file:","isRegularUrl"),PD=o(e=>H(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>LD.has(t))&&Ta(e.file),"isFilePathObject"),LD=new Set(["file","append"]),Ta=o(e=>typeof e=="string","isFilePathString"),kD=o((e,t)=>e==="native"&&typeof t=="string"&&!ND.has(t),"isUnknownStdioString"),ND=new Set(["ipc","ignore","inherit","overlapped","pipe"]),xa=o(e=>Object.prototype.toString.call(e)==="[object ReadableStream]","isReadableStream"),Er=o(e=>Object.prototype.toString.call(e)==="[object WritableStream]","isWritableStream"),jD=o(e=>xa(e)||Er(e),"isWebStream"),br=o(e=>xa(e?.readable)&&Er(e?.writable),"isTransformStream"),UD=o(e=>Oa(e)&&typeof e[Symbol.asyncIterator]=="function","isAsyncIterableObject"),WD=o(e=>Oa(e)&&typeof e[Symbol.iterator]=="function","isIterableObject"),Oa=o(e=>typeof e=="object"&&e!==null,"isObject"),ve=new Set(["generator","asyncGenerator","duplex","webTransform"]),Ia=new Set(["fileUrl","filePath","fileNumber"]),Ma=new Set(["fileUrl","filePath"]),GD=new Set([...Ma,"webStream","nodeStream"]),zD=new Set(["webTransform","duplex"]),Rt={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"},Ra=o((e,t,n,r)=>r==="output"?VD(e,t,n):qD(e,t,n),"getTransformObjectModes"),VD=o((e,t,n)=>{const r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},"getOutputObjectModes"),qD=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"),KD=o((e,t)=>{const n=e.findLast(({type:r})=>ve.has(r));return n===void 0?!1:t==="input"?n.value.writableObjectMode:n.value.readableObjectMode},"getFdObjectMode"),YD=o((e,t,n,r)=>[...e.filter(({type:i})=>!ve.has(i)),...HD(e,t,n,r)],"normalizeTransforms"),HD=o((e,t,n,{encoding:r})=>{const i=e.filter(({type:a})=>ve.has(a)),s=Array.from({length:i.length});for(const[a,u]of Object.entries(i))s[a]=ZD({stdioItem:u,index:Number(a),newTransforms:s,optionName:t,direction:n,encoding:r});return e2(s,n)},"getTransforms"),ZD=o(({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:s,encoding:a})=>t==="duplex"?JD({stdioItem:e,optionName:i}):t==="webTransform"?XD({stdioItem:e,index:n,newTransforms:r,direction:s}):QD({stdioItem:e,index:n,newTransforms:r,direction:s,encoding:a}),"normalizeTransform"),JD=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"),XD=o(({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:a}=H(t)?t:{transform:t},{writableObjectMode:u,readableObjectMode:c}=Ra(a,n,r,i);return{...e,value:{transform:s,writableObjectMode:u,readableObjectMode:c}}},"normalizeTransformStream"),QD=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}=H(t)?t:{transform:t},f=c||Ee.has(s),{writableObjectMode:h,readableObjectMode:D}=Ra(l,n,r,i);return{...e,value:{transform:a,final:u,binary:f,preserveNewlines:d,writableObjectMode:h,readableObjectMode:D}}},"normalizeGenerator"),e2=o((e,t)=>t==="input"?e.reverse():e,"sortTransforms"),t2=o((e,t,n)=>{const r=e.map(i=>n2(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)??i2},"getStreamDirection"),n2=o(({type:e,value:t},n)=>r2[n]??_a[e](t),"getStdioItemDirection"),r2=["input","output","output"],_e=o(()=>{},"anyDirection"),Cr=o(()=>"input","alwaysInput"),_a={generator:_e,asyncGenerator:_e,fileUrl:_e,filePath:_e,iterable:Cr,asyncIterable:Cr,uint8Array:Cr,webStream:o(e=>Er(e)?"output":"input","webStream"),nodeStream(e){return xt(e,{checkOpen:!1})?ta(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:_e,duplex:_e,native(e){const t=o2(e);if(t!==void 0)return t;if(be(e,{checkOpen:!1}))return _a.nodeStream(e)}},o2=o(e=>{if([0,x.stdin].includes(e))return"input";if([1,2,x.stdout,x.stderr].includes(e))return"output"},"getStandardStreamDirection"),i2="output",s2=o((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e,"normalizeIpcStdioArray"),a2=o(({stdio:e,ipc:t,buffer:n,...r},i,s)=>{const a=u2(e,r).map((u,c)=>Pa(u,c));return s?l2(a,n,i):s2(a,t)},"normalizeStdioOption"),u2=o((e,t)=>{if(e===void 0)return ee.map(r=>t[r]);if(c2(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"),c2=o(e=>ee.some(t=>e[t]!==void 0),"hasAlias"),Pa=o((e,t)=>Array.isArray(e)?e.map(n=>Pa(n,t)):e??(t>=ee.length?"ignore":"pipe"),"addDefaultValue"),l2=o((e,t,n)=>e.map((r,i)=>!t[i]&&i!==0&&!In(n,i)&&d2(r)?"ignore":r),"normalizeStdioSync"),d2=o(e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe"),"isOutputPipeOnly"),f2=o(({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||t!=="native"?e:s?h2({stdioItem:e,fdNumber:r,direction:i}):m2({stdioItem:e,fdNumber:r}),"handleNativeStream"),h2=o(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{const s=p2({value:t,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(be(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"),p2=o(({value:e,optionName:t,fdNumber:n,direction:r})=>{const i=D2(e,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:t};if(qo.isatty(i))throw new TypeError(`The \`${t}: ${tr(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Ve(fn(i)),optionName:t}}},"getTargetFd"),D2=o((e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;const n=xn.indexOf(e);if(n!==-1)return n},"getTargetFdNumber"),m2=o(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t==="inherit"?{type:"nodeStream",value:La(r,t,n),optionName:n}:typeof t=="number"?{type:"nodeStream",value:La(t,t,n),optionName:n}:be(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:n}:e,"handleNativeStreamAsync"),La=o((e,t,n)=>{const r=xn[e];if(r===void 0)throw new TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},"getStandardStream"),g2=o(({input:e,inputFile:t},n)=>n===0?[...F2(e),...y2(t)]:[],"handleInputOptions"),F2=o(e=>e===void 0?[]:[{type:w2(e),value:e,optionName:"input"}],"handleInputOption"),w2=o(e=>{if(xt(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(J(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},"getInputType"),y2=o(e=>e===void 0?[]:[{...E2(e),optionName:"inputFile"}],"handleInputFileOption"),E2=o(e=>{if(yr(e))return{type:"fileUrl",value:e};if(Ta(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},"getInputFileType"),b2=o(e=>e.filter((t,n)=>e.every((r,i)=>t.value!==r.value||n>=i||t.type==="generator"||t.type==="asyncGenerator")),"filterDuplicates"),C2=o(({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const a=S2(i,e);if(a.length!==0){if(s){v2({otherStdioItems:a,type:e,value:t,optionName:n,direction:r});return}if(GD.has(e))return ka({otherStdioItems:a,type:e,value:t,optionName:n,direction:r});zD.has(e)&&A2({otherStdioItems:a,type:e,value:t,optionName:n})}},"getDuplicateStream"),S2=o((e,t)=>e.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===t).map((i=>({...i,direction:n})))),"getOtherStdioItems"),v2=o(({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{Ma.has(t)&&ka({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},"validateDuplicateStreamSync"),ka=o(({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{const s=e.filter(u=>$2(u,n));if(s.length===0)return;const a=s.find(u=>u.direction!==i);return Na(a,r,t),i==="output"?s[0].stream:void 0},"getDuplicateStreamInstance"),$2=o(({type:e,value:t},n)=>e==="filePath"?t.file===n.file:e==="fileUrl"?t.href===n.href:t===n,"hasSameValue"),A2=o(({otherStdioItems:e,type:t,value:n,optionName:r})=>{const i=e.find(({value:{transform:s}})=>s===n.transform);Na(i,r,t)},"validateDuplicateTransform"),Na=o((e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Rt[n]} that is the same.`)},"throwOnDuplicateStream"),ja=o((e,t,n,r)=>{const s=a2(t,n,r).map((u,c)=>B2({stdioOption:u,fdNumber:c,options:t,isSync:r})),a=P2({initialFileDescriptors:s,addProperties:e,options:t,isSync:r});return t.stdio=a.map(({stdioItems:u})=>N2(u)),a},"handleStdio"),B2=o(({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{const i=Zi(t),{stdioItems:s,isStdioArray:a}=T2({stdioOption:e,fdNumber:t,options:n,optionName:i}),u=t2(s,t,i),c=s.map(f=>f2({stdioItem:f,isStdioArray:a,fdNumber:t,direction:u,isSync:r})),d=YD(c,i,u,n),l=KD(d,u);return _2(d,l),{direction:u,objectMode:l,stdioItems:d}},"getFileDescriptor"),T2=o(({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{const s=[...(Array.isArray(e)?e:[e]).map(c=>x2(c,r)),...g2(n,t)],a=b2(s),u=a.length>1;return O2(a,u,r),M2(a),{stdioItems:a,isStdioArray:u}},"initializeStdioItems"),x2=o((e,t)=>({type:xD(e,t),value:e,optionName:t}),"initializeStdioItem"),O2=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(I2.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},"validateStdioArray"),I2=new Set(["ignore","ipc"]),M2=o(e=>{for(const t of e)R2(t)},"validateStreams"),R2=o(({type:e,value:t,optionName:n})=>{if(_D(t))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
58
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(kD(e,t))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},"validateFileStdio"),_2=o((e,t)=>{if(!t)return;const n=e.find(({type:r})=>Ia.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},"validateFileObjectMode"),P2=o(({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{const i=[];try{for(const s of e)i.push(L2({fileDescriptor:s,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(s){throw Ua(i),s}},"getFinalFileDescriptors"),L2=o(({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:a})=>{const u=n.map(c=>k2({stdioItem:c,addProperties:i,direction:e,options:s,fileDescriptors:r,isSync:a}));return{direction:e,objectMode:t,stdioItems:u}},"getFinalFileDescriptor"),k2=o(({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const a=C2({stdioItem:e,direction:n,fileDescriptors:i,isSync:s});return a!==void 0?{...e,stream:a}:{...e,...t[n][e.type](e,r)}},"addStreamProperties"),Ua=o(e=>{for(const{stdioItems:t}of e)for(const{stream:n}of t)n!==void 0&&!ge(n)&&n.destroy()},"cleanupCustomStreams"),N2=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"),j2=o((e,t)=>ja(W2,e,t,!0),"handleStdioSync"),ne=o(({type:e,optionName:t})=>{Wa(t,Rt[e])},"forbiddenIfSync"),U2=o(({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&Wa(e,`"${t}"`),{}),"forbiddenNativeIfSync"),Wa=o((e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},"throwInvalidSyncValue"),Ga={generator(){},asyncGenerator:ne,webStream:ne,nodeStream:ne,webTransform:ne,duplex:ne,asyncIterable:ne,native:U2},W2={input:{...Ga,fileUrl:o(({value:e})=>({contents:[Ve(fn(e))]}),"fileUrl"),filePath:o(({value:{file:e}})=>({contents:[Ve(fn(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:{...Ga,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}},Pe=o((e,{stripFinalNewline:t},n)=>za(t,n)&&e!==void 0&&!Array.isArray(e)?ur(e):e,"stripNewline"),za=o((e,t)=>t==="all"?e[1]||e[2]:e[t],"getStripFinalNewline"),Va=o((e,t,n,r)=>e||n?void 0:Ya(t,r),"getSplitLinesGenerator"),qa=o((e,t,n)=>n?e.flatMap(r=>Ka(r,t)):Ka(e,t),"splitLinesSync"),Ka=o((e,t)=>{const{transform:n,final:r}=Ya(t,{});return[...n(e),...r()]},"splitLinesItemSync"),Ya=o((e,t)=>(t.previousChunks="",{transform:G2.bind(void 0,t,e),final:V2.bind(void 0,t)}),"initializeSplitLines"),G2=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=z2(n,s,t,e);let u=n.slice(i+1,s+1-a);r.length>0&&(u=Sr(r,u),r=""),yield u,i=s}i!==n.length-1&&(r=Sr(r,n.slice(i+1))),e.previousChunks=r},"splitGenerator"),z2=o((e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]==="\r",r.isWindowsNewline?2:1),"getNewlineLength"),V2=o(function*({previousChunks:e}){e.length>0&&(yield e)},"linesFinal"),q2=o(({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:K2.bind(void 0,r)},"getAppendNewlineGenerator"),K2=o(function*({isWindowsNewline:e=!1},t){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof t=="string"?Y2:Z2;if(t.at(-1)===i){yield t;return}yield s(t,e?r:n)},"appendNewlineGenerator"),Sr=o((e,t)=>`${e}${t}`,"concatString"),Y2={windowsNewline:`\r
|
|
60
60
|
`,unixNewline:`
|
|
61
61
|
`,LF:`
|
|
62
62
|
`,concatBytes:Sr},H2=o((e,t)=>{const n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},"concatUint8Array"),Z2={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:H2},J2=o((e,t)=>e?void 0:X2.bind(void 0,t),"getValidateTransformInput"),X2=o(function*(e,t){if(typeof t!="string"&&!J(t)&&!Dn.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},"validateStringTransformInput"),Q2=o((e,t)=>e?e0.bind(void 0,t):t0.bind(void 0,t),"getValidateTransformReturn"),e0=o(function*(e,t){Ha(e,t),yield t},"validateObjectTransformReturn"),t0=o(function*(e,t){if(Ha(e,t),typeof t!="string"&&!J(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},"validateStringTransformReturn"),Ha=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"),Za=o((e,t,n)=>{if(n)return;if(e)return{transform:n0.bind(void 0,new TextEncoder)};const r=new Uo(t);return{transform:r0.bind(void 0,r),final:o0.bind(void 0,r)}},"getEncodingTransformGenerator"),n0=o(function*(e,t){Dn.isBuffer(t)?yield Ve(t):typeof t=="string"?yield e.encode(t):yield t},"encodingUint8ArrayGenerator"),r0=o(function*(e,t){yield J(t)?e.write(t):t},"encodingStringGenerator"),o0=o(function*(e){const t=e.end();t!==""&&(yield t)},"encodingStringFinal"),Ja=Oe(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(const i of t.currentIterable)r.push(i)}finally{delete t.currentIterable}}),vr=o(async function*(e,t,n){if(n===t.length){yield e;return}const{transform:r=u0}=t[n];for await(const i of r(e))yield*vr(i,t,n+1)},"transformChunk"),i0=o(async function*(e){for(const[t,{final:n}]of Object.entries(e))yield*s0(n,Number(t),e)},"finalChunks"),s0=o(async function*(e,t,n){if(e!==void 0)for await(const r of e())yield*vr(r,n,t+1)},"generatorFinalChunks"),a0=Oe(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),u0=o(function*(e){yield e},"identityGenerator$1"),Xa=o((e,t,n,r)=>{try{for(const i of e(...t))n.push(i);r()}catch(i){r(i)}},"pushChunksSync"),c0=o((e,t)=>[...t.flatMap(n=>[...et(n,e,0)]),...$r(e)],"runTransformSync"),et=o(function*(e,t,n){if(n===t.length){yield e;return}const{transform:r=d0}=t[n];for(const i of r(e))yield*et(i,t,n+1)},"transformChunkSync"),$r=o(function*(e){for(const[t,{final:n}]of Object.entries(e))yield*l0(n,Number(t),e)},"finalChunksSync"),l0=o(function*(e,t,n){if(e!==void 0)for(const r of e())yield*et(r,n,t+1)},"generatorFinalChunksSync"),d0=o(function*(e){yield e},"identityGenerator"),Qa=o(({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:a})=>{const u={},c=tu(e,a,s),d=Me(t),l=Me(n),f=d?Ja.bind(void 0,vr,u):Xa.bind(void 0,et),h=d||l?Ja.bind(void 0,i0,u):Xa.bind(void 0,$r),D=d||l?a0.bind(void 0,u):void 0;return{stream:new cl({writableObjectMode:r,writableHighWaterMark:pt(r),readableObjectMode:i,readableHighWaterMark:pt(i),transform(m,g,F){f([m,c,0],this,F)},flush(m){h([c],this,m)},destroy:D})}},"generatorToStream"),eu=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=tu(a,n,u);e=c0(c,e)}return e},"runGeneratorsSync"),tu=o(({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},a,u)=>{const c={};return[{transform:J2(r,u)},Za(n,a,r),Va(n,s,r,c),{transform:e,final:t},{transform:Q2(i,u)},q2({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},"addInternalGenerators"),f0=o((e,t)=>{for(const n of h0(e))p0(e,n,t)},"addInputOptionsSync"),h0=o(e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),"getInputFdNumbers"),p0=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 ${Rt[u]} with synchronous methods.`)}const a=i.map(({contents:u})=>u).map(u=>D0(u,r));n.input=Tn(a)},"addInputOptionSync"),D0=o((e,t)=>{const n=eu(e,t,"utf8",!0);return m0(n),Tn(n)},"applySingleInputGeneratorsSync"),m0=o(e=>{const t=e.find(n=>typeof n!="string"&&!J(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"),nu=o(({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!=="all"&&In(n,r)&&!Ee.has(t)&&g0(r)&&(e.some(({type:i,value:s})=>i==="native"&&F0.has(s))||e.every(({type:i})=>ve.has(i))),"shouldLogOutput"),g0=o(e=>e===1||e===2,"fdUsesVerbose"),F0=new Set(["pipe","overlapped"]),w0=o(async(e,t,n,r)=>{for await(const i of e)E0(t)||ru(i,n,r)},"logLines"),y0=o((e,t,n)=>{for(const r of e)ru(r,t,n)},"logLinesSync"),E0=o(e=>e._readableState.pipes.length>0,"isPipingStream"),ru=o((e,t,n)=>{const r=is(e);Ke({type:"output",verboseMessage:r,fdNumber:t,verboseInfo:n})},"logLine"),b0=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)=>C0({result:c,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:r,verboseInfo:i},n)),...s}},"transformOutputSync"),C0=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=lD(e,s,f),D=Ve(h),{stdioItems:p,objectMode:m}=t[n],g=S0([D],p,c,r),{serializedResult:F,finalResult:w=F}=v0({chunks:g,objectMode:m,encoding:c,lines:d,stripFinalNewline:l,fdNumber:n});$0({serializedResult:F,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&&A0(F,p,i),E}catch(y){return r.error=y,E}},"transformOutputResultSync"),S0=o((e,t,n,r)=>{try{return eu(e,t,n,!1)}catch(i){return r.error=i,e}},"runOutputGeneratorsSync"),v0=o(({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(t)return{serializedResult:e};if(n==="buffer")return{serializedResult:Tn(e)};const a=Fd(e,n);return r[s]?{serializedResult:a,finalResult:qa(a,!i[s],t)}:{serializedResult:a}},"serializeChunks"),$0=o(({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:a})=>{if(!nu({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:t}))return;const u=qa(e,!1,a);try{y0(u,t,r)}catch(c){n.error??(n.error=c)}},"logOutputSync"),A0=o((e,t,n)=>{for(const{path:r,append:i}of t.filter(({type:s})=>Ia.has(s))){const s=typeof r=="string"?r:r.toString();i||n.has(s)?al(r,e):(n.add(s),ul(r,e))}},"writeToFiles"),B0=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,_e(t,n,"all")]:Array.isArray(t)?[_e(e,n,"all"),...t]:J(e)&&J(t)?qi([e,t]):`${e}${t}`},"getAllSync"),T0=o(async(e,t)=>{const[n,r]=await x0(e);return t.isForcefullyTerminated??(t.isForcefullyTerminated=!1),[n,r]},"waitForExit"),x0=o(async e=>{const[t,n]=await Promise.allSettled([z(e,"spawn"),z(e,"exit")]);return t.status==="rejected"?[]:n.status==="rejected"?ou(e):n.value},"waitForExitOrError"),ou=o(async e=>{try{return await z(e,"exit")}catch{return ou(e)}},"waitForSubprocessExit"),O0=o(async e=>{const[t,n]=await e;if(!I0(t,n)&&iu(t,n))throw new we;return[t,n]},"waitForSuccessfulExit"),I0=o((e,t)=>e===void 0&&t===void 0,"isSubprocessErrorExit"),iu=o((e,t)=>e!==0||t!==null,"isFailedExit"),M0=o(({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{const s=R0(e,t,n),a=s?.code==="ETIMEDOUT",u=cD(s,r,i);return{resultError:s,exitCode:t,signal:n,timedOut:a,isMaxBuffer:u}},"getExitResultSync"),R0=o((e,t,n)=>e!==void 0?e:iu(t,n)?new we:void 0,"getResultError"),_0=o((e,t,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:a,startTime:u,verboseInfo:c,options:d,fileDescriptors:l}=P0(e,t,n),f=N0({file:r,commandArguments:i,options:d,command:s,escapedCommand:a,verboseInfo:c,fileDescriptors:l,startTime:u});return Fr(f,c,d)},"execaCoreSync"),P0=o((e,t,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=us(e,t,n),u=L0(n),{file:c,commandArguments:d,options:l}=Js(e,t,u);k0(l);const f=j2(l,a);return{file:c,commandArguments:d,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:f}},"handleSyncArguments"),L0=o(e=>e.node&&!e.ipc?{...e,ipc:!1}:e,"normalizeSyncOptions"),k0=o(({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&_t("ipcInput"),e&&_t("ipc: true"),n&&_t("detached: true"),r&&_t("cancelSignal")},"validateSyncOptions"),_t=o(e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},"throwInvalidSyncOption"),N0=o(({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:a,startTime:u})=>{const c=j0({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}=b0({fileDescriptors:a,syncResult:c,options:n,isMaxBuffer:D,verboseInfo:s}),g=p.map((w,E)=>_e(w,n,E)),F=_e(B0(p,n),n,"all");return W0({error:m,exitCode:l,signal:f,timedOut:h,isMaxBuffer:D,stdio:g,all:F,options:n,command:r,escapedCommand:i,startTime:u})},"spawnSubprocessSync"),j0=o(({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:a})=>{try{f0(s,n);const u=U0(n);return Kc(...Xs(e,t,u))}catch(u){return mr({error:u,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:a,isSync:!0})}},"runSubprocessSync"),U0=o(({encoding:e,maxBuffer:t,...n})=>({...n,encoding:"buffer",maxBuffer:Dr(t)}),"normalizeSpawnSyncOptions"),W0=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?Ea({command:c,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:u,startTime:l}):gr({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"),G0=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(Xn({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:Ws(e)}),z0({anyProcess:e,channel:t,isSubprocess:n,filter:s,reference:i})),"getOneMessage"),z0=o(async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{js(t,i);const s=vt(e,t,n),a=new AbortController;try{return await Promise.race([V0(s,r,a),q0(s,n,a),K0(s,n,a)])}catch(u){throw Qn(e),u}finally{a.abort(),Us(t,i)}},"getOneMessageAsync"),V0=o(async(e,t,{signal:n})=>{if(t===void 0){const[r]=await z(e,"message",{signal:n});return r}for await(const[r]of ht(e,"message",{signal:n}))if(t(r))return r},"getMessage"),q0=o(async(e,t,{signal:n})=>{await z(e,"disconnect",{signal:n}),gh(t)},"throwOnDisconnect"),K0=o(async(e,t,{signal:n})=>{const[r]=await z(e,"strict:error",{signal:n});throw _s(r,t)},"throwOnStrictError"),Y0=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>su({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),"getEachMessage"),su=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{Xn({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:Ws(e)}),js(t,s);const a=vt(e,t,n),u=new AbortController,c={};return H0(e,a,u),Z0({ipcEmitter:a,isSubprocess:n,controller:u,state:c}),J0({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:n,shouldAwait:i,controller:u,state:c,reference:s})},"loopOnMessages"),H0=o(async(e,t,n)=>{try{await z(t,"disconnect",{signal:n.signal}),n.abort()}catch{}},"stopOnDisconnect"),Z0=o(async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{const[i]=await z(e,"strict:error",{signal:n.signal});r.error=_s(i,t),n.abort()}catch{}},"abortOnStrictError"),J0=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 ht(n,"message",{signal:s.signal}))au(a),yield c}catch{au(a)}finally{s.abort(),Us(t,u),r||Qn(e),i&&await e}},"iterateOnMessages"),au=o(({error:e})=>{if(e)throw e},"throwIfStrictError"),X0=o((e,{ipc:t})=>{Object.assign(e,uu(e,!1,t))},"addIpcMethods"),Q0=o(()=>{const e=x,t=!0,n=x.channel!==void 0;return{...uu(e,t,n),getCancelSignal:Jh.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}},"getIpcExport"),uu=o((e,t,n)=>({sendMessage:zs.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:G0.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:Y0.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),"getIpcMethods"),e1=o(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:a})=>{Ua(r);const u=new jo;t1(u,r),Object.assign(u,{readable:n1,writable:r1,duplex:o1});const c=mr({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),d=i1(c,a,i);return{subprocess:u,promise:d}},"handleEarlyError"),t1=o((e,t)=>{const n=tt(),r=tt(),i=tt(),s=Array.from({length:t.length-3},tt),a=tt(),u=[n,r,i,...s];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:a,stdio:u})},"createDummyStreams"),tt=o(()=>{const e=new Qo;return e.end(),e},"createDummyStream"),n1=o(()=>new me({read(){}}),"readable"),r1=o(()=>new pn({write(){}}),"writable"),o1=o(()=>new hn({read(){},write(){}}),"duplex"),i1=o(async(e,t,n)=>Fr(e,t,n),"handleDummyPromise"),s1=o((e,t)=>ja(a1,e,t,!1),"handleStdioAsync"),nt=o(({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${Rt[e]}.`)},"forbiddenIfAsync"),cu={fileNumber:nt,generator:Qa,asyncGenerator:Qa,nodeStream:o(({value:e})=>({stream:e}),"nodeStream"),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){const r=t||n;return{stream:hn.fromWeb(e,{objectMode:r})}},duplex:o(({value:{transform:e}})=>({stream:e}),"duplex"),native(){}},a1={input:{...cu,fileUrl:o(({value:e})=>({stream:Xo(e)}),"fileUrl"),filePath:o(({value:{file:e}})=>({stream:Xo(e)}),"filePath"),webStream:o(({value:e})=>({stream:me.fromWeb(e)}),"webStream"),iterable:o(({value:e})=>({stream:me.from(e)}),"iterable"),asyncIterable:o(({value:e})=>({stream:me.from(e)}),"asyncIterable"),string:o(({value:e})=>({stream:me.from(e)}),"string"),uint8Array:o(({value:e})=>({stream:me.from(Dn.from(e))}),"uint8Array")},output:{...cu,fileUrl:o(({value:e})=>({stream:Jo(e)}),"fileUrl"),filePath:o(({value:{file:e,append:t}})=>({stream:Jo(e,t?{flags:"a"}:{})}),"filePath"),webStream:o(({value:e})=>({stream:pn.fromWeb(e)}),"webStream"),iterable:nt,asyncIterable:nt,string:nt,uint8Array:nt}};var lu=o(e=>{throw TypeError(e)},"__typeError$1"),du=o((e,t,n)=>t.has(e)||lu("Cannot "+n),"__accessCheck$1"),q=o((e,t,n)=>(du(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet$1"),Pe=o((e,t,n)=>t.has(e)?lu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd$1"),u1=o((e,t,n,r)=>(du(e,t,"write to private field"),t.set(e,n),n),"__privateSet$1"),$e,Ar,Br,rt,Pt,ot;function Tr(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const i of e)Or(i);const t=e.some(({readableObjectMode:i})=>i),n=c1(e,t),r=new xr({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of e)r.add(i);return r}o(Tr,"mergeStreams");const c1=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"),xo=class xo extends Qo{constructor(){super(...arguments),Pe(this,$e,new Set([])),Pe(this,Ar,new Set([])),Pe(this,Br,new Set([])),Pe(this,rt),Pe(this,Pt,Symbol("unpipe")),Pe(this,ot,new WeakMap)}add(t){if(Or(t),q(this,$e).has(t))return;q(this,$e).add(t),q(this,rt)??u1(this,rt,l1(this,q(this,$e),q(this,Pt)));const n=h1({passThroughStream:this,stream:t,streams:q(this,$e),ended:q(this,Ar),aborted:q(this,Br),onFinished:q(this,rt),unpipeEvent:q(this,Pt)});q(this,ot).set(t,n),t.pipe(this,{end:!1})}async remove(t){if(Or(t),!q(this,$e).has(t))return!1;const n=q(this,ot).get(t);return n===void 0?!1:(q(this,ot).delete(t),t.unpipe(this),await n,!0)}};o(xo,"MergedStream");let xr=xo;$e=new WeakMap,Ar=new WeakMap,Br=new WeakMap,rt=new WeakMap,Pt=new WeakMap,ot=new WeakMap;const l1=o(async(e,t,n)=>{Lt(e,Du);const r=new AbortController;try{await Promise.race([d1(e,r),f1(e,t,n,r)])}finally{r.abort(),Lt(e,-Du)}},"onMergedStreamFinished"),d1=o(async(e,{signal:t})=>{try{await le(e,{signal:t,cleanup:!0})}catch(n){throw fu(e,n),n}},"onMergedStreamEnd"),f1=o(async(e,t,n,{signal:r})=>{for await(const[i]of ht(e,"unpipe",{signal:r}))t.has(i)&&i.emit(n)},"onInputStreamsUnpipe"),Or=o(e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},"validateStream"),h1=o(async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:a})=>{Lt(e,mu);const u=new AbortController;try{await Promise.race([p1(s,t,u),D1({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:u}),m1({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:a,controller:u})])}finally{u.abort(),Lt(e,-mu)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Ir(e):g1(e))},"endWhenStreamsDone"),p1=o(async(e,t,{signal:n})=>{try{await e,n.aborted||Ir(t)}catch(r){n.aborted||fu(t,r)}},"afterMergedStreamFinished"),D1=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;hu(a)?i.add(t):pu(e,a)}},"onInputStreamEnd"),m1=o(async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await z(e,i,{signal:s}),!e.readable)return z(s,"abort",{signal:s});t.delete(e),n.delete(e),r.delete(e)},"onInputStreamUnpipe"),g1=o(e=>{e.writable&&e.end()},"endStream"),fu=o((e,t)=>{hu(t)?Ir(e):pu(e,t)},"errorOrAbortStream"),hu=o(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isAbortError"),Ir=o(e=>{(e.readable||e.writable)&&e.destroy()},"abortStream"),pu=o((e,t)=>{e.destroyed||(e.once("error",F1),e.destroy(t))},"errorStream"),F1=o(()=>{},"noop"),Lt=o((e,t)=>{const n=e.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&e.setMaxListeners(n+t)},"updateMaxListeners"),Du=2,mu=1,kt=o((e,t)=>{e.pipe(t),w1(e,t),y1(e,t)},"pipeStreams"),w1=o(async(e,t)=>{if(!(ge(e)||ge(t))){try{await le(e,{cleanup:!0,readable:!0,writable:!1})}catch{}gu(t)}},"onSourceFinish"),gu=o(e=>{e.writable&&e.end()},"endDestinationStream"),y1=o(async(e,t)=>{if(!(ge(e)||ge(t))){try{await le(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Fu(e)}},"onDestinationFinish"),Fu=o(e=>{e.readable&&e.destroy()},"abortSourceStream"),E1=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})=>ve.has(c)))b1(e,u,a,i);for(const{stream:u}of s.filter(({type:c})=>!ve.has(c)))S1({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]:Tr(s);kt(a,i)}},"pipeOutputAsync"),b1=o((e,t,n,r)=>{n==="output"?kt(e.stdio[r],t):kt(t,e.stdio[r]);const i=C1[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},"pipeTransform"),C1=["stdin","stdout","stderr"],S1=o(({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(t===void 0)return;v1(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"),v1=o((e,{signal:t})=>{ge(e)&&Ct(e,$1,t)},"setStandardStreamMaxListeners"),$1=2,Le=[];Le.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&Le.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&Le.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var A1=Object.defineProperty,wu=o(e=>{throw TypeError(e)},"__typeError"),B1=o((e,t,n)=>t in e?A1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$1"),Nt=o((e,t,n)=>B1(e,typeof t!="symbol"?t+"":t,n),"__publicField$1"),Mr=o((e,t,n)=>t.has(e)||wu("Cannot "+n),"__accessCheck"),B=o((e,t,n)=>(Mr(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet"),pe=o((e,t,n)=>t.has(e)?wu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd"),ke=o((e,t,n,r)=>(Mr(e,t,"write to private field"),t.set(e,n),n),"__privateSet"),yu=o((e,t,n)=>(Mr(e,t,"access private method"),n),"__privateMethod"),Rr,Z,P,it,st,Ne,Ae,jt,Eu,bu;const Ut=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"),_r=Symbol.for("signal-exit emitter"),Pr=globalThis,T1=Object.defineProperty.bind(Object),Oo=class Oo{constructor(){if(Nt(this,"emitted",{afterExit:!1,exit:!1}),Nt(this,"listeners",{afterExit:[],exit:[]}),Nt(this,"count",0),Nt(this,"id",Math.random()),Pr[_r])return Pr[_r];T1(Pr,_r,{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(Oo,"Emitter");let Lr=Oo;const Io=class Io{};o(Io,"SignalExitBase");let Wt=Io;const x1=o(e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),"signalExitWrap"),Mo=class Mo extends Wt{onExit(){return()=>{}}load(){}unload(){}};o(Mo,"SignalExitFallback");let kr=Mo;const Ro=class Ro extends Wt{constructor(t){super(),pe(this,jt),pe(this,Rr,jr.platform==="win32"?"SIGINT":"SIGHUP"),pe(this,Z,new Lr),pe(this,P),pe(this,it),pe(this,st),pe(this,Ne,{}),pe(this,Ae,!1),ke(this,P,t),ke(this,Ne,{});for(const n of Le)B(this,Ne)[n]=()=>{const r=B(this,P).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,Rr):n;a||t.kill(t.pid,u)}};ke(this,st,t.reallyExit),ke(this,it,t.emit)}onExit(t,n){if(!Ut(B(this,P)))return()=>{};B(this,Ae)===!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,Ae)){ke(this,Ae,!0),B(this,Z).count+=1;for(const t of Le)try{const n=B(this,Ne)[t];n&&B(this,P).on(t,n)}catch{}B(this,P).emit=(t,...n)=>yu(this,jt,bu).call(this,t,...n),B(this,P).reallyExit=t=>yu(this,jt,Eu).call(this,t)}}unload(){B(this,Ae)&&(ke(this,Ae,!1),Le.forEach(t=>{const n=B(this,Ne)[t];if(!n)throw new Error("Listener not defined for signal: "+t);try{B(this,P).removeListener(t,n)}catch{}}),B(this,P).emit=B(this,it),B(this,P).reallyExit=B(this,st),B(this,Z).count-=1)}};o(Ro,"SignalExit");let Nr=Ro;Rr=new WeakMap,Z=new WeakMap,P=new WeakMap,it=new WeakMap,st=new WeakMap,Ne=new WeakMap,Ae=new WeakMap,jt=new WeakSet,Eu=o(function(e){return Ut(B(this,P))?(B(this,P).exitCode=e||0,B(this,Z).emit("exit",B(this,P).exitCode,null),B(this,st).call(B(this,P),B(this,P).exitCode)):0},"processReallyExit_fn"),bu=o(function(e,...t){const n=B(this,it);if(e==="exit"&&Ut(B(this,P))){typeof t[0]=="number"&&(B(this,P).exitCode=t[0]);const r=n.call(B(this,P),e,...t);return B(this,Z).emit("exit",B(this,P).exitCode,null),r}else return n.call(B(this,P),e,...t)},"processEmit_fn");const jr=globalThis.process,{onExit:O1}=x1(Ut(jr)?new Nr(jr):new kr),I1=o((e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;const i=O1(()=>{e.kill()});Zo(r,()=>{i()})},"cleanupOnExit"),M1=o(({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{const s=ss(),{destination:a,destinationStream:u,destinationError:c,from:d,unpipeSignal:l}=R1(n,r,i),{sourceStream:f,sourceError:h}=P1(e,d),{options:D,fileDescriptors:p}=ye.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:D,sourceError:h,destination:a,destinationStream:u,destinationError:c,unpipeSignal:l,fileDescriptors:p,startTime:s}},"normalizePipeArguments"),R1=o((e,t,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:a}={}}=_1(e,t,...n),u=Ps(r,s);return{destination:r,destinationStream:u,from:i,unpipeSignal:a}}catch(r){return{destinationError:r}}},"getDestinationStream"),_1=o((e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(Cu,e)(n,...r),pipeOptions:e};if(typeof n=="string"||n instanceof URL||ji(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]=Wi(n,...r);return{destination:t(Cu)(i,s,a),pipeOptions:a}}if(ye.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"),Cu=o(({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),"mapDestinationArguments"),P1=o((e,t)=>{try{return{sourceStream:er(e,t)}}catch(n){return{sourceError:n}}},"getSourceStream"),L1=o(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:a})=>{const u=k1({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(u!==void 0)throw Su({error:u,fileDescriptors:i,sourceOptions:s,startTime:a})},"handlePipeArgumentsError"),k1=o(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return Fu(e),r;if(t!==void 0)return gu(n),t},"getPipeArgumentsError"),Su=o(({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>mr({error:e,command:vu,escapedCommand:vu,fileDescriptors:t,options:n,startTime:r,isSync:!1}),"createNonCommandError"),vu="source.pipe(destination)",N1=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"),j1=o((e,t,n)=>{const r=Gt.has(t)?W1(e,t):U1(e,t);return Ct(e,z1,n.signal),Ct(t,V1,n.signal),G1(t),r},"pipeSubprocessStream"),U1=o((e,t)=>{const n=Tr([e]);return kt(n,t),Gt.set(t,n),n},"pipeFirstSubprocessStream"),W1=o((e,t)=>{const n=Gt.get(t);return n.add(e),n},"pipeMoreSubprocessStream"),G1=o(async e=>{try{await le(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Gt.delete(e)},"cleanupMergedStreamsMap"),Gt=new WeakMap,z1=2,V1=1,q1=o((e,t)=>e===void 0?[]:[K1(e,t)],"unpipeOnAbort"),K1=o(async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await Jc(e,t),await n.remove(t);const a=new Error("Pipe canceled by `unpipeSignal` option.");throw Su({error:a,fileDescriptors:r,sourceOptions:i,startTime:s})},"unpipeOnSignalAbort"),Ur=o((e,...t)=>{if(H(t[0]))return Ur.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});const{destination:n,...r}=M1(e,...t),i=Y1({...r,destination:n});return i.pipe=Ur.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},"pipeToSubprocess"),Y1=o(async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:a,unpipeSignal:u,fileDescriptors:c,startTime:d})=>{const l=H1(e,i);L1({sourceStream:t,sourceError:r,destinationStream:s,destinationError:a,fileDescriptors:c,sourceOptions:n,startTime:d});const f=new AbortController;try{const h=j1(t,s,f);return await Promise.race([N1(l),...q1(u,{sourceStream:t,mergedStream:h,sourceOptions:n,fileDescriptors:c,startTime:d})])}finally{f.abort()}},"handlePipePromise"),H1=o((e,t)=>Promise.allSettled([e,t]),"getSubprocessPromises"),$u=o(({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const a=new AbortController;return Z1(t,a),Bu({stream:e,controller:a,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},"iterateOnSubprocessStream"),Z1=o(async(e,t)=>{try{await e}catch{}finally{t.abort()}},"stopReadingOnExit"),Au=o(({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const a=new AbortController;J1(t,a,e);const u=e.readableObjectMode&&!s;return Bu({stream:e,controller:a,binary:r==="buffer",shouldEncode:!u,encoding:r,shouldSplit:!u&&n,preserveNewlines:!i})},"iterateForResult"),J1=o(async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},"stopReadingOnStreamEnd"),Bu=o(({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})=>{const u=ht(e,"data",{signal:t.signal,highWaterMark:xu,highWatermark:xu});return X1({onStdoutChunk:u,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})},"iterateOnStream"),Tu=pt(!0),xu=Tu,X1=o(async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a}){const u=Q1({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a});try{for await(const[c]of e)yield*et(c,u,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*$r(u)}},"iterateOnData"),Q1=o(({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Za(e,n,!t),Va(e,i,!r,{})].filter(Boolean),"getGenerators"),em=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=tm({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:u,verboseInfo:d,streamInfo:l});if(!i){await Promise.all([nm(e),f]);return}const h=za(c,n),D=Au({stream:e,onStreamEnd:t,lines:a,encoding:r,stripFinalNewline:h,allMixed:u}),[p]=await Promise.all([rm({stream:e,iterable:D,fdNumber:n,encoding:r,maxBuffer:s,lines:a}),f]);return p},"getStreamOutput"),tm=o(async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!nu({stdioItems:a[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const u=Au({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await w0(u,e,n,s)},"logOutputAsync"),nm=o(async e=>{await nl(),e.readableFlowing===null&&e.resume()},"resumeStream"),rm=o(async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:a})=>{try{return t||a?await Lp(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await Wp(n,{maxBuffer:s})):await Xp(n,{maxBuffer:s})}catch(u){return Iu(oD({error:u,stream:e,readableObjectMode:t,lines:a,encoding:i,fdNumber:r}))}},"getStreamContents"),Ou=o(async e=>{try{return await e}catch(t){return Iu(t)}},"getBufferedData"),Iu=o(({bufferedData:e})=>Dd(e)?new Uint8Array(e):e,"handleBufferedData"),Wr=o(async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=om(e,n),a=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],le(e,{cleanup:!0,signal:a.signal})])}catch(u){s.stdinCleanedUp||am(u,t,n,r)}finally{a.abort()}},"waitForStream"),om=o((e,{originalStreams:[t],subprocess:n})=>{const r={stdinCleanedUp:!1};return e===t&&im(e,n,r),r},"handleStdinDestroy"),im=o((e,t,n)=>{const{_destroy:r}=e;e._destroy=(...i)=>{sm(t,n),r.call(e,...i)}},"spyOnStdinDestroy"),sm=o(({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},"setStdinCleanedUp"),am=o((e,t,n,r)=>{if(!um(e,t,n,r))throw e},"handleStreamError"),um=o((e,t,n,r=!0)=>n.propagating?Ru(e)||Gr(e):(n.propagating=!0,Mu(n,t)===r?Ru(e):Gr(e)),"shouldIgnoreStreamError"),Mu=o(({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input","isInputFileDescriptor"),Gr=o(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isStreamAbort"),Ru=o(e=>e?.code==="EPIPE","isStreamEpipe"),cm=o(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:u})=>e.stdio.map((c,d)=>_u({stream:c,fdNumber:d,encoding:t,buffer:n[d],maxBuffer:r[d],lines:i[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:u})),"waitForStdioStreams"),_u=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=Wr(e,t,d);if(Mu(d,t)){await l;return}const[f]=await Promise.all([em({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"),lm=o(({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Tr([e,t].filter(Boolean)):void 0,"makeAllStream"),dm=o(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:u})=>_u({...fm(e,n),fdNumber:"all",encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:hm(e),stripFinalNewline:s,verboseInfo:a,streamInfo:u}),"waitForAllStream"),fm=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"),hm=o(({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,"getAllMixed"),pm=o(e=>In(e,"ipc"),"shouldLogIpc"),Dm=o((e,t)=>{const n=is(e);Ke({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:t})},"logIpcOutput"),mm=o(async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const a=pm(s),u=qe(t,"ipc"),c=qe(n,"ipc");for await(const d of su({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))u&&(sD(e,i,c),i.push(d)),a&&Dm(d,s);return i},"waitForIpcOutput"),gm=o(async(e,t)=>(await Promise.allSettled([e]),t),"getBufferedIpcOutput"),Fm=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:g,controller:F})=>{const w=T0(e,h),E={originalStreams:m,fileDescriptors:p,subprocess:e,exitPromise:w,propagating:!1},y=cm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:d,verboseInfo:D,streamInfo:E}),b=dm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:d,verboseInfo:D,streamInfo:E}),v=[],C=mm({subprocess:e,buffer:n,maxBuffer:r,ipc:l,ipcOutput:v,verboseInfo:D}),S=wm(m,e,E),O=ym(p,E);try{return await Promise.race([Promise.all([{},O0(w),Promise.all(y),b,C,hp(e,f),...S,...O]),g,Em(e,F),...ip(e,s,h,F),...ph({subprocess:e,cancelSignal:a,gracefulCancel:u,context:h,controller:F}),...tp({subprocess:e,cancelSignal:a,gracefulCancel:u,forceKillAfterDelay:c,context:h,controller:F})])}catch(G){return h.terminationReason??(h.terminationReason="other"),Promise.all([{error:G},w,Promise.all(y.map(N=>Ou(N))),Ou(b),gm(C,v),Promise.allSettled(S),Promise.allSettled(O)])}},"waitForSubprocessResult"),wm=o((e,t,n)=>e.map((r,i)=>r===t.stdio[i]?void 0:Wr(r,i,n)),"waitForOriginalStreams"),ym=o((e,t)=>e.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>be(s,{checkOpen:!1})&&!ge(s)).map(({type:i,value:s,stream:a=s})=>Wr(a,r,t,{isSameDirection:ve.has(i),stopOnExit:i==="native"}))),"waitForCustomStreamsEnd"),Em=o(async(e,{signal:t})=>{const[n]=await z(e,"error",{signal:t});throw n},"throwOnSubprocessError"),bm=o(()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),"initializeConcurrentStreams"),zr=o((e,t,n)=>{const r=e[n];r.has(t)||r.set(t,[]);const i=r.get(t),s=Ze();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},"addConcurrentStream"),zt=o(async({resolve:e,promises:t},n)=>{e();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},"waitForConcurrentStreams"),Pu=o(async e=>{if(e!==void 0)try{await Lu(e)}catch{}},"safeWaitForSubprocessStdin"),Cm=o(async e=>{if(e!==void 0)try{await ku(e)}catch{}},"safeWaitForSubprocessStdout"),Lu=o(async e=>{await le(e,{cleanup:!0,readable:!1,writable:!0})},"waitForSubprocessStdin"),ku=o(async e=>{await le(e,{cleanup:!0,readable:!0,writable:!1})},"waitForSubprocessStdout"),Nu=o(async(e,t)=>{if(await e,t)throw t},"waitForSubprocess"),ju=o((e,t,n)=>{n&&!Gr(n)?e.destroy(n):t&&e.destroy()},"destroyOtherStream"),Sm=o(({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||Ee.has(n),{subprocessStdout:u,waitReadableDestroy:c}=Uu(e,r,t),{readableEncoding:d,readableObjectMode:l,readableHighWaterMark:f}=Wu(u,a),{read:h,onStdoutDataDone:D}=Gu({subprocessStdout:u,subprocess:e,binary:a,encoding:n,preserveNewlines:s}),p=new me({read:h,destroy:Oe(Vu.bind(void 0,{subprocessStdout:u,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:l,encoding:d});return zu({subprocessStdout:u,onStdoutDataDone:D,readable:p,subprocess:e}),p},"createReadable"),Uu=o((e,t,n)=>{const r=er(e,t),i=zr(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},"getSubprocessStdout"),Wu=o(({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Tu},"getReadableOptions"),Gu=o(({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{const s=Ze(),a=$u({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){vm(this,a,s)},onStdoutDataDone:s}},"getReadableMethods"),vm=o(async(e,t,n)=>{try{const{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},"onRead"),zu=o(async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await ku(e),await r,await Pu(i),await t,n.readable&&n.push(null)}catch(s){await Pu(i),qu(n,s)}},"onStdoutFinished"),Vu=o(async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await zt(n,t)&&(qu(e,r),await Nu(t,r))},"onReadableDestroy"),qu=o((e,t)=>{ju(e,e.readable,t)},"destroyOtherReadable"),$m=o(({subprocess:e,concurrentStreams:t},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=Ku(e,n,t),a=new pn({...Yu(r,e,i),destroy:Oe(Zu.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Hu(r,a),a},"createWritable"),Ku=o((e,t,n)=>{const r=Ps(e,t),i=zr(n,r,"writableFinal"),s=zr(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},"getSubprocessStdin"),Yu=o((e,t,n)=>({write:Am.bind(void 0,e),final:Oe(Bm.bind(void 0,e,t,n))}),"getWritableMethods"),Am=o((e,t,n,r)=>{e.write(t,n)?r():e.once("drain",r)},"onWrite"),Bm=o(async(e,t,n)=>{await zt(n,t)&&(e.writable&&e.end(),await t)},"onWritableFinal"),Hu=o(async(e,t,n)=>{try{await Lu(e),t.writable&&t.end()}catch(r){await Cm(n),Ju(t,r)}},"onStdinFinished"),Zu=o(async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await zt(n,t),await zt(r,t)&&(Ju(e,i),await Nu(t,i))},"onWritableDestroy"),Ju=o((e,t)=>{ju(e,e.writable,t)},"destroyOtherWritable"),Tm=o(({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:a=!0}={})=>{const u=s||Ee.has(n),{subprocessStdout:c,waitReadableDestroy:d}=Uu(e,r,t),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:h}=Ku(e,i,t),{readableEncoding:D,readableObjectMode:p,readableHighWaterMark:m}=Wu(c,u),{read:g,onStdoutDataDone:F}=Gu({subprocessStdout:c,subprocess:e,binary:u,encoding:n,preserveNewlines:a}),w=new hn({read:g,...Yu(l,e,f),destroy:Oe(xm.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 zu({subprocessStdout:c,onStdoutDataDone:F,readable:w,subprocess:e,subprocessStdin:l}),Hu(l,w,c),w},"createDuplex"),xm=o(async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},a)=>{await Promise.all([Vu({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},a),Zu({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},a)])},"onDuplexDestroy"),Xu=o((e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||Ee.has(t),a=er(e,n),u=$u({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:i});return Om(u,a,e)},"createIterable"),Om=o(async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},"iterateOnStdoutData"),Im=o((e,{encoding:t})=>{const n=bm();e.readable=Sm.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=$m.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=Tm.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=Xu.bind(void 0,e,t),e[Symbol.asyncIterator]=Xu.bind(void 0,e,t,{})},"addConvertedStreams"),Mm=o((e,t)=>{for(const[n,r]of _m){const i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},"mergePromise"),Rm=(async()=>{})().constructor.prototype,_m=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Rm,e)]),Pm=o((e,t,n,r)=>{const{file:i,commandArguments:s,command:a,escapedCommand:u,startTime:c,verboseInfo:d,options:l,fileDescriptors:f}=Lm(e,t,n),{subprocess:h,promise:D}=Nm({file:i,commandArguments:s,options:l,startTime:c,verboseInfo:d,command:a,escapedCommand:u,fileDescriptors:f});return h.pipe=Ur.bind(void 0,{source:h,sourcePromise:D,boundOptions:{},createNested:r}),Mm(h,D),ye.set(h,{options:l,fileDescriptors:f}),h},"execaCoreAsync"),Lm=o((e,t,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=us(e,t,n),{file:u,commandArguments:c,options:d}=Js(e,t,n),l=km(d),f=s1(l,a);return{file:u,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:f}},"handleAsyncArguments"),km=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"),Nm=o(({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:a,fileDescriptors:u})=>{let c;try{c=Yc(...Xs(e,t,n))}catch(p){return e1({error:p,command:s,escapedCommand:a,fileDescriptors:u,options:n,startTime:r,verboseInfo:i})}const d=new AbortController;ol(Number.POSITIVE_INFINITY,d.signal);const l=[...c.stdio];E1(c,u,d),I1(c,n,d);const f={},h=Ze();c.kill=ch.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:h,context:f,controller:d}),c.all=lm(c,n),Im(c,n),X0(c,n);const D=jm({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"),jm=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,g]=await Fm({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:d,controller:l});l.abort(),d.resolve();const F=p.map((y,b)=>_e(y,t,b)),w=_e(m,t,"all"),E=Um({errorInfo:f,exitCode:h,signal:D,stdio:F,all:w,ipcOutput:g,context:c,options:t,command:a,escapedCommand:u,startTime:n});return Fr(E,r,t)},"handlePromise"),Um=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?gr({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 Ie,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:s,options:u,startTime:l,isSync:!1}):Ea({command:c,escapedCommand:d,stdio:r,all:i,ipcOutput:s,options:u,startTime:l}),"getAsyncResult"),Vr=o((e,t)=>{const n=Object.fromEntries(Object.entries(t).map(([r,i])=>[r,Wm(r,e[r],i)]));return{...e,...n}},"mergeOptions"),Wm=o((e,t,n)=>Gm.has(e)&&H(t)&&H(n)?{...t,...n}:n,"mergeOption"),Gm=new Set(["env",...es]),Be=o((e,t,n,r)=>{const i=o((a,u,c)=>Be(a,u,n,c),"createNested"),s=o((...a)=>zm({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a),"boundExeca");return r!==void 0&&r(s,i,t),s},"createExeca"),zm=o(({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...a)=>{if(H(s))return i(e,Vr(n,s),r);const{file:u,commandArguments:c,options:d,isSync:l}=Vm({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:n});return l?_0(u,c,d):Pm(u,c,d,i)},"callBoundExeca"),Vm=o(({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=bd(t)?Cd(t,n):[t,...n],[a,u,c]=Wi(...s),d=Vr(Vr(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"),qm=o(({file:e,commandArguments:t})=>Qu(e,t),"mapCommandAsync"),Km=o(({file:e,commandArguments:t})=>({...Qu(e,t),isSync:!0}),"mapCommandSync"),Qu=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]=Ym(e);return{file:n,commandArguments:r}},"parseCommand"),Ym=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(Hm)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},"parseCommandString"),Hm=/ +/g,Zm=o((e,t,n)=>{e.sync=t(Xm,n),e.s=e.sync},"setScriptSync"),Jm=o(({options:e})=>ec(e),"mapScriptAsync"),Xm=o(({options:e})=>({...ec(e),isSync:!0}),"mapScriptSync"),ec=o(e=>({options:{...Qm(e),...e}}),"getScriptOptions"),Qm=o(({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},"getScriptStdinOption"),eg={preferLocal:!0},je=Be(()=>({}));Be(()=>({isSync:!0})),Be(qm),Be(Km),Be(ap),Be(Jm,{},eg,Zm),Q0();let Te=!0;const Ue=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let at=0;if(Ue.process&&Ue.process.env&&Ue.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:n,TERM:r,COLORTERM:i}=Ue.process.env;t||n||e==="0"?Te=!1:e==="1"||e==="2"||e==="3"?Te=!0:r==="dumb"?Te=!1:"CI"in Ue.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in Ue.process.env)?Te=!0:Te=process.stdout.isTTY,Te&&(process.platform==="win32"||i&&(i==="truecolor"||i==="24bit")?at=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?at=2:at=1)}let tc={enabled:Te,supportLevel:at};function ut(e,t,n=1){const r=`\x1B[${e}m`,i=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return a=>tc.enabled&&tc.supportLevel>=n?r+(""+a).replace(s,r)+i:""+a}o(ut,"kolorist");const qr=ut(2,22),nc=ut(30,39),Vt=ut(31,39),ct=ut(32,39),rc=ut(46,49);var Kr,oc;function tg(){if(oc)return Kr;oc=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 Kr={cursor:r,scroll:i,erase:s,beep:n},Kr}o(tg,"requireSrc");var j=tg(),ng=Object.defineProperty,rg=o((e,t,n)=>t in e?ng(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp"),U=o((e,t,n)=>rg(e,typeof t!="symbol"?t+"":t,n),"__publicField");function qt(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?qt(s,t<0?-1:1,n):s}o(qt,"x$1");const og=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,"at"),ig=o(e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,"lt"),sg=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,"ht"),Yr=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Kt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Yt=/\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"),Ht=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,ag=new RegExp("\\p{M}+","gu"),ug={limit:1/0,ellipsis:""},ic=o((e,t={},n={})=>{const r=t.limit??1/0,i=t.ellipsis??"",s=t?.ellipsisWidth??(i?ic(i,ug,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,g=e.length,F=0,w=!1,E=g,y=Math.max(0,r-s),b=0,v=0,C=0,S=0;e:for(;;){if(v>b||m>=g&&m>p){const O=e.slice(b,v)||e.slice(p,m);F=0;for(const G of O.replaceAll(ag,"")){const N=G.codePointAt(0)||0;if(ig(N)?S=f:sg(N)?S=D:d!==h&&og(N)?S=d:S=h,C+S>y&&(E=Math.min(E,Math.max(b,p)+F)),C+S>r){w=!0;break e}F+=G.length,C+=S}b=v=0}if(m>=g)break;if(Ht.lastIndex=m,Ht.test(e)){if(F=Ht.lastIndex-m,S=F*h,C+S>y&&(E=Math.min(E,m+Math.floor((y-C)/h))),C+S>r){w=!0;break}C+=S,b=p,v=m,m=p=Ht.lastIndex;continue}if(Yr.lastIndex=m,Yr.test(e)){if(C+a>y&&(E=Math.min(E,m)),C+a>r){w=!0;break}C+=a,b=p,v=m,m=p=Yr.lastIndex;continue}if(Kt.lastIndex=m,Kt.test(e)){if(F=Kt.lastIndex-m,S=F*u,C+S>y&&(E=Math.min(E,m+Math.floor((y-C)/u))),C+S>r){w=!0;break}C+=S,b=p,v=m,m=p=Kt.lastIndex;continue}if(Yt.lastIndex=m,Yt.test(e)){if(F=Yt.lastIndex-m,S=F*c,C+S>y&&(E=Math.min(E,m+Math.floor((y-C)/c))),C+S>r){w=!0;break}C+=S,b=p,v=m,m=p=Yt.lastIndex;continue}if(Hr.lastIndex=m,Hr.test(e)){if(C+l>y&&(E=Math.min(E,m)),C+l>r){w=!0;break}C+=l,b=p,v=m,m=p=Hr.lastIndex;continue}m+=1}return{width:w?y:C,index:w?E:g,truncated:w,ellipsed:w&&r>=s}},"X$1"),cg={limit:1/0,ellipsis:"",ellipsisWidth:0},lt=o((e,t={})=>ic(e,cg,t).width,"S"),Zt="\x1B",sc="\x9B",lg=39,Zr="\x07",ac="[",dg="]",uc="m",Jr=`${dg}8;;`,cc=new RegExp(`(?:\\${ac}(?<code>\\d+)m|\\${Jr}(?<uri>.*)${Zr})`,"y"),fg=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},"mt$1"),lc=o(e=>`${Zt}${ac}${e}${uc}`,"st"),dc=o(e=>`${Zt}${Jr}${e}${Zr}`,"it"),hg=o(e=>e.map(t=>lt(t)),"gt$1"),Xr=o((e,t,n)=>{const r=t[Symbol.iterator]();let i=!1,s=!1,a=e.at(-1),u=a===void 0?0:lt(a),c=r.next(),d=r.next(),l=0;for(;!c.done;){const f=c.value,h=lt(f);u+h<=n?e[e.length-1]+=f:(e.push(f),u=0),(f===Zt||f===sc)&&(i=!0,s=t.startsWith(Jr,l+1)),i?s?f===Zr&&(i=!1,s=!1):f===uc&&(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>0&&e.length>1&&(e[e.length-2]+=e.pop())},"G"),pg=o(e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(lt(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},"vt$1"),Dg=o((e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",i,s;const a=e.split(" "),u=hg(a);let c=[""];for(const[p,m]of a.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??"").trimStart());let g=lt(c.at(-1)??"");if(p!==0&&(g>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(""),g=0),(g>0||n.trim===!1)&&(c[c.length-1]+=" ",g++)),n.hard&&u[p]>t){const F=t-g,w=1+Math.floor((u[p]-F-1)/t);Math.floor((u[p]-1)/t)<w&&c.push(""),Xr(c,m,t);continue}if(g+u[p]>t&&g>0&&u[p]>0){if(n.wordWrap===!1&&g<t){Xr(c,m,t);continue}c.push("")}if(g+u[p]>t&&n.wordWrap===!1){Xr(c,m,t);continue}c[c.length-1]+=m}n.trim!==!1&&(c=c.map(p=>pg(p)));const d=c.join(`
|
|
64
|
+
if (condition) { yield value; }`)},"validateEmptyReturn"),Za=o((e,t,n)=>{if(n)return;if(e)return{transform:n0.bind(void 0,new TextEncoder)};const r=new Uo(t);return{transform:r0.bind(void 0,r),final:o0.bind(void 0,r)}},"getEncodingTransformGenerator"),n0=o(function*(e,t){Dn.isBuffer(t)?yield Ve(t):typeof t=="string"?yield e.encode(t):yield t},"encodingUint8ArrayGenerator"),r0=o(function*(e,t){yield J(t)?e.write(t):t},"encodingStringGenerator"),o0=o(function*(e){const t=e.end();t!==""&&(yield t)},"encodingStringFinal"),Ja=Oe(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(const i of t.currentIterable)r.push(i)}finally{delete t.currentIterable}}),vr=o(async function*(e,t,n){if(n===t.length){yield e;return}const{transform:r=u0}=t[n];for await(const i of r(e))yield*vr(i,t,n+1)},"transformChunk"),i0=o(async function*(e){for(const[t,{final:n}]of Object.entries(e))yield*s0(n,Number(t),e)},"finalChunks"),s0=o(async function*(e,t,n){if(e!==void 0)for await(const r of e())yield*vr(r,n,t+1)},"generatorFinalChunks"),a0=Oe(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),u0=o(function*(e){yield e},"identityGenerator$1"),Xa=o((e,t,n,r)=>{try{for(const i of e(...t))n.push(i);r()}catch(i){r(i)}},"pushChunksSync"),c0=o((e,t)=>[...t.flatMap(n=>[...et(n,e,0)]),...$r(e)],"runTransformSync"),et=o(function*(e,t,n){if(n===t.length){yield e;return}const{transform:r=d0}=t[n];for(const i of r(e))yield*et(i,t,n+1)},"transformChunkSync"),$r=o(function*(e){for(const[t,{final:n}]of Object.entries(e))yield*l0(n,Number(t),e)},"finalChunksSync"),l0=o(function*(e,t,n){if(e!==void 0)for(const r of e())yield*et(r,n,t+1)},"generatorFinalChunksSync"),d0=o(function*(e){yield e},"identityGenerator"),Qa=o(({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:a})=>{const u={},c=tu(e,a,s),d=Re(t),l=Re(n),f=d?Ja.bind(void 0,vr,u):Xa.bind(void 0,et),h=d||l?Ja.bind(void 0,i0,u):Xa.bind(void 0,$r),D=d||l?a0.bind(void 0,u):void 0;return{stream:new cl({writableObjectMode:r,writableHighWaterMark:pt(r),readableObjectMode:i,readableHighWaterMark:pt(i),transform(m,g,F){f([m,c,0],this,F)},flush(m){h([c],this,m)},destroy:D})}},"generatorToStream"),eu=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=tu(a,n,u);e=c0(c,e)}return e},"runGeneratorsSync"),tu=o(({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},a,u)=>{const c={};return[{transform:J2(r,u)},Za(n,a,r),Va(n,s,r,c),{transform:e,final:t},{transform:Q2(i,u)},q2({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},"addInternalGenerators"),f0=o((e,t)=>{for(const n of h0(e))p0(e,n,t)},"addInputOptionsSync"),h0=o(e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),"getInputFdNumbers"),p0=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 ${Rt[u]} with synchronous methods.`)}const a=i.map(({contents:u})=>u).map(u=>D0(u,r));n.input=Tn(a)},"addInputOptionSync"),D0=o((e,t)=>{const n=eu(e,t,"utf8",!0);return m0(n),Tn(n)},"applySingleInputGeneratorsSync"),m0=o(e=>{const t=e.find(n=>typeof n!="string"&&!J(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"),nu=o(({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!=="all"&&In(n,r)&&!Ee.has(t)&&g0(r)&&(e.some(({type:i,value:s})=>i==="native"&&F0.has(s))||e.every(({type:i})=>ve.has(i))),"shouldLogOutput"),g0=o(e=>e===1||e===2,"fdUsesVerbose"),F0=new Set(["pipe","overlapped"]),w0=o(async(e,t,n,r)=>{for await(const i of e)E0(t)||ru(i,n,r)},"logLines"),y0=o((e,t,n)=>{for(const r of e)ru(r,t,n)},"logLinesSync"),E0=o(e=>e._readableState.pipes.length>0,"isPipingStream"),ru=o((e,t,n)=>{const r=is(e);Ke({type:"output",verboseMessage:r,fdNumber:t,verboseInfo:n})},"logLine"),b0=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)=>C0({result:c,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:r,verboseInfo:i},n)),...s}},"transformOutputSync"),C0=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=lD(e,s,f),D=Ve(h),{stdioItems:p,objectMode:m}=t[n],g=S0([D],p,c,r),{serializedResult:F,finalResult:w=F}=v0({chunks:g,objectMode:m,encoding:c,lines:d,stripFinalNewline:l,fdNumber:n});$0({serializedResult:F,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&&A0(F,p,i),E}catch(y){return r.error=y,E}},"transformOutputResultSync"),S0=o((e,t,n,r)=>{try{return eu(e,t,n,!1)}catch(i){return r.error=i,e}},"runOutputGeneratorsSync"),v0=o(({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(t)return{serializedResult:e};if(n==="buffer")return{serializedResult:Tn(e)};const a=Fd(e,n);return r[s]?{serializedResult:a,finalResult:qa(a,!i[s],t)}:{serializedResult:a}},"serializeChunks"),$0=o(({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:a})=>{if(!nu({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:t}))return;const u=qa(e,!1,a);try{y0(u,t,r)}catch(c){n.error??(n.error=c)}},"logOutputSync"),A0=o((e,t,n)=>{for(const{path:r,append:i}of t.filter(({type:s})=>Ia.has(s))){const s=typeof r=="string"?r:r.toString();i||n.has(s)?al(r,e):(n.add(s),ul(r,e))}},"writeToFiles"),B0=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,Pe(t,n,"all")]:Array.isArray(t)?[Pe(e,n,"all"),...t]:J(e)&&J(t)?qi([e,t]):`${e}${t}`},"getAllSync"),T0=o(async(e,t)=>{const[n,r]=await x0(e);return t.isForcefullyTerminated??(t.isForcefullyTerminated=!1),[n,r]},"waitForExit"),x0=o(async e=>{const[t,n]=await Promise.allSettled([z(e,"spawn"),z(e,"exit")]);return t.status==="rejected"?[]:n.status==="rejected"?ou(e):n.value},"waitForExitOrError"),ou=o(async e=>{try{return await z(e,"exit")}catch{return ou(e)}},"waitForSubprocessExit"),O0=o(async e=>{const[t,n]=await e;if(!I0(t,n)&&iu(t,n))throw new we;return[t,n]},"waitForSuccessfulExit"),I0=o((e,t)=>e===void 0&&t===void 0,"isSubprocessErrorExit"),iu=o((e,t)=>e!==0||t!==null,"isFailedExit"),M0=o(({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{const s=R0(e,t,n),a=s?.code==="ETIMEDOUT",u=cD(s,r,i);return{resultError:s,exitCode:t,signal:n,timedOut:a,isMaxBuffer:u}},"getExitResultSync"),R0=o((e,t,n)=>e!==void 0?e:iu(t,n)?new we:void 0,"getResultError"),_0=o((e,t,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:a,startTime:u,verboseInfo:c,options:d,fileDescriptors:l}=P0(e,t,n),f=N0({file:r,commandArguments:i,options:d,command:s,escapedCommand:a,verboseInfo:c,fileDescriptors:l,startTime:u});return Fr(f,c,d)},"execaCoreSync"),P0=o((e,t,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=us(e,t,n),u=L0(n),{file:c,commandArguments:d,options:l}=Js(e,t,u);k0(l);const f=j2(l,a);return{file:c,commandArguments:d,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:f}},"handleSyncArguments"),L0=o(e=>e.node&&!e.ipc?{...e,ipc:!1}:e,"normalizeSyncOptions"),k0=o(({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&_t("ipcInput"),e&&_t("ipc: true"),n&&_t("detached: true"),r&&_t("cancelSignal")},"validateSyncOptions"),_t=o(e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},"throwInvalidSyncOption"),N0=o(({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:a,startTime:u})=>{const c=j0({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}=b0({fileDescriptors:a,syncResult:c,options:n,isMaxBuffer:D,verboseInfo:s}),g=p.map((w,E)=>Pe(w,n,E)),F=Pe(B0(p,n),n,"all");return W0({error:m,exitCode:l,signal:f,timedOut:h,isMaxBuffer:D,stdio:g,all:F,options:n,command:r,escapedCommand:i,startTime:u})},"spawnSubprocessSync"),j0=o(({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:a})=>{try{f0(s,n);const u=U0(n);return Kc(...Xs(e,t,u))}catch(u){return mr({error:u,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:a,isSync:!0})}},"runSubprocessSync"),U0=o(({encoding:e,maxBuffer:t,...n})=>({...n,encoding:"buffer",maxBuffer:Dr(t)}),"normalizeSpawnSyncOptions"),W0=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?Ea({command:c,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:u,startTime:l}):gr({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"),G0=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(Xn({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:Ws(e)}),z0({anyProcess:e,channel:t,isSubprocess:n,filter:s,reference:i})),"getOneMessage"),z0=o(async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{js(t,i);const s=vt(e,t,n),a=new AbortController;try{return await Promise.race([V0(s,r,a),q0(s,n,a),K0(s,n,a)])}catch(u){throw Qn(e),u}finally{a.abort(),Us(t,i)}},"getOneMessageAsync"),V0=o(async(e,t,{signal:n})=>{if(t===void 0){const[r]=await z(e,"message",{signal:n});return r}for await(const[r]of ht(e,"message",{signal:n}))if(t(r))return r},"getMessage"),q0=o(async(e,t,{signal:n})=>{await z(e,"disconnect",{signal:n}),gh(t)},"throwOnDisconnect"),K0=o(async(e,t,{signal:n})=>{const[r]=await z(e,"strict:error",{signal:n});throw _s(r,t)},"throwOnStrictError"),Y0=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>su({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),"getEachMessage"),su=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{Xn({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:Ws(e)}),js(t,s);const a=vt(e,t,n),u=new AbortController,c={};return H0(e,a,u),Z0({ipcEmitter:a,isSubprocess:n,controller:u,state:c}),J0({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:n,shouldAwait:i,controller:u,state:c,reference:s})},"loopOnMessages"),H0=o(async(e,t,n)=>{try{await z(t,"disconnect",{signal:n.signal}),n.abort()}catch{}},"stopOnDisconnect"),Z0=o(async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{const[i]=await z(e,"strict:error",{signal:n.signal});r.error=_s(i,t),n.abort()}catch{}},"abortOnStrictError"),J0=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 ht(n,"message",{signal:s.signal}))au(a),yield c}catch{au(a)}finally{s.abort(),Us(t,u),r||Qn(e),i&&await e}},"iterateOnMessages"),au=o(({error:e})=>{if(e)throw e},"throwIfStrictError"),X0=o((e,{ipc:t})=>{Object.assign(e,uu(e,!1,t))},"addIpcMethods"),Q0=o(()=>{const e=x,t=!0,n=x.channel!==void 0;return{...uu(e,t,n),getCancelSignal:Jh.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}},"getIpcExport"),uu=o((e,t,n)=>({sendMessage:zs.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:G0.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:Y0.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),"getIpcMethods"),e1=o(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:a})=>{Ua(r);const u=new jo;t1(u,r),Object.assign(u,{readable:n1,writable:r1,duplex:o1});const c=mr({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),d=i1(c,a,i);return{subprocess:u,promise:d}},"handleEarlyError"),t1=o((e,t)=>{const n=tt(),r=tt(),i=tt(),s=Array.from({length:t.length-3},tt),a=tt(),u=[n,r,i,...s];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:a,stdio:u})},"createDummyStreams"),tt=o(()=>{const e=new Qo;return e.end(),e},"createDummyStream"),n1=o(()=>new me({read(){}}),"readable"),r1=o(()=>new pn({write(){}}),"writable"),o1=o(()=>new hn({read(){},write(){}}),"duplex"),i1=o(async(e,t,n)=>Fr(e,t,n),"handleDummyPromise"),s1=o((e,t)=>ja(a1,e,t,!1),"handleStdioAsync"),nt=o(({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${Rt[e]}.`)},"forbiddenIfAsync"),cu={fileNumber:nt,generator:Qa,asyncGenerator:Qa,nodeStream:o(({value:e})=>({stream:e}),"nodeStream"),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){const r=t||n;return{stream:hn.fromWeb(e,{objectMode:r})}},duplex:o(({value:{transform:e}})=>({stream:e}),"duplex"),native(){}},a1={input:{...cu,fileUrl:o(({value:e})=>({stream:Xo(e)}),"fileUrl"),filePath:o(({value:{file:e}})=>({stream:Xo(e)}),"filePath"),webStream:o(({value:e})=>({stream:me.fromWeb(e)}),"webStream"),iterable:o(({value:e})=>({stream:me.from(e)}),"iterable"),asyncIterable:o(({value:e})=>({stream:me.from(e)}),"asyncIterable"),string:o(({value:e})=>({stream:me.from(e)}),"string"),uint8Array:o(({value:e})=>({stream:me.from(Dn.from(e))}),"uint8Array")},output:{...cu,fileUrl:o(({value:e})=>({stream:Jo(e)}),"fileUrl"),filePath:o(({value:{file:e,append:t}})=>({stream:Jo(e,t?{flags:"a"}:{})}),"filePath"),webStream:o(({value:e})=>({stream:pn.fromWeb(e)}),"webStream"),iterable:nt,asyncIterable:nt,string:nt,uint8Array:nt}};var lu=o(e=>{throw TypeError(e)},"__typeError$1"),du=o((e,t,n)=>t.has(e)||lu("Cannot "+n),"__accessCheck$1"),q=o((e,t,n)=>(du(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet$1"),Le=o((e,t,n)=>t.has(e)?lu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd$1"),u1=o((e,t,n,r)=>(du(e,t,"write to private field"),t.set(e,n),n),"__privateSet$1"),$e,Ar,Br,rt,Pt,ot;function Tr(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const i of e)Or(i);const t=e.some(({readableObjectMode:i})=>i),n=c1(e,t),r=new xr({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of e)r.add(i);return r}o(Tr,"mergeStreams");const c1=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"),xo=class xo extends Qo{constructor(){super(...arguments),Le(this,$e,new Set([])),Le(this,Ar,new Set([])),Le(this,Br,new Set([])),Le(this,rt),Le(this,Pt,Symbol("unpipe")),Le(this,ot,new WeakMap)}add(t){if(Or(t),q(this,$e).has(t))return;q(this,$e).add(t),q(this,rt)??u1(this,rt,l1(this,q(this,$e),q(this,Pt)));const n=h1({passThroughStream:this,stream:t,streams:q(this,$e),ended:q(this,Ar),aborted:q(this,Br),onFinished:q(this,rt),unpipeEvent:q(this,Pt)});q(this,ot).set(t,n),t.pipe(this,{end:!1})}async remove(t){if(Or(t),!q(this,$e).has(t))return!1;const n=q(this,ot).get(t);return n===void 0?!1:(q(this,ot).delete(t),t.unpipe(this),await n,!0)}};o(xo,"MergedStream");let xr=xo;$e=new WeakMap,Ar=new WeakMap,Br=new WeakMap,rt=new WeakMap,Pt=new WeakMap,ot=new WeakMap;const l1=o(async(e,t,n)=>{Lt(e,Du);const r=new AbortController;try{await Promise.race([d1(e,r),f1(e,t,n,r)])}finally{r.abort(),Lt(e,-Du)}},"onMergedStreamFinished"),d1=o(async(e,{signal:t})=>{try{await le(e,{signal:t,cleanup:!0})}catch(n){throw fu(e,n),n}},"onMergedStreamEnd"),f1=o(async(e,t,n,{signal:r})=>{for await(const[i]of ht(e,"unpipe",{signal:r}))t.has(i)&&i.emit(n)},"onInputStreamsUnpipe"),Or=o(e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},"validateStream"),h1=o(async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:a})=>{Lt(e,mu);const u=new AbortController;try{await Promise.race([p1(s,t,u),D1({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:u}),m1({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:a,controller:u})])}finally{u.abort(),Lt(e,-mu)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Ir(e):g1(e))},"endWhenStreamsDone"),p1=o(async(e,t,{signal:n})=>{try{await e,n.aborted||Ir(t)}catch(r){n.aborted||fu(t,r)}},"afterMergedStreamFinished"),D1=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;hu(a)?i.add(t):pu(e,a)}},"onInputStreamEnd"),m1=o(async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await z(e,i,{signal:s}),!e.readable)return z(s,"abort",{signal:s});t.delete(e),n.delete(e),r.delete(e)},"onInputStreamUnpipe"),g1=o(e=>{e.writable&&e.end()},"endStream"),fu=o((e,t)=>{hu(t)?Ir(e):pu(e,t)},"errorOrAbortStream"),hu=o(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isAbortError"),Ir=o(e=>{(e.readable||e.writable)&&e.destroy()},"abortStream"),pu=o((e,t)=>{e.destroyed||(e.once("error",F1),e.destroy(t))},"errorStream"),F1=o(()=>{},"noop"),Lt=o((e,t)=>{const n=e.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&e.setMaxListeners(n+t)},"updateMaxListeners"),Du=2,mu=1,kt=o((e,t)=>{e.pipe(t),w1(e,t),y1(e,t)},"pipeStreams"),w1=o(async(e,t)=>{if(!(ge(e)||ge(t))){try{await le(e,{cleanup:!0,readable:!0,writable:!1})}catch{}gu(t)}},"onSourceFinish"),gu=o(e=>{e.writable&&e.end()},"endDestinationStream"),y1=o(async(e,t)=>{if(!(ge(e)||ge(t))){try{await le(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Fu(e)}},"onDestinationFinish"),Fu=o(e=>{e.readable&&e.destroy()},"abortSourceStream"),E1=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})=>ve.has(c)))b1(e,u,a,i);for(const{stream:u}of s.filter(({type:c})=>!ve.has(c)))S1({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]:Tr(s);kt(a,i)}},"pipeOutputAsync"),b1=o((e,t,n,r)=>{n==="output"?kt(e.stdio[r],t):kt(t,e.stdio[r]);const i=C1[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},"pipeTransform"),C1=["stdin","stdout","stderr"],S1=o(({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(t===void 0)return;v1(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"),v1=o((e,{signal:t})=>{ge(e)&&Ct(e,$1,t)},"setStandardStreamMaxListeners"),$1=2,ke=[];ke.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&ke.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&ke.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var A1=Object.defineProperty,wu=o(e=>{throw TypeError(e)},"__typeError"),B1=o((e,t,n)=>t in e?A1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$1"),Nt=o((e,t,n)=>B1(e,typeof t!="symbol"?t+"":t,n),"__publicField$1"),Mr=o((e,t,n)=>t.has(e)||wu("Cannot "+n),"__accessCheck"),B=o((e,t,n)=>(Mr(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet"),pe=o((e,t,n)=>t.has(e)?wu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd"),Ne=o((e,t,n,r)=>(Mr(e,t,"write to private field"),t.set(e,n),n),"__privateSet"),yu=o((e,t,n)=>(Mr(e,t,"access private method"),n),"__privateMethod"),Rr,Z,P,it,st,je,Ae,jt,Eu,bu;const Ut=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"),_r=Symbol.for("signal-exit emitter"),Pr=globalThis,T1=Object.defineProperty.bind(Object),Oo=class Oo{constructor(){if(Nt(this,"emitted",{afterExit:!1,exit:!1}),Nt(this,"listeners",{afterExit:[],exit:[]}),Nt(this,"count",0),Nt(this,"id",Math.random()),Pr[_r])return Pr[_r];T1(Pr,_r,{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(Oo,"Emitter");let Lr=Oo;const Io=class Io{};o(Io,"SignalExitBase");let Wt=Io;const x1=o(e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),"signalExitWrap"),Mo=class Mo extends Wt{onExit(){return()=>{}}load(){}unload(){}};o(Mo,"SignalExitFallback");let kr=Mo;const Ro=class Ro extends Wt{constructor(t){super(),pe(this,jt),pe(this,Rr,jr.platform==="win32"?"SIGINT":"SIGHUP"),pe(this,Z,new Lr),pe(this,P),pe(this,it),pe(this,st),pe(this,je,{}),pe(this,Ae,!1),Ne(this,P,t),Ne(this,je,{});for(const n of ke)B(this,je)[n]=()=>{const r=B(this,P).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,Rr):n;a||t.kill(t.pid,u)}};Ne(this,st,t.reallyExit),Ne(this,it,t.emit)}onExit(t,n){if(!Ut(B(this,P)))return()=>{};B(this,Ae)===!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,Ae)){Ne(this,Ae,!0),B(this,Z).count+=1;for(const t of ke)try{const n=B(this,je)[t];n&&B(this,P).on(t,n)}catch{}B(this,P).emit=(t,...n)=>yu(this,jt,bu).call(this,t,...n),B(this,P).reallyExit=t=>yu(this,jt,Eu).call(this,t)}}unload(){B(this,Ae)&&(Ne(this,Ae,!1),ke.forEach(t=>{const n=B(this,je)[t];if(!n)throw new Error("Listener not defined for signal: "+t);try{B(this,P).removeListener(t,n)}catch{}}),B(this,P).emit=B(this,it),B(this,P).reallyExit=B(this,st),B(this,Z).count-=1)}};o(Ro,"SignalExit");let Nr=Ro;Rr=new WeakMap,Z=new WeakMap,P=new WeakMap,it=new WeakMap,st=new WeakMap,je=new WeakMap,Ae=new WeakMap,jt=new WeakSet,Eu=o(function(e){return Ut(B(this,P))?(B(this,P).exitCode=e||0,B(this,Z).emit("exit",B(this,P).exitCode,null),B(this,st).call(B(this,P),B(this,P).exitCode)):0},"processReallyExit_fn"),bu=o(function(e,...t){const n=B(this,it);if(e==="exit"&&Ut(B(this,P))){typeof t[0]=="number"&&(B(this,P).exitCode=t[0]);const r=n.call(B(this,P),e,...t);return B(this,Z).emit("exit",B(this,P).exitCode,null),r}else return n.call(B(this,P),e,...t)},"processEmit_fn");const jr=globalThis.process,{onExit:O1}=x1(Ut(jr)?new Nr(jr):new kr),I1=o((e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;const i=O1(()=>{e.kill()});Zo(r,()=>{i()})},"cleanupOnExit"),M1=o(({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{const s=ss(),{destination:a,destinationStream:u,destinationError:c,from:d,unpipeSignal:l}=R1(n,r,i),{sourceStream:f,sourceError:h}=P1(e,d),{options:D,fileDescriptors:p}=ye.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:D,sourceError:h,destination:a,destinationStream:u,destinationError:c,unpipeSignal:l,fileDescriptors:p,startTime:s}},"normalizePipeArguments"),R1=o((e,t,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:a}={}}=_1(e,t,...n),u=Ps(r,s);return{destination:r,destinationStream:u,from:i,unpipeSignal:a}}catch(r){return{destinationError:r}}},"getDestinationStream"),_1=o((e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(Cu,e)(n,...r),pipeOptions:e};if(typeof n=="string"||n instanceof URL||ji(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]=Wi(n,...r);return{destination:t(Cu)(i,s,a),pipeOptions:a}}if(ye.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"),Cu=o(({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),"mapDestinationArguments"),P1=o((e,t)=>{try{return{sourceStream:er(e,t)}}catch(n){return{sourceError:n}}},"getSourceStream"),L1=o(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:a})=>{const u=k1({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(u!==void 0)throw Su({error:u,fileDescriptors:i,sourceOptions:s,startTime:a})},"handlePipeArgumentsError"),k1=o(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return Fu(e),r;if(t!==void 0)return gu(n),t},"getPipeArgumentsError"),Su=o(({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>mr({error:e,command:vu,escapedCommand:vu,fileDescriptors:t,options:n,startTime:r,isSync:!1}),"createNonCommandError"),vu="source.pipe(destination)",N1=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"),j1=o((e,t,n)=>{const r=Gt.has(t)?W1(e,t):U1(e,t);return Ct(e,z1,n.signal),Ct(t,V1,n.signal),G1(t),r},"pipeSubprocessStream"),U1=o((e,t)=>{const n=Tr([e]);return kt(n,t),Gt.set(t,n),n},"pipeFirstSubprocessStream"),W1=o((e,t)=>{const n=Gt.get(t);return n.add(e),n},"pipeMoreSubprocessStream"),G1=o(async e=>{try{await le(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Gt.delete(e)},"cleanupMergedStreamsMap"),Gt=new WeakMap,z1=2,V1=1,q1=o((e,t)=>e===void 0?[]:[K1(e,t)],"unpipeOnAbort"),K1=o(async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await Jc(e,t),await n.remove(t);const a=new Error("Pipe canceled by `unpipeSignal` option.");throw Su({error:a,fileDescriptors:r,sourceOptions:i,startTime:s})},"unpipeOnSignalAbort"),Ur=o((e,...t)=>{if(H(t[0]))return Ur.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});const{destination:n,...r}=M1(e,...t),i=Y1({...r,destination:n});return i.pipe=Ur.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},"pipeToSubprocess"),Y1=o(async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:a,unpipeSignal:u,fileDescriptors:c,startTime:d})=>{const l=H1(e,i);L1({sourceStream:t,sourceError:r,destinationStream:s,destinationError:a,fileDescriptors:c,sourceOptions:n,startTime:d});const f=new AbortController;try{const h=j1(t,s,f);return await Promise.race([N1(l),...q1(u,{sourceStream:t,mergedStream:h,sourceOptions:n,fileDescriptors:c,startTime:d})])}finally{f.abort()}},"handlePipePromise"),H1=o((e,t)=>Promise.allSettled([e,t]),"getSubprocessPromises"),$u=o(({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const a=new AbortController;return Z1(t,a),Bu({stream:e,controller:a,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},"iterateOnSubprocessStream"),Z1=o(async(e,t)=>{try{await e}catch{}finally{t.abort()}},"stopReadingOnExit"),Au=o(({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const a=new AbortController;J1(t,a,e);const u=e.readableObjectMode&&!s;return Bu({stream:e,controller:a,binary:r==="buffer",shouldEncode:!u,encoding:r,shouldSplit:!u&&n,preserveNewlines:!i})},"iterateForResult"),J1=o(async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},"stopReadingOnStreamEnd"),Bu=o(({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})=>{const u=ht(e,"data",{signal:t.signal,highWaterMark:xu,highWatermark:xu});return X1({onStdoutChunk:u,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})},"iterateOnStream"),Tu=pt(!0),xu=Tu,X1=o(async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a}){const u=Q1({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a});try{for await(const[c]of e)yield*et(c,u,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*$r(u)}},"iterateOnData"),Q1=o(({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Za(e,n,!t),Va(e,i,!r,{})].filter(Boolean),"getGenerators"),em=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=tm({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:u,verboseInfo:d,streamInfo:l});if(!i){await Promise.all([nm(e),f]);return}const h=za(c,n),D=Au({stream:e,onStreamEnd:t,lines:a,encoding:r,stripFinalNewline:h,allMixed:u}),[p]=await Promise.all([rm({stream:e,iterable:D,fdNumber:n,encoding:r,maxBuffer:s,lines:a}),f]);return p},"getStreamOutput"),tm=o(async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!nu({stdioItems:a[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const u=Au({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await w0(u,e,n,s)},"logOutputAsync"),nm=o(async e=>{await nl(),e.readableFlowing===null&&e.resume()},"resumeStream"),rm=o(async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:a})=>{try{return t||a?await Lp(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await Wp(n,{maxBuffer:s})):await Xp(n,{maxBuffer:s})}catch(u){return Iu(oD({error:u,stream:e,readableObjectMode:t,lines:a,encoding:i,fdNumber:r}))}},"getStreamContents"),Ou=o(async e=>{try{return await e}catch(t){return Iu(t)}},"getBufferedData"),Iu=o(({bufferedData:e})=>Dd(e)?new Uint8Array(e):e,"handleBufferedData"),Wr=o(async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=om(e,n),a=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],le(e,{cleanup:!0,signal:a.signal})])}catch(u){s.stdinCleanedUp||am(u,t,n,r)}finally{a.abort()}},"waitForStream"),om=o((e,{originalStreams:[t],subprocess:n})=>{const r={stdinCleanedUp:!1};return e===t&&im(e,n,r),r},"handleStdinDestroy"),im=o((e,t,n)=>{const{_destroy:r}=e;e._destroy=(...i)=>{sm(t,n),r.call(e,...i)}},"spyOnStdinDestroy"),sm=o(({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},"setStdinCleanedUp"),am=o((e,t,n,r)=>{if(!um(e,t,n,r))throw e},"handleStreamError"),um=o((e,t,n,r=!0)=>n.propagating?Ru(e)||Gr(e):(n.propagating=!0,Mu(n,t)===r?Ru(e):Gr(e)),"shouldIgnoreStreamError"),Mu=o(({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input","isInputFileDescriptor"),Gr=o(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isStreamAbort"),Ru=o(e=>e?.code==="EPIPE","isStreamEpipe"),cm=o(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:u})=>e.stdio.map((c,d)=>_u({stream:c,fdNumber:d,encoding:t,buffer:n[d],maxBuffer:r[d],lines:i[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:u})),"waitForStdioStreams"),_u=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=Wr(e,t,d);if(Mu(d,t)){await l;return}const[f]=await Promise.all([em({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"),lm=o(({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Tr([e,t].filter(Boolean)):void 0,"makeAllStream"),dm=o(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:u})=>_u({...fm(e,n),fdNumber:"all",encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:hm(e),stripFinalNewline:s,verboseInfo:a,streamInfo:u}),"waitForAllStream"),fm=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"),hm=o(({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,"getAllMixed"),pm=o(e=>In(e,"ipc"),"shouldLogIpc"),Dm=o((e,t)=>{const n=is(e);Ke({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:t})},"logIpcOutput"),mm=o(async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const a=pm(s),u=qe(t,"ipc"),c=qe(n,"ipc");for await(const d of su({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))u&&(sD(e,i,c),i.push(d)),a&&Dm(d,s);return i},"waitForIpcOutput"),gm=o(async(e,t)=>(await Promise.allSettled([e]),t),"getBufferedIpcOutput"),Fm=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:g,controller:F})=>{const w=T0(e,h),E={originalStreams:m,fileDescriptors:p,subprocess:e,exitPromise:w,propagating:!1},y=cm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:d,verboseInfo:D,streamInfo:E}),b=dm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:d,verboseInfo:D,streamInfo:E}),v=[],C=mm({subprocess:e,buffer:n,maxBuffer:r,ipc:l,ipcOutput:v,verboseInfo:D}),S=wm(m,e,E),O=ym(p,E);try{return await Promise.race([Promise.all([{},O0(w),Promise.all(y),b,C,hp(e,f),...S,...O]),g,Em(e,F),...ip(e,s,h,F),...ph({subprocess:e,cancelSignal:a,gracefulCancel:u,context:h,controller:F}),...tp({subprocess:e,cancelSignal:a,gracefulCancel:u,forceKillAfterDelay:c,context:h,controller:F})])}catch(G){return h.terminationReason??(h.terminationReason="other"),Promise.all([{error:G},w,Promise.all(y.map(N=>Ou(N))),Ou(b),gm(C,v),Promise.allSettled(S),Promise.allSettled(O)])}},"waitForSubprocessResult"),wm=o((e,t,n)=>e.map((r,i)=>r===t.stdio[i]?void 0:Wr(r,i,n)),"waitForOriginalStreams"),ym=o((e,t)=>e.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>be(s,{checkOpen:!1})&&!ge(s)).map(({type:i,value:s,stream:a=s})=>Wr(a,r,t,{isSameDirection:ve.has(i),stopOnExit:i==="native"}))),"waitForCustomStreamsEnd"),Em=o(async(e,{signal:t})=>{const[n]=await z(e,"error",{signal:t});throw n},"throwOnSubprocessError"),bm=o(()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),"initializeConcurrentStreams"),zr=o((e,t,n)=>{const r=e[n];r.has(t)||r.set(t,[]);const i=r.get(t),s=Ze();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},"addConcurrentStream"),zt=o(async({resolve:e,promises:t},n)=>{e();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},"waitForConcurrentStreams"),Pu=o(async e=>{if(e!==void 0)try{await Lu(e)}catch{}},"safeWaitForSubprocessStdin"),Cm=o(async e=>{if(e!==void 0)try{await ku(e)}catch{}},"safeWaitForSubprocessStdout"),Lu=o(async e=>{await le(e,{cleanup:!0,readable:!1,writable:!0})},"waitForSubprocessStdin"),ku=o(async e=>{await le(e,{cleanup:!0,readable:!0,writable:!1})},"waitForSubprocessStdout"),Nu=o(async(e,t)=>{if(await e,t)throw t},"waitForSubprocess"),ju=o((e,t,n)=>{n&&!Gr(n)?e.destroy(n):t&&e.destroy()},"destroyOtherStream"),Sm=o(({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||Ee.has(n),{subprocessStdout:u,waitReadableDestroy:c}=Uu(e,r,t),{readableEncoding:d,readableObjectMode:l,readableHighWaterMark:f}=Wu(u,a),{read:h,onStdoutDataDone:D}=Gu({subprocessStdout:u,subprocess:e,binary:a,encoding:n,preserveNewlines:s}),p=new me({read:h,destroy:Oe(Vu.bind(void 0,{subprocessStdout:u,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:l,encoding:d});return zu({subprocessStdout:u,onStdoutDataDone:D,readable:p,subprocess:e}),p},"createReadable"),Uu=o((e,t,n)=>{const r=er(e,t),i=zr(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},"getSubprocessStdout"),Wu=o(({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Tu},"getReadableOptions"),Gu=o(({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{const s=Ze(),a=$u({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){vm(this,a,s)},onStdoutDataDone:s}},"getReadableMethods"),vm=o(async(e,t,n)=>{try{const{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},"onRead"),zu=o(async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await ku(e),await r,await Pu(i),await t,n.readable&&n.push(null)}catch(s){await Pu(i),qu(n,s)}},"onStdoutFinished"),Vu=o(async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await zt(n,t)&&(qu(e,r),await Nu(t,r))},"onReadableDestroy"),qu=o((e,t)=>{ju(e,e.readable,t)},"destroyOtherReadable"),$m=o(({subprocess:e,concurrentStreams:t},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=Ku(e,n,t),a=new pn({...Yu(r,e,i),destroy:Oe(Zu.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Hu(r,a),a},"createWritable"),Ku=o((e,t,n)=>{const r=Ps(e,t),i=zr(n,r,"writableFinal"),s=zr(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},"getSubprocessStdin"),Yu=o((e,t,n)=>({write:Am.bind(void 0,e),final:Oe(Bm.bind(void 0,e,t,n))}),"getWritableMethods"),Am=o((e,t,n,r)=>{e.write(t,n)?r():e.once("drain",r)},"onWrite"),Bm=o(async(e,t,n)=>{await zt(n,t)&&(e.writable&&e.end(),await t)},"onWritableFinal"),Hu=o(async(e,t,n)=>{try{await Lu(e),t.writable&&t.end()}catch(r){await Cm(n),Ju(t,r)}},"onStdinFinished"),Zu=o(async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await zt(n,t),await zt(r,t)&&(Ju(e,i),await Nu(t,i))},"onWritableDestroy"),Ju=o((e,t)=>{ju(e,e.writable,t)},"destroyOtherWritable"),Tm=o(({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:a=!0}={})=>{const u=s||Ee.has(n),{subprocessStdout:c,waitReadableDestroy:d}=Uu(e,r,t),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:h}=Ku(e,i,t),{readableEncoding:D,readableObjectMode:p,readableHighWaterMark:m}=Wu(c,u),{read:g,onStdoutDataDone:F}=Gu({subprocessStdout:c,subprocess:e,binary:u,encoding:n,preserveNewlines:a}),w=new hn({read:g,...Yu(l,e,f),destroy:Oe(xm.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 zu({subprocessStdout:c,onStdoutDataDone:F,readable:w,subprocess:e,subprocessStdin:l}),Hu(l,w,c),w},"createDuplex"),xm=o(async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},a)=>{await Promise.all([Vu({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},a),Zu({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},a)])},"onDuplexDestroy"),Xu=o((e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||Ee.has(t),a=er(e,n),u=$u({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:i});return Om(u,a,e)},"createIterable"),Om=o(async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},"iterateOnStdoutData"),Im=o((e,{encoding:t})=>{const n=bm();e.readable=Sm.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=$m.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=Tm.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=Xu.bind(void 0,e,t),e[Symbol.asyncIterator]=Xu.bind(void 0,e,t,{})},"addConvertedStreams"),Mm=o((e,t)=>{for(const[n,r]of _m){const i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},"mergePromise"),Rm=(async()=>{})().constructor.prototype,_m=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Rm,e)]),Pm=o((e,t,n,r)=>{const{file:i,commandArguments:s,command:a,escapedCommand:u,startTime:c,verboseInfo:d,options:l,fileDescriptors:f}=Lm(e,t,n),{subprocess:h,promise:D}=Nm({file:i,commandArguments:s,options:l,startTime:c,verboseInfo:d,command:a,escapedCommand:u,fileDescriptors:f});return h.pipe=Ur.bind(void 0,{source:h,sourcePromise:D,boundOptions:{},createNested:r}),Mm(h,D),ye.set(h,{options:l,fileDescriptors:f}),h},"execaCoreAsync"),Lm=o((e,t,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=us(e,t,n),{file:u,commandArguments:c,options:d}=Js(e,t,n),l=km(d),f=s1(l,a);return{file:u,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:f}},"handleAsyncArguments"),km=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"),Nm=o(({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:a,fileDescriptors:u})=>{let c;try{c=Yc(...Xs(e,t,n))}catch(p){return e1({error:p,command:s,escapedCommand:a,fileDescriptors:u,options:n,startTime:r,verboseInfo:i})}const d=new AbortController;ol(Number.POSITIVE_INFINITY,d.signal);const l=[...c.stdio];E1(c,u,d),I1(c,n,d);const f={},h=Ze();c.kill=ch.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:h,context:f,controller:d}),c.all=lm(c,n),Im(c,n),X0(c,n);const D=jm({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"),jm=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,g]=await Fm({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:d,controller:l});l.abort(),d.resolve();const F=p.map((y,b)=>Pe(y,t,b)),w=Pe(m,t,"all"),E=Um({errorInfo:f,exitCode:h,signal:D,stdio:F,all:w,ipcOutput:g,context:c,options:t,command:a,escapedCommand:u,startTime:n});return Fr(E,r,t)},"handlePromise"),Um=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?gr({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 Me,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:s,options:u,startTime:l,isSync:!1}):Ea({command:c,escapedCommand:d,stdio:r,all:i,ipcOutput:s,options:u,startTime:l}),"getAsyncResult"),Vr=o((e,t)=>{const n=Object.fromEntries(Object.entries(t).map(([r,i])=>[r,Wm(r,e[r],i)]));return{...e,...n}},"mergeOptions"),Wm=o((e,t,n)=>Gm.has(e)&&H(t)&&H(n)?{...t,...n}:n,"mergeOption"),Gm=new Set(["env",...es]),Be=o((e,t,n,r)=>{const i=o((a,u,c)=>Be(a,u,n,c),"createNested"),s=o((...a)=>zm({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a),"boundExeca");return r!==void 0&&r(s,i,t),s},"createExeca"),zm=o(({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...a)=>{if(H(s))return i(e,Vr(n,s),r);const{file:u,commandArguments:c,options:d,isSync:l}=Vm({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:n});return l?_0(u,c,d):Pm(u,c,d,i)},"callBoundExeca"),Vm=o(({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=bd(t)?Cd(t,n):[t,...n],[a,u,c]=Wi(...s),d=Vr(Vr(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"),qm=o(({file:e,commandArguments:t})=>Qu(e,t),"mapCommandAsync"),Km=o(({file:e,commandArguments:t})=>({...Qu(e,t),isSync:!0}),"mapCommandSync"),Qu=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]=Ym(e);return{file:n,commandArguments:r}},"parseCommand"),Ym=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(Hm)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},"parseCommandString"),Hm=/ +/g,Zm=o((e,t,n)=>{e.sync=t(Xm,n),e.s=e.sync},"setScriptSync"),Jm=o(({options:e})=>ec(e),"mapScriptAsync"),Xm=o(({options:e})=>({...ec(e),isSync:!0}),"mapScriptSync"),ec=o(e=>({options:{...Qm(e),...e}}),"getScriptOptions"),Qm=o(({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},"getScriptStdinOption"),eg={preferLocal:!0},Ue=Be(()=>({}));Be(()=>({isSync:!0})),Be(qm),Be(Km),Be(ap),Be(Jm,{},eg,Zm),Q0();let Te=!0;const We=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let at=0;if(We.process&&We.process.env&&We.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:n,TERM:r,COLORTERM:i}=We.process.env;t||n||e==="0"?Te=!1:e==="1"||e==="2"||e==="3"?Te=!0:r==="dumb"?Te=!1:"CI"in We.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in We.process.env)?Te=!0:Te=process.stdout.isTTY,Te&&(process.platform==="win32"||i&&(i==="truecolor"||i==="24bit")?at=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?at=2:at=1)}let tc={enabled:Te,supportLevel:at};function ut(e,t,n=1){const r=`\x1B[${e}m`,i=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return a=>tc.enabled&&tc.supportLevel>=n?r+(""+a).replace(s,r)+i:""+a}o(ut,"kolorist");const qr=ut(2,22),nc=ut(30,39),Vt=ut(31,39),ct=ut(32,39),rc=ut(46,49);var Kr,oc;function tg(){if(oc)return Kr;oc=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 Kr={cursor:r,scroll:i,erase:s,beep:n},Kr}o(tg,"requireSrc");var j=tg(),ng=Object.defineProperty,rg=o((e,t,n)=>t in e?ng(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp"),U=o((e,t,n)=>rg(e,typeof t!="symbol"?t+"":t,n),"__publicField");function qt(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?qt(s,t<0?-1:1,n):s}o(qt,"x$1");const og=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,"at"),ig=o(e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,"lt"),sg=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,"ht"),Yr=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Kt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Yt=/\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"),Ht=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,ag=new RegExp("\\p{M}+","gu"),ug={limit:1/0,ellipsis:""},ic=o((e,t={},n={})=>{const r=t.limit??1/0,i=t.ellipsis??"",s=t?.ellipsisWidth??(i?ic(i,ug,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,g=e.length,F=0,w=!1,E=g,y=Math.max(0,r-s),b=0,v=0,C=0,S=0;e:for(;;){if(v>b||m>=g&&m>p){const O=e.slice(b,v)||e.slice(p,m);F=0;for(const G of O.replaceAll(ag,"")){const N=G.codePointAt(0)||0;if(ig(N)?S=f:sg(N)?S=D:d!==h&&og(N)?S=d:S=h,C+S>y&&(E=Math.min(E,Math.max(b,p)+F)),C+S>r){w=!0;break e}F+=G.length,C+=S}b=v=0}if(m>=g)break;if(Ht.lastIndex=m,Ht.test(e)){if(F=Ht.lastIndex-m,S=F*h,C+S>y&&(E=Math.min(E,m+Math.floor((y-C)/h))),C+S>r){w=!0;break}C+=S,b=p,v=m,m=p=Ht.lastIndex;continue}if(Yr.lastIndex=m,Yr.test(e)){if(C+a>y&&(E=Math.min(E,m)),C+a>r){w=!0;break}C+=a,b=p,v=m,m=p=Yr.lastIndex;continue}if(Kt.lastIndex=m,Kt.test(e)){if(F=Kt.lastIndex-m,S=F*u,C+S>y&&(E=Math.min(E,m+Math.floor((y-C)/u))),C+S>r){w=!0;break}C+=S,b=p,v=m,m=p=Kt.lastIndex;continue}if(Yt.lastIndex=m,Yt.test(e)){if(F=Yt.lastIndex-m,S=F*c,C+S>y&&(E=Math.min(E,m+Math.floor((y-C)/c))),C+S>r){w=!0;break}C+=S,b=p,v=m,m=p=Yt.lastIndex;continue}if(Hr.lastIndex=m,Hr.test(e)){if(C+l>y&&(E=Math.min(E,m)),C+l>r){w=!0;break}C+=l,b=p,v=m,m=p=Hr.lastIndex;continue}m+=1}return{width:w?y:C,index:w?E:g,truncated:w,ellipsed:w&&r>=s}},"X$1"),cg={limit:1/0,ellipsis:"",ellipsisWidth:0},lt=o((e,t={})=>ic(e,cg,t).width,"S"),Zt="\x1B",sc="\x9B",lg=39,Zr="\x07",ac="[",dg="]",uc="m",Jr=`${dg}8;;`,cc=new RegExp(`(?:\\${ac}(?<code>\\d+)m|\\${Jr}(?<uri>.*)${Zr})`,"y"),fg=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},"mt$1"),lc=o(e=>`${Zt}${ac}${e}${uc}`,"st"),dc=o(e=>`${Zt}${Jr}${e}${Zr}`,"it"),hg=o(e=>e.map(t=>lt(t)),"gt$1"),Xr=o((e,t,n)=>{const r=t[Symbol.iterator]();let i=!1,s=!1,a=e.at(-1),u=a===void 0?0:lt(a),c=r.next(),d=r.next(),l=0;for(;!c.done;){const f=c.value,h=lt(f);u+h<=n?e[e.length-1]+=f:(e.push(f),u=0),(f===Zt||f===sc)&&(i=!0,s=t.startsWith(Jr,l+1)),i?s?f===Zr&&(i=!1,s=!1):f===uc&&(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>0&&e.length>1&&(e[e.length-2]+=e.pop())},"G"),pg=o(e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(lt(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},"vt$1"),Dg=o((e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",i,s;const a=e.split(" "),u=hg(a);let c=[""];for(const[p,m]of a.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??"").trimStart());let g=lt(c.at(-1)??"");if(p!==0&&(g>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(""),g=0),(g>0||n.trim===!1)&&(c[c.length-1]+=" ",g++)),n.hard&&u[p]>t){const F=t-g,w=1+Math.floor((u[p]-F-1)/t);Math.floor((u[p]-1)/t)<w&&c.push(""),Xr(c,m,t);continue}if(g+u[p]>t&&g>0&&u[p]>0){if(n.wordWrap===!1&&g<t){Xr(c,m,t);continue}c.push("")}if(g+u[p]>t&&n.wordWrap===!1){Xr(c,m,t);continue}c[c.length-1]+=m}n.trim!==!1&&(c=c.map(p=>pg(p)));const d=c.join(`
|
|
65
65
|
`),l=d[Symbol.iterator]();let f=l.next(),h=l.next(),D=0;for(;!f.done;){const p=f.value,m=h.value;if(r+=p,p===Zt||p===sc){cc.lastIndex=D+1;const F=cc.exec(d)?.groups;if(F?.code!==void 0){const w=Number.parseFloat(F.code);i=w===lg?void 0:w}else F?.uri!==void 0&&(s=F.uri.length===0?void 0:F.uri)}const g=i?fg(i):void 0;m===`
|
|
66
66
|
`?(s&&(r+=dc("")),i&&g&&(r+=lc(g))):p===`
|
|
67
67
|
`&&(i&&g&&(r+=lc(i)),s&&(r+=dc(s))),D+=p.length,f=h,h=l.next()}return r},"Et$1");function Qr(e,t,n){return String(e).normalize().replaceAll(`\r
|
|
@@ -96,12 +96,12 @@ ${u}
|
|
|
96
96
|
`)},"Wt"),xe=o((e="",t)=>{const n=process.stdout,r=`${$("gray",k)}
|
|
97
97
|
${$("gray",ao)} `;n.write(`${r}${e}
|
|
98
98
|
|
|
99
|
-
`)},"Gt"),jg=o(e=>$("magenta",e),"Kt"),mo=o(({indicator:e="dots",onCancel:t,output:n=process.stdout,cancelMessage:r,errorMessage:i,frames:s=so?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=so?80:120,signal:u,...c}={})=>{const d=Eg();let l,f,h=!1,D=!1,p="",m,g=performance.now();const F=no(n),w=c?.styleFrame??jg,E=o(_=>{const Y=_>1?i??ae.messages.error:r??ae.messages.cancel;D=_===1,h&&(
|
|
99
|
+
`)},"Gt"),jg=o(e=>$("magenta",e),"Kt"),mo=o(({indicator:e="dots",onCancel:t,output:n=process.stdout,cancelMessage:r,errorMessage:i,frames:s=so?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=so?80:120,signal:u,...c}={})=>{const d=Eg();let l,f,h=!1,D=!1,p="",m,g=performance.now();const F=no(n),w=c?.styleFrame??jg,E=o(_=>{const Y=_>1?i??ae.messages.error:r??ae.messages.cancel;D=_===1,h&&(ze(Y,_),D&&typeof t=="function"&&t())},"v"),y=o(()=>E(2),"C"),b=o(()=>E(1),"A"),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)},"b"),C=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)},"w"),S=o(()=>{if(m===void 0)return;d&&n.write(`
|
|
100
100
|
`);const _=Do(m,F,{hard:!0,trim:!1}).split(`
|
|
101
101
|
`);_.length>1&&n.write(j.cursor.up(_.length-1)),n.write(j.cursor.to(0)),n.write(j.erase.down())},"S"),O=o(_=>_.replace(/\.+$/,""),"T"),G=o(_=>{const Y=(performance.now()-_)/1e3,re=Math.floor(Y/60),oe=Math.floor(Y%60);return re>0?`[${re}m ${oe}s]`:`[${oe}s]`},"M"),N=c.withGuide??ae.withGuide,Uc=o((_="")=>{h=!0,l=wg({output:n}),p=O(_),g=performance.now(),N&&n.write(`${$("gray",k)}
|
|
102
|
-
`);let Y=0,re=0;v(),f=setInterval(()=>{if(d&&p===m)return;S(),m=p;const oe=w(s[Y]);let ft;if(d)ft=`${oe} ${p}...`;else if(e==="timer")ft=`${oe} ${p} ${G(g)}`;else{const Gc=".".repeat(Math.floor(re)).slice(0,3);ft=`${oe} ${p}${Gc}`}const Wc=Do(ft,F,{hard:!0,trim:!1});n.write(Wc),Y=Y+1<s.length?Y+1:0,re=re<4?re+.125:0},a)},"le"),
|
|
102
|
+
`);let Y=0,re=0;v(),f=setInterval(()=>{if(d&&p===m)return;S(),m=p;const oe=w(s[Y]);let ft;if(d)ft=`${oe} ${p}...`;else if(e==="timer")ft=`${oe} ${p} ${G(g)}`;else{const Gc=".".repeat(Math.floor(re)).slice(0,3);ft=`${oe} ${p}${Gc}`}const Wc=Do(ft,F,{hard:!0,trim:!1});n.write(Wc),Y=Y+1<s.length?Y+1:0,re=re<4?re+.125:0},a)},"le"),ze=o((_="",Y=0,re=!1)=>{if(!h)return;h=!1,clearInterval(f),S();const oe=Y===0?$("green",mc):Y===1?$("red",pc):$("red",Dc);p=_??p,re||(e==="timer"?n.write(`${oe} ${p} ${G(g)}
|
|
103
103
|
`):n.write(`${oe} ${p}
|
|
104
|
-
`)),C(),l()},"k");return{start:Uc,stop:o((_="")=>
|
|
104
|
+
`)),C(),l()},"k");return{start:Uc,stop:o((_="")=>ze(_,0),"stop"),message:o((_="")=>{p=O(_??p)},"message"),cancel:o((_="")=>ze(_,1),"cancel"),error:o((_="")=>ze(_,2),"error"),clear:o(()=>ze("",0,!0),"clear"),get isCancelled(){return D}}},"be"),on=o((e,t)=>e.includes(`
|
|
105
105
|
`)?e.split(`
|
|
106
106
|
`).map(n=>t(n)).join(`
|
|
107
107
|
`):t(e),"oe"),Ug=o(e=>{const t=o((n,r)=>{const i=n.label??String(n.value);switch(r){case"disabled":return`${$("gray",Qt)} ${on(i,s=>$("gray",s))}${n.hint?` ${$("dim",`(${n.hint??"disabled"})`)}`:""}`;case"selected":return`${on(i,s=>$("dim",s))}`;case"active":return`${$("green",uo)} ${i}${n.hint?` ${$("dim",`(${n.hint})`)}`:""}`;case"cancelled":return`${on(i,s=>$(["strikethrough","dim"],s))}`;default:return`${$("dim",Qt)} ${on(i,s=>$("dim",s))}`}},"r");return new io({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){const n=e.withGuide??ae.withGuide,r=`${gc(this.state)} `,i=`${Sg(this.state)} `,s=ro(e.output,e.message,i,r),a=`${n?`${$("gray",k)}
|
|
@@ -115,11 +115,11 @@ ${c}
|
|
|
115
115
|
`).slice(1).join(`
|
|
116
116
|
`))),console.error(`
|
|
117
117
|
${go}${qr(`aicommit v${An.version}`)}`),console.error(`
|
|
118
|
-
${go}Please open a Bug report with the information above:`),console.error(`${go}https://github.com/NegoZiatoR/ai-commit/issues/new/choose`))},"handleCliError"),Fo=o(async()=>{const{stdout:e,failed:t}=await
|
|
118
|
+
${go}Please open a Bug report with the information above:`),console.error(`${go}https://github.com/NegoZiatoR/ai-commit/issues/new/choose`))},"handleCliError"),Fo=o(async()=>{const{stdout:e,failed:t}=await Ue("git",["rev-parse","--show-toplevel"],{reject:!1});if(t)throw new I("The current directory must be a Git repository!");return e},"assertGitRepo"),wo=o(e=>`:(exclude)${e}`,"excludeFromDiff"),$c=["package-lock.json","*.lock"].map(wo),Ac=o(async e=>{const t=["diff","--cached","--diff-algorithm=minimal"],{stdout:n}=await Ue("git",[...t,"--name-only",...$c,...e?e.map(wo):[]]);if(!n)return;const{stdout:r}=await Ue("git",[...t,...$c,...e?e.map(wo):[]]);return{files:n.split(`
|
|
119
119
|
`),diff:r}},"getStagedDiff"),Wg=o(e=>`Detected ${e.length.toLocaleString()} staged file${e.length>1?"s":""}`,"getDetectedMessage");var yo,Bc;function Gg(){if(Bc)return yo;Bc=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
|
|
120
120
|
`:`
|
|
121
121
|
`,l=c.whitespace?" = ":"=",f=[],h=c.sort?Object.keys(u).sort():Object.keys(u);let D=0;c.align&&(D=s(h.filter(g=>u[g]===null||Array.isArray(u[g])||typeof u[g]!="object").map(g=>Array.isArray(u[g])?`${g}[]`:g).concat([""]).reduce((g,F)=>s(g).length>=s(F).length?g:F)).length);let p="";const m=c.bracketedArray?"[]":"";for(const g of h){const F=u[g];if(F&&Array.isArray(F))for(const w of F)p+=s(`${g}${m}`).padEnd(D," ")+l+s(w)+d;else F&&typeof F=="object"?f.push(g):p+=s(g).padEnd(D," ")+l+s(F)+d}c.section&&p.length&&(p="["+s(c.section)+"]"+(c.newline?d+d:d)+p);for(const g of f){const F=n(g,".").join("\\."),w=(c.section?c.section+".":"")+F,E=t(u[g],{...c,section:w});p.length&&E.length&&(p+=d),p+=E}return p},"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,D=u.split(/[\r\n]+/g),p={};for(const g of D){if(!g||g.match(/^\s*[;#]/)||g.match(/^\s*$/))continue;const F=g.match(h);if(!F)continue;if(F[1]!==void 0){if(f=a(F[1]),f==="__proto__"){l=Object.create(null);continue}l=d[f]=d[f]||Object.create(null);continue}const w=a(F[2]);let E;c.bracketedArray?E=w.length>2&&w.slice(-2)==="[]":(p[w]=(p?.[w]||0)+1,E=p[w]>1);const y=E&&w.endsWith("[]")?w.slice(0,-2):w;if(y==="__proto__")continue;const b=F[3]?a(F[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 g of Object.keys(d)){if(!e.call(d,g)||typeof d[g]!="object"||Array.isArray(d[g]))continue;const F=n(g,".");l=d;const w=F.pop(),E=w.replace(/\\\./g,".");for(const y of F)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[g],m.push(g))}for(const g of m)delete d[g];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 yo={parse:r,decode:r,stringify:t,encode:t,safe:s,unsafe:a},yo}o(Gg,"requireIni");var zg=Gg(),Tc=cs(zg);const an=o(e=>W.lstat(e).then(()=>!0,()=>!1),"fileExists"),Eo=o(async e=>{try{let t;try{t=e||await Fo()}catch(a){if(a instanceof I&&a.message.includes("Git repository"))return;throw a}const n=ce.join(t,".ai-commit.json");if(!await an(n))return;const i=await W.readFile(n,"utf8");return JSON.parse(i)}catch(t){if(t instanceof I)throw t;return}},"getProjectConfig");function Vg(e){const t={},n=e.split(`
|
|
122
|
-
`);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(Vg,"parseEnvContent");async function xc(e){const{filename:t=".env",directory:n=process.cwd(),override:r=!1}=e||{},i=ce.join(n,t);if(!await an(i))return{};try{const a=await W.readFile(i,"utf8"),u=Vg(a);for(const[c,d]of Object.entries(u))(r||process.env[c]===void 0)&&(process.env[c]=d);return u}catch{return{}}}o(xc,"loadEnvFile");async function qg(){process.env.NODE_ENV==="test"?await xc({filename:".env.local"}):await xc({filename:".env"})}o(qg,"loadEnvironment");const Oc=["openai","anthropic","azure-openai","ollama","custom"],Kg=["","conventional"],{hasOwnProperty:Yg}=Object.prototype,Ic=o((e,t)=>Yg.call(e,t),"hasOwn"),R=o((e,t,n)=>{if(!t)throw new I(`Invalid config property ${e}: ${n}`)},"parseAssert"),un={provider(e){return e?(R("provider",Oc.includes(e),`Must be one of: ${Oc.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",Kg.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}},bo=ce.join(dl.homedir(),".aicommit"),Mc=o(async()=>{if(!await an(bo))return Object.create(null);const t=await W.readFile(bo,"utf8");return Tc.parse(t)},"readConfigFile"),Hg=o(e=>{const t=e.provider;switch(t){case"openai":if(!e.OPENAI_KEY)throw new I("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");break;case"anthropic":if(!e.ANTHROPIC_KEY)throw new I("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 I("Please set your Azure OpenAI API key via `aicommit config set AZURE_OPENAI_KEY=<your token>`");if(!e.AZURE_ENDPOINT)throw new I("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 I("Please set your custom endpoint via `aicommit config set CUSTOM_ENDPOINT=<your endpoint>`");break;default:throw new I(`Unknown provider: ${t}`)}},"validateProviderConfig"),Co=o(async(e,t)=>{await qg();const n=await Mc(),r=await Eo(),i={};for(const a of Object.keys(un)){const u=un[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||Hg(s),s},"getConfig"),Zg=o(async e=>{const t=await Mc();for(const[n,r]of e){if(!Ic(un,n))throw new I(`Invalid config property: ${n}`);const i=un[n](r);t[n]=i}await W.writeFile(bo,Tc.stringify(t),"utf8")},"setConfigs"),Rc={openai:o(()=>import("./openai-
|
|
122
|
+
`);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(Vg,"parseEnvContent");async function xc(e){const{filename:t=".env",directory:n=process.cwd(),override:r=!1}=e||{},i=ce.join(n,t);if(!await an(i))return{};try{const a=await W.readFile(i,"utf8"),u=Vg(a);for(const[c,d]of Object.entries(u))(r||process.env[c]===void 0)&&(process.env[c]=d);return u}catch{return{}}}o(xc,"loadEnvFile");async function qg(){process.env.NODE_ENV==="test"?await xc({filename:".env.local"}):await xc({filename:".env"})}o(qg,"loadEnvironment");const Oc=["openai","anthropic","azure-openai","ollama","custom"],Kg=["","conventional"],{hasOwnProperty:Yg}=Object.prototype,Ic=o((e,t)=>Yg.call(e,t),"hasOwn"),R=o((e,t,n)=>{if(!t)throw new I(`Invalid config property ${e}: ${n}`)},"parseAssert"),un={provider(e){return e?(R("provider",Oc.includes(e),`Must be one of: ${Oc.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",Kg.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}},bo=ce.join(dl.homedir(),".aicommit"),Mc=o(async()=>{if(!await an(bo))return Object.create(null);const t=await W.readFile(bo,"utf8");return Tc.parse(t)},"readConfigFile"),Hg=o(e=>{const t=e.provider;switch(t){case"openai":if(!e.OPENAI_KEY)throw new I("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");break;case"anthropic":if(!e.ANTHROPIC_KEY)throw new I("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 I("Please set your Azure OpenAI API key via `aicommit config set AZURE_OPENAI_KEY=<your token>`");if(!e.AZURE_ENDPOINT)throw new I("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 I("Please set your custom endpoint via `aicommit config set CUSTOM_ENDPOINT=<your endpoint>`");break;default:throw new I(`Unknown provider: ${t}`)}},"validateProviderConfig"),Co=o(async(e,t)=>{await qg();const n=await Mc(),r=await Eo(),i={};for(const a of Object.keys(un)){const u=un[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||Hg(s),s},"getConfig"),Zg=o(async e=>{const t=await Mc();for(const[n,r]of e){if(!Ic(un,n))throw new I(`Invalid config property: ${n}`);const i=un[n](r);t[n]=i}await W.writeFile(bo,Tc.stringify(t),"utf8")},"setConfigs"),Rc={openai:o(()=>import("./openai-CXIeQUC6.mjs"),"openai"),anthropic:o(()=>import("./anthropic-CMTD-N0Y.mjs"),"anthropic"),"azure-openai":o(()=>import("./azure-openai-CiUSPVuR.mjs"),"azure-openai"),ollama:o(()=>import("./ollama-DoBdy1Lw.mjs"),"ollama"),custom:o(()=>import("./custom-blUU1NGU.mjs"),"custom")};async function _c(e,t){const n=Rc[e];if(!n)throw new I(`Unknown provider type: ${e}. Supported providers: ${Object.keys(Rc).join(", ")}`);try{const i=(await n()).default;return new i(t)}catch(r){throw r instanceof I?r:r.code==="ERR_MODULE_NOT_FOUND"?new I(`Provider "${e}" is not yet implemented. Currently supported: openai`):new I(`Failed to initialize provider "${e}": ${r.message}`)}}o(_c,"createProvider");var Jg=o(async(e,t,n,r,i)=>(async()=>{vc(rc(nc(" aicommit "))),await Fo();const s=mo();n&&await Ue("git",["add","--update"]),s.start("Detecting staged files");const a=await Ac(t);if(!a)throw s.stop("Detecting staged files"),new I("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");s.stop(`${Wg(a.files)}:
|
|
123
123
|
${a.files.map(h=>` ${h}`).join(`
|
|
124
124
|
`)}`);const{env:u}=process,c=await Co({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=mo();d.start("The AI is analyzing your changes");let l;try{const h={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={...h,apiKey:c.OPENAI_KEY};break;case"anthropic":D={...h,apiKey:c.ANTHROPIC_KEY};break;case"azure-openai":D={...h,apiKey:c.AZURE_OPENAI_KEY,endpoint:c.AZURE_ENDPOINT};break;case"ollama":D={...h,endpoint:c.OLLAMA_ENDPOINT};break;case"custom":D={...h,endpoint:c.CUSTOM_ENDPOINT,apiKey:c.CUSTOM_KEY};break;default:D={...h,apiKey:c.OPENAI_KEY}}const p=await _c(c.provider,D),m=await Eo();l=(await p.generateCommitMessage({diff:a.diff,completions:c.generate,projectConfig:m})).messages}finally{d.stop("Changes analyzed")}if(l.length===0)throw new I("No commit messages were generated. Try again.");let f;if(l.length===1){[f]=l;let h;if(c["auto-confirm"]?(h=!0,xe(`${ct("\u2714")} Auto confirmed commit message.
|
|
125
125
|
|
|
@@ -127,7 +127,7 @@ ${a.files.map(h=>` ${h}`).join(`
|
|
|
127
127
|
`)):h=await Ng({message:`Use this commit message?
|
|
128
128
|
|
|
129
129
|
${f}
|
|
130
|
-
`}),!h||fc(h)){xe("Commit cancelled");return}}else{const h=await Ug({message:`Pick a commit message to use: ${qr("(Ctrl+c to exit)")}`,options:l.map(D=>({label:D,value:D}))});if(fc(h)){xe("Commit cancelled");return}f=h}if(c["prepend-reference"]){const{stdout:h}=await
|
|
130
|
+
`}),!h||fc(h)){xe("Commit cancelled");return}}else{const h=await Ug({message:`Pick a commit message to use: ${qr("(Ctrl+c to exit)")}`,options:l.map(D=>({label:D,value:D}))});if(fc(h)){xe("Commit cancelled");return}f=h}if(c["prepend-reference"]){const{stdout:h}=await Ue("git",["branch","--show-current"]),D=h.match(/([a-zA-Z])+-([0-9]+)/)?.[0];D?.length&&(f=`${D?.toUpperCase()}: ${f}`)}await Ue("git",["commit","-m",f,...i]),xe(`${ct("\u2714")} Successfully committed!`)})().catch(s=>{xe(`${Vt("\u2716")} ${s.message}`),sn(s),process.exit(1)}),"aicommit");const[So,Xg]=process.argv.slice(2);var Qg=o(()=>(async()=>{if(!So)throw new I('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(Xg)return;const e=await Ac();if(!e)return;vc(rc(nc(" aicommit ")));const{env:t}=process,n=await Co({proxy:t.https_proxy||t.HTTPS_PROXY||t.http_proxy||t.HTTP_PROXY}),r=mo();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 _c(n.provider,l),h=await Eo();i=(await f.generateCommitMessage({diff:e.diff,completions:n.generate,projectConfig:h})).messages}finally{r.stop("Changes analyzed")}const a=await W.readFile(So,"utf8")!=="",u=i.length>1;let c="";a&&(c=`# \u{1F916} AI generated commit${u?"s":""}
|
|
131
131
|
`),u?(a&&(c+=`# Select one of the following messages by uncommeting:
|
|
132
132
|
`),c+=`
|
|
133
133
|
${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-CNTPumTf.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-CNTPumTf.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-CNTPumTf.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-CNTPumTf.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
|
|