@nice-move/cli 0.11.26 → 0.11.27

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.
@@ -0,0 +1 @@
1
+ import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=e=>{let t={};for(var r in e)n(t,r,{get:e[r],enumerable:!0});return t},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=e(import.meta.url);export{s as __commonJSMin,c as __export,d as __require,u as __toESM};
@@ -1 +1 @@
1
- import{ansi_styles_default as e,stringWidth as t}from"./string-width-B0yJp9KT.mjs";function n(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,i=[`\x1B`,`›`],a=e=>`${i[0]}[${e}m`,o=(t,n,r)=>{let i=[];t=[...t];for(let r of t){let o=r;r.includes(`;`)&&(r=r.split(`;`)[0][0]+`0`);let s=e.codes.get(Number.parseInt(r,10));if(s){let e=t.indexOf(s.toString());e===-1?i.push(a(n?s:o)):t.splice(e,1)}else if(n){i.push(a(0));break}else i.push(a(o))}if(n&&(i=i.filter((e,t)=>i.indexOf(e)===t),r!==void 0)){let t=a(e.codes.get(Number.parseInt(r,10)));i=i.reduce((e,n)=>n===t?[n,...e]:[...e,n],[])}return i.join(``)};function s(e,t,a){let s=[...e],c=[],l=typeof a==`number`?a:s.length,u=!1,d,f=0,p=``;for(let[m,h]of s.entries()){let s=!1;if(i.includes(h)){let t=/\d[^m]*/.exec(e.slice(m,m+18));d=t&&t.length>0?t[0]:void 0,f<l&&(u=!0,d!==void 0&&c.push(d))}else u&&h===`m`&&(u=!1,s=!0);if(!u&&!s&&f++,!r.test(h)&&n(h.codePointAt())&&(f++,typeof a!=`number`&&l++),f>t&&f<=l)p+=h;else if(f===t&&!u&&d!==void 0)p=o(c);else if(f>=l){p+=o(c,!0,d);break}}return p}function c(e,t,n){if(e.charAt(t)===` `)return t;let r=n?1:-1;for(let n=0;n<=3;n++){let i=t+n*r;if(e.charAt(i)===` `)return i}return t}function l(e,n,r={}){let{position:i=`end`,space:a=!1,preferTruncationOnSpace:o=!1}=r,{truncationCharacter:l=`…`}=r;if(typeof e!=`string`)throw TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof n!=`number`)throw TypeError(`Expected \`columns\` to be a number, got ${typeof n}`);if(n<1)return``;if(n===1)return l;let u=t(e);if(u<=n)return e;if(i===`start`){if(o){let t=c(e,u-n+1,!0);return l+s(e,t,u).trim()}return a===!0&&(l+=` `),l+s(e,u-n+t(l),u)}if(i===`middle`){a===!0&&(l=` ${l} `);let r=Math.floor(n/2);if(o){let t=c(e,r),i=c(e,u-(n-r)+1,!0);return s(e,0,t)+l+s(e,i,u).trim()}return s(e,0,r)+l+s(e,u-(n-r)+t(l),u)}if(i===`end`){if(o){let t=c(e,n-1);return s(e,0,t)+l}return a===!0&&(l=` ${l}`),s(e,0,n-t(l))+l}throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${i}`)}export{l as default};
1
+ import{ansi_styles_default as e,stringWidth as t}from"./string-width-CpYKfSIt.mjs";function n(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,i=[`\x1B`,`›`],a=e=>`${i[0]}[${e}m`,o=(t,n,r)=>{let i=[];t=[...t];for(let r of t){let o=r;r.includes(`;`)&&(r=r.split(`;`)[0][0]+`0`);let s=e.codes.get(Number.parseInt(r,10));if(s){let e=t.indexOf(s.toString());e===-1?i.push(a(n?s:o)):t.splice(e,1)}else if(n){i.push(a(0));break}else i.push(a(o))}if(n&&(i=i.filter((e,t)=>i.indexOf(e)===t),r!==void 0)){let t=a(e.codes.get(Number.parseInt(r,10)));i=i.reduce((e,n)=>n===t?[n,...e]:[...e,n],[])}return i.join(``)};function s(e,t,a){let s=[...e],c=[],l=typeof a==`number`?a:s.length,u=!1,d,f=0,p=``;for(let[m,h]of s.entries()){let s=!1;if(i.includes(h)){let t=/\d[^m]*/.exec(e.slice(m,m+18));d=t&&t.length>0?t[0]:void 0,f<l&&(u=!0,d!==void 0&&c.push(d))}else u&&h===`m`&&(u=!1,s=!0);if(!u&&!s&&f++,!r.test(h)&&n(h.codePointAt())&&(f++,typeof a!=`number`&&l++),f>t&&f<=l)p+=h;else if(f===t&&!u&&d!==void 0)p=o(c);else if(f>=l){p+=o(c,!0,d);break}}return p}function c(e,t,n){if(e.charAt(t)===` `)return t;let r=n?1:-1;for(let n=0;n<=3;n++){let i=t+n*r;if(e.charAt(i)===` `)return i}return t}function l(e,n,r={}){let{position:i=`end`,space:a=!1,preferTruncationOnSpace:o=!1}=r,{truncationCharacter:l=`…`}=r;if(typeof e!=`string`)throw TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof n!=`number`)throw TypeError(`Expected \`columns\` to be a number, got ${typeof n}`);if(n<1)return``;if(n===1)return l;let u=t(e);if(u<=n)return e;if(i===`start`){if(o){let t=c(e,u-n+1,!0);return l+s(e,t,u).trim()}return a===!0&&(l+=` `),l+s(e,u-n+t(l),u)}if(i===`middle`){a===!0&&(l=` ${l} `);let r=Math.floor(n/2);if(o){let t=c(e,r),i=c(e,u-(n-r)+1,!0);return s(e,0,t)+l+s(e,i,u).trim()}return s(e,0,r)+l+s(e,u-(n-r)+t(l),u)}if(i===`end`)return o?s(e,0,c(e,n-1))+l:(a===!0&&(l=` ${l}`),s(e,0,n-t(l))+l);throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${i}`)}export{l as default};
package/dist/cli.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{execa as e,git_hooks_exports as t}from"./git-hooks-DAgct2kR.mjs";import"./path-key-DNlqev5T.mjs";import"./mjs-D7OvYRUm.mjs";import{isReachable as n,lint_exports as r}from"./lint-BoG2Et94.mjs";import{createRequire as i}from"node:module";import{Cheetor as a}from"cheetor";function o(){if(n(`svgo/package.json`)&&n(`svgo-config/package.json`))return{command:`svgo`,describe:"Run `svgo` to optimize `*.svg`",handler({_:[t,n=`./`]}){let r=i(import.meta.url);e(`svgo`,[`-r`,`-q`,`--pretty`,`--indent`,`2`,`--config`,r.resolve(`svgo-config`),`-f`,n]).then(()=>{console.log(`Done: calling svgo`)}).catch(e=>{process.exitCode=1,console.error(`Error:`,e.message)})}}}process.on(`SIGINT`,()=>{}),new a(`../package.json`,import.meta.url).website(`https://www.npmjs.com/org/nice-move`).command(r).command(t).commandSmart(o).setup();
2
+ import{execa as e,git_hooks_exports as t}from"./git-hooks-BpwGIf4v.mjs";import"./path-key-C3gZowtU.mjs";import"./mjs-D7OvYRUm.mjs";import{isReachable as n,lint_exports as r}from"./lint-SGS8JQwJ.mjs";import{createRequire as i}from"node:module";import{Cheetor as a}from"cheetor";function o(){if(n(`svgo/package.json`)&&n(`svgo-config/package.json`))return{command:`svgo`,describe:"Run `svgo` to optimize `*.svg`",handler({_:[t,n=`./`]}){e(`svgo`,[`-r`,`-q`,`--pretty`,`--indent`,`2`,`--config`,i(import.meta.url).resolve(`svgo-config`),`-f`,n]).then(()=>{console.log(`Done: calling svgo`)}).catch(e=>{process.exitCode=1,console.error(`Error:`,e.message)})}}}process.on(`SIGINT`,()=>{}),new a(`../package.json`,import.meta.url).website(`https://www.npmjs.com/org/nice-move`).command(r).command(t).commandSmart(o).setup();export{};
package/dist/cmd/git.mjs CHANGED
@@ -1 +1 @@
1
- import{builder as e,command as t,description as n}from"../git-hooks-DAgct2kR.mjs";import"../path-key-DNlqev5T.mjs";import"../mjs-D7OvYRUm.mjs";export{e as builder,t as command,n as description};
1
+ import{builder as e,command as t,description as n}from"../git-hooks-BpwGIf4v.mjs";import"../path-key-C3gZowtU.mjs";import"../mjs-D7OvYRUm.mjs";export{e as builder,t as command,n as description};
package/dist/cmd/lint.mjs CHANGED
@@ -1 +1 @@
1
- import{builder as e,command as t,description as n}from"../lint-BoG2Et94.mjs";export{e as builder,t as command,n as description};
1
+ import{builder as e,command as t,description as n}from"../lint-SGS8JQwJ.mjs";export{e as builder,t as command,n as description};
@@ -0,0 +1,35 @@
1
+ import{__export as e,__toESM as t}from"./chunk-CqRdhuxo.mjs";import{pathKey as n,require_cross_spawn as r}from"./path-key-C3gZowtU.mjs";import{onExit as i}from"./mjs-D7OvYRUm.mjs";import{fileURLToPath as a}from"node:url";import{ChildProcess as o,execFile as s,spawn as c,spawnSync as l}from"node:child_process";import{StringDecoder as u}from"node:string_decoder";import{aborted as d,callbackify as f,debuglog as p,inspect as m,promisify as h,stripVTControlCharacters as g}from"node:util";import _,{execArgv as v,execPath as y,hrtime as b,platform as x}from"node:process";import S from"node:tty";import C from"node:path";import{scheduler as w,setImmediate as ee,setTimeout as te}from"node:timers/promises";import{constants as T}from"node:os";import{EventEmitter as ne,addAbortListener as re,on as ie,once as E,setMaxListeners as ae}from"node:events";import{serialize as oe}from"node:v8";import{appendFileSync as se,createReadStream as ce,createWriteStream as le,readFileSync as ue,statSync as de,writeFileSync as fe}from"node:fs";import{finished as D}from"node:stream/promises";import{Duplex as pe,PassThrough as me,Readable as O,Transform as he,Writable as ge,getDefaultHighWaterMark as _e}from"node:stream";import{Buffer as ve}from"node:buffer";function k(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const ye=(e,t)=>{let n=Se(be(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},be=e=>xe(e)?e.toString():e,xe=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Se=e=>e instanceof URL?a(e):e,Ce=(e,t=[],n={})=>{let r=ye(e,`First argument`),[i,a]=k(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!k(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]},{toString:we}=Object.prototype,Te=e=>we.call(e)===`[object ArrayBuffer]`,A=e=>we.call(e)===`[object Uint8Array]`,j=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ee=new TextEncoder,De=e=>Ee.encode(e),Oe=new TextDecoder,ke=e=>Oe.decode(e),Ae=(e,t)=>je(e,t).join(``),je=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new u(t),r=e.map(e=>typeof e==`string`?De(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Me=e=>e.length===1&&A(e[0])?e[0]:Pe(Ne(e)),Ne=e=>e.map(e=>typeof e==`string`?De(e):e),Pe=e=>{let t=new Uint8Array(Fe(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Fe=e=>{let t=0;for(let n of e)t+=n.length;return t},Ie=e=>Array.isArray(e)&&Array.isArray(e.raw),Le=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=Re({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},Re=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=ze(i,e.raw[r]),c=He(n,a,o);if(r===t.length)return c;let l=t[r];return He(c,Array.isArray(l)?l.map(e=>Ue(e)):[Ue(l)],s)},ze=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=Be.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(Be.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
2
+ `?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=Ve[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},Be=new Set([` `,` `,`\r`,`
3
+ `]),Ve={x:3,u:5},He=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Ue=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(k(e)&&(`stdout`in e||`isMaxBuffer`in e))return We(e);throw e instanceof o||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},We=({stdout:e})=>{if(typeof e==`string`)return e;if(A(e))return ke(e);throw e===void 0?TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):TypeError(`Unexpected "${typeof e}" stdout in template expression`)},M=e=>Ge.includes(e),Ge=[_.stdin,_.stdout,_.stderr],N=[`stdin`,`stdout`,`stderr`],Ke=e=>N[e]??`stdio[${e}]`,qe=e=>{let t={...e};for(let n of at)t[n]=Je(e,n);return t},Je=(e,t)=>{let n=Array.from({length:Ye(e)+1});return rt(Xe(e[t],n,t),t)},Ye=({stdio:e})=>Array.isArray(e)?Math.max(e.length,N.length):N.length,Xe=(e,t,n)=>k(e)?Ze(e,t,n):t.fill(e),Ze=(e,t,n)=>{for(let r of Object.keys(e).sort(Qe))for(let i of et(r,n,t))t[i]=e[r];return t},Qe=(e,t)=>$e(e)<$e(t)?1:-1,$e=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,et=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=tt(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
4
+ It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
5
+ Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},tt=e=>{if(e===`all`)return e;if(N.includes(e))return N.indexOf(e);let t=nt.exec(e);if(t!==null)return Number(t[1])},nt=/^fd(\d+)$/,rt=(e,t)=>e.map(e=>e===void 0?it[t]:e),it={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:p(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},at=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],P=(e,t)=>t===`ipc`?e.at(-1):e[t],ot=({verbose:e},t)=>lt(e,t)!==`none`,st=({verbose:e},t)=>![`none`,`short`].includes(lt(e,t)),ct=({verbose:e},t)=>{let n=lt(e,t);return dt(n)?n:void 0},lt=(e,t)=>t===void 0?ut(e):P(e,t),ut=e=>e.find(e=>dt(e))??ft.findLast(t=>e.includes(t)),dt=e=>typeof e==`function`,ft=[`none`,`short`,`full`],pt=(e,t)=>{let n=[e,...t];return{command:n.join(` `),escapedCommand:n.map(e=>bt(ht(e))).join(` `)}},mt=e=>g(e).split(`
6
+ `).map(e=>ht(e)).join(`
7
+ `),ht=e=>e.replaceAll(_t,e=>gt(e)),gt=e=>{let t=vt[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=yt?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},_t=(()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),vt={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},yt=65535,bt=e=>xt.test(e)?e:x===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,xt=/^[\w./-]+$/;function St(){let{env:e}=_,{TERM:t,TERM_PROGRAM:n}=e;return _.platform===`win32`?!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask===`{cmd::Cmder}`||n===`Terminus-Sublime`||n===`vscode`||t===`xterm-256color`||t===`alacritty`||t===`rxvt-unicode`||t===`rxvt-unicode-256color`||e.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t!==`linux`}const Ct={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},wt={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},Tt={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},Et={...Ct,...wt},Dt={...Ct,...Tt};var Ot=St()?Et:Dt;Object.entries(wt);const kt=S?.WriteStream?.prototype?.hasColors?.()??!1,F=(e,t)=>{if(!kt)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}};F(0,0);const At=F(1,22);F(2,22),F(3,23),F(4,24),F(53,55),F(7,27),F(8,28),F(9,29),F(30,39),F(31,39),F(32,39),F(33,39),F(34,39),F(35,39),F(36,39),F(37,39);const jt=F(90,39);F(40,49),F(41,49),F(42,49),F(43,49),F(44,49),F(45,49),F(46,49),F(47,49),F(100,49);const Mt=F(91,39);F(92,39);const Nt=F(93,39);F(94,39),F(95,39),F(96,39),F(97,39),F(101,49),F(102,49),F(103,49),F(104,49),F(105,49),F(106,49),F(107,49);const Pt=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=Ft(n),c=Rt[e]({failed:a,reject:o,piped:r}),l=Bt[e]({reject:o});return`${jt(`[${s}]`)} ${jt(`[${i}]`)} ${l(c)} ${l(t)}`},Ft=e=>`${It(e.getHours(),2)}:${It(e.getMinutes(),2)}:${It(e.getSeconds(),2)}.${It(e.getMilliseconds(),3)}`,It=(e,t)=>String(e).padStart(t,`0`),Lt=({failed:e,reject:t})=>e?t?Ot.cross:Ot.warning:Ot.tick,Rt={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:Lt,duration:Lt},zt=e=>e,Bt={command:()=>At,output:()=>zt,ipc:()=>zt,error:({reject:e})=>e?Mt:Nt,duration:()=>jt},Vt=(e,t,n)=>{let r=ct(t,n);return e.map(({verboseLine:e,verboseObject:t})=>Ht(e,t,r)).filter(e=>e!==void 0).map(e=>Ut(e)).join(``)},Ht=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},Ut=e=>e.endsWith(`
8
+ `)?e:`${e}\n`,I=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=Vt(Gt(t,Wt({type:e,result:i,verboseInfo:r})),r,n);a!==``&&console.warn(a.slice(0,-1))},Wt=({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...a}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:t,options:a}),Gt=(e,t)=>e.split(`
9
+ `).map(e=>Kt({...t,message:e})),Kt=e=>({verboseLine:Pt(e),verboseObject:e}),qt=e=>mt(typeof e==`string`?e:m(e)).replaceAll(` `,` `.repeat(Jt)),Jt=2,Yt=(e,t)=>{ot(t)&&I({type:`command`,verboseMessage:e,verboseInfo:t})},Xt=(e,t,n)=>($t(e),{verbose:e,escapedCommand:t,commandId:Zt(e),rawOptions:n}),Zt=e=>ot({verbose:e})?Qt++:void 0;let Qt=0n;const $t=e=>{for(let t of e){if(t===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!ft.includes(t)&&!dt(t)){let e=ft.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},en=()=>b.bigint(),tn=e=>Number(b.bigint()-e)/1e6,nn=(e,t,n)=>{let r=en(),{command:i,escapedCommand:a}=pt(e,t),o=Xt(Je(n,`verbose`),a,{...n});return Yt(a,o),{command:i,escapedCommand:a,startTime:r,verboseInfo:o}};h(s);function rn(e){return e instanceof URL?a(e):e}function an(e){return{*[Symbol.iterator](){let t=C.resolve(rn(e)),n;for(;n!==t;)yield t,n=t,t=C.resolve(t,`..`)}}}const on=({cwd:e=_.cwd(),path:t=_.env[n()],preferLocal:r=!0,execPath:i=_.execPath,addExecPath:a=!0}={})=>{let o=C.resolve(rn(e)),s=[],c=t.split(C.delimiter);return r&&sn(s,c,o),a&&cn(s,c,i,o),t===``||t===C.delimiter?`${s.join(C.delimiter)}${t}`:[...s,t].join(C.delimiter)},sn=(e,t,n)=>{for(let r of an(n)){let n=C.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},cn=(e,t,n,r)=>{let i=C.resolve(r,rn(n),`..`);t.includes(i)||e.push(i)},ln=({env:e=_.env,...t}={})=>{e={...e};let r=n({env:e});return t.path=e[r],e[r]=on(t),e},un=(e,t,n)=>new(n?gn:hn)(t,e instanceof L?{}:{cause:e});var L=class extends Error{};const dn=(e,t)=>{Object.defineProperty(e.prototype,`name`,{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,pn,{value:!0,writable:!1,enumerable:!1,configurable:!1})},fn=e=>mn(e)&&pn in e,pn=Symbol(`isExecaError`),mn=e=>Object.prototype.toString.call(e)===`[object Error]`;var hn=class extends Error{};dn(hn,hn.name);var gn=class extends Error{};dn(gn,gn.name);const _n=()=>{let e=bn-yn+1;return Array.from({length:e},vn)},vn=(e,t)=>({name:`SIGRT${t+1}`,number:yn+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),yn=34,bn=64,xn=[{name:`SIGHUP`,number:1,action:`terminate`,description:`Terminal closed`,standard:`posix`},{name:`SIGINT`,number:2,action:`terminate`,description:`User interruption with CTRL-C`,standard:`ansi`},{name:`SIGQUIT`,number:3,action:`core`,description:`User interruption with CTRL-\\`,standard:`posix`},{name:`SIGILL`,number:4,action:`core`,description:`Invalid machine instruction`,standard:`ansi`},{name:`SIGTRAP`,number:5,action:`core`,description:`Debugger breakpoint`,standard:`posix`},{name:`SIGABRT`,number:6,action:`core`,description:`Aborted`,standard:`ansi`},{name:`SIGIOT`,number:6,action:`core`,description:`Aborted`,standard:`bsd`},{name:`SIGBUS`,number:7,action:`core`,description:`Bus error due to misaligned, non-existing address or paging error`,standard:`bsd`},{name:`SIGEMT`,number:7,action:`terminate`,description:`Command should be emulated but is not implemented`,standard:`other`},{name:`SIGFPE`,number:8,action:`core`,description:`Floating point arithmetic error`,standard:`ansi`},{name:`SIGKILL`,number:9,action:`terminate`,description:`Forced termination`,standard:`posix`,forced:!0},{name:`SIGUSR1`,number:10,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGSEGV`,number:11,action:`core`,description:`Segmentation fault`,standard:`ansi`},{name:`SIGUSR2`,number:12,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGPIPE`,number:13,action:`terminate`,description:`Broken pipe or socket`,standard:`posix`},{name:`SIGALRM`,number:14,action:`terminate`,description:`Timeout or timer`,standard:`posix`},{name:`SIGTERM`,number:15,action:`terminate`,description:`Termination`,standard:`ansi`},{name:`SIGSTKFLT`,number:16,action:`terminate`,description:`Stack is empty or overflowed`,standard:`other`},{name:`SIGCHLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`posix`},{name:`SIGCLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`other`},{name:`SIGCONT`,number:18,action:`unpause`,description:`Unpaused`,standard:`posix`,forced:!0},{name:`SIGSTOP`,number:19,action:`pause`,description:`Paused`,standard:`posix`,forced:!0},{name:`SIGTSTP`,number:20,action:`pause`,description:`Paused using CTRL-Z or "suspend"`,standard:`posix`},{name:`SIGTTIN`,number:21,action:`pause`,description:`Background process cannot read terminal input`,standard:`posix`},{name:`SIGBREAK`,number:21,action:`terminate`,description:`User interruption with CTRL-BREAK`,standard:`other`},{name:`SIGTTOU`,number:22,action:`pause`,description:`Background process cannot write to terminal output`,standard:`posix`},{name:`SIGURG`,number:23,action:`ignore`,description:`Socket received out-of-band data`,standard:`bsd`},{name:`SIGXCPU`,number:24,action:`core`,description:`Process timed out`,standard:`bsd`},{name:`SIGXFSZ`,number:25,action:`core`,description:`File too big`,standard:`bsd`},{name:`SIGVTALRM`,number:26,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGPROF`,number:27,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGWINCH`,number:28,action:`ignore`,description:`Terminal window size changed`,standard:`bsd`},{name:`SIGIO`,number:29,action:`terminate`,description:`I/O is available`,standard:`other`},{name:`SIGPOLL`,number:29,action:`terminate`,description:`Watched event`,standard:`other`},{name:`SIGINFO`,number:29,action:`ignore`,description:`Request for process information`,standard:`other`},{name:`SIGPWR`,number:30,action:`terminate`,description:`Device running out of power`,standard:`systemv`},{name:`SIGSYS`,number:31,action:`core`,description:`Invalid system call`,standard:`other`},{name:`SIGUNUSED`,number:31,action:`terminate`,description:`Invalid system call`,standard:`other`}],Sn=()=>{let e=_n();return[...xn,...e].map(Cn)},Cn=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=T,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},wn=()=>{let e=Sn();return Object.fromEntries(e.map(Tn))},Tn=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o}],En=wn(),Dn=()=>{let e=Sn(),t=Array.from({length:65},(t,n)=>On(n,e));return Object.assign({},...t)},On=(e,t)=>{let n=kn(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},kn=(e,t)=>{let n=t.find(({name:t})=>T.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};Dn();const An=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Mn(e,t)},jn=e=>e===0?e:Mn(e,"`subprocess.kill()`'s argument"),Mn=(e,t)=>{if(Number.isInteger(e))return Nn(e,t);if(typeof e==`string`)return Fn(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${In()}`)},Nn=(e,t)=>{if(Pn.has(e))return Pn.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${In()}`)},Pn=(()=>new Map(Object.entries(T.signals).reverse().map(([e,t])=>[t,e])))(),Fn=(e,t)=>{if(e in T.signals)return e;throw e.toUpperCase()in T.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${In()}`)},In=()=>`Available signal names: ${Ln()}.
10
+ Available signal numbers: ${Rn()}.`,Ln=()=>Object.keys(T.signals).sort().map(e=>`'${e}'`).join(`, `),Rn=()=>[...new Set(Object.values(T.signals).sort((e,t)=>e-t))].join(`, `),zn=e=>En[e].description,Bn=e=>{if(e===!1)return e;if(e===!0)return Vn;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Vn=1e3*5,Hn=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Un(o,s,n);Wn(l,r);let u=e(c);return Gn({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Un=(e,t,n)=>{let[r=n,i]=mn(e)?[void 0,e]:[e,t];if(typeof r!=`string`&&!Number.isInteger(r))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!mn(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:jn(r),error:i}},Wn=(e,t)=>{e!==void 0&&t.reject(e)},Gn=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&Kn({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},Kn=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await te(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??=!0)}catch{}},qn=async(e,t)=>{e.aborted||await E(e,`abort`,{signal:t})},Jn=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Yn=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[Xn(e,t,r,i)],Xn=async(e,t,n,{signal:r})=>{throw await qn(t,r),n.terminationReason??=`cancel`,e.kill(),t.reason},Zn=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{Qn(e,t,n),$n(e,t,r)},Qn=(e,t,n)=>{if(!n)throw Error(`${R(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},$n=(e,t,n)=>{if(!n)throw Error(`${R(e,t)} cannot be used: the ${z(t)} has already exited or disconnected.`)},er=e=>{throw Error(`${R(`getOneMessage`,e)} could not complete: the ${z(e)} exited or disconnected.`)},tr=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} is sending a message too, instead of listening to incoming messages.
11
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
12
+
13
+ const [receivedMessage] = await Promise.all([
14
+ ${R(`getOneMessage`,e)},
15
+ ${R(`sendMessage`,e,`message, {strict: true}`)},
16
+ ]);`)},nr=(e,t)=>Error(`${R(`sendMessage`,t)} failed when sending an acknowledgment response to the ${z(t)}.`,{cause:e}),rr=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} is not listening to incoming messages.`)},ir=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} exited without listening to incoming messages.`)},ar=()=>Error(`\`cancelSignal\` aborted: the ${z(!0)} disconnected.`),or=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},sr=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${R(t,n)} cannot be used: the ${z(n)} is disconnecting.`,{cause:e})},cr=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(lr(e))throw Error(`${R(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},lr=({code:e,message:t})=>ur.has(e)||dr.some(e=>t.includes(e)),ur=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),dr=[`could not be cloned`,`circular structure`,`call stack size exceeded`],R=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${fr(t)}${e}(${n})`,fr=e=>e?``:`subprocess.`,z=e=>e?`parent process`:`subprocess`,pr=e=>{e.connected&&e.disconnect()},B=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},mr=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=V.get(e),i=gr(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(yr(i,t,n,!0));return a},hr=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=V.get(e),i=gr(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(yr(i,t,n,!1));return a},V=new WeakMap,gr=(e,t,n)=>{let r=_r(t,n);return vr(r,t,n,e),r},_r=(e,t)=>{let n=tt(e);if(n!==void 0)return n;let{validOptions:r,defaultValue:i}=t?{validOptions:`"stdin"`,defaultValue:`stdin`}:{validOptions:`"stdout", "stderr", "all"`,defaultValue:`stdout`};throw TypeError(`"${H(t)}" must not be "${e}".
17
+ It must be ${r} or "fd3", "fd4" (and so on).
18
+ It is optional and defaults to "${i}".`)},vr=(e,t,n,r)=>{let i=r[xr(e)];if(i===void 0)throw TypeError(`"${H(n)}" must not be ${t}. That file descriptor does not exist.
19
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction===`input`&&!n)throw TypeError(`"${H(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${H(n)}" must not be ${t}. It must be a writable stream, not readable.`)},yr=(e,t,n,r)=>{if(e===`all`&&!n.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:a}=br(e,n);return`The "${i}: ${Sr(a)}" option is incompatible with using "${H(r)}: ${Sr(t)}".
20
+ Please set this option with "pipe" instead.`},br=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=xr(e);return a===0&&t!==void 0?{optionName:`stdin`,optionValue:t}:a===1&&n!==void 0?{optionName:`stdout`,optionValue:n}:a===2&&r!==void 0?{optionName:`stderr`,optionValue:r}:{optionName:`stdio[${a}]`,optionValue:i[a]}},xr=e=>e===`all`?1:e,H=e=>e?`to`:`from`,Sr=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,Cr=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),re(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},wr=(e,t)=>{t&&Tr(e)},Tr=e=>{e.refCounted()},Er=(e,t)=>{t&&Dr(e)},Dr=e=>{e.unrefCounted()},Or=(e,t)=>{t&&(Dr(e),Dr(e))},kr=(e,t)=>{t&&(Tr(e),Tr(e))},Ar=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(Vr(i)||si(i))return;Mr.has(e)||Mr.set(e,[]);let a=Mr.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await Yr(e,r,i),await w.yield();let o=await Br({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},jr=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{li();let a=Mr.get(e);for(;a?.length>0;)await E(r,`message:done`);e.removeListener(`message`,i),kr(t,n),r.connected=!1,r.emit(`disconnect`)},Mr=new WeakMap,Nr=(e,t,n)=>{if(Pr.has(e))return Pr.get(e);let r=new ne;return r.connected=!0,Pr.set(e,r),Fr({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},Pr=new WeakMap,Fr=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Ar.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,jr.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Or(n,r)},Ir=e=>{let t=Pr.get(e);return t===void 0?e.channel!==null:t.connected},Lr=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=Xr(e,Nr(e,t,n));return{id:Rr++,type:Gr,message:r,hasListeners:a}};let Rr=0n;const zr=(e,t)=>{if(!(t?.type!==Gr||t.hasListeners))for(let{id:t}of e)t!==void 0&&Ur[t].resolve({isDeadlock:!0,hasListeners:!1})},Br=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==Gr||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:Kr,message:Xr(t,i)};try{await Qr({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},Vr=e=>{if(e?.type!==Kr)return!1;let{id:t,message:n}=e;return Ur[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},Hr=async(e,t,n)=>{if(e?.type!==Gr)return;let r=B();Ur[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,Wr(t,n,i)]);e&&tr(n),a||rr(n)}finally{i.abort(),delete Ur[e.id]}},Ur={},Wr=async(e,t,{signal:n})=>{Cr(e,1,n),await E(e,`disconnect`,{signal:n}),ir(t)},Gr=`execa:ipc:request`,Kr=`execa:ipc:response`,qr=(e,t,n)=>{U.has(e)||U.set(e,new Set);let r=U.get(e),i={onMessageSent:B(),id:n?t.id:void 0};return r.add(i),{outgoingMessages:r,outgoingMessage:i}},Jr=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},Yr=async(e,t,n)=>{for(;!Xr(e,t)&&U.get(e)?.size>0;){let t=[...U.get(e)];zr(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},U=new WeakMap,Xr=(e,t)=>t.listenerCount(`message`)>Zr(e),Zr=e=>V.has(e)&&!P(V.get(e).options.buffer,`ipc`)?1:0,Qr=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return Zn({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),$r({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},$r=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=Lr({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=qr(e,o,a);try{await ei({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw pr(e),t}finally{Jr(s)}},ei=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=ti(e);try{await Promise.all([Hr(r,e,n),a(r)])}catch(e){throw sr({error:e,methodName:t,isSubprocess:n}),cr({error:e,methodName:t,isSubprocess:n,message:i}),e}},ti=e=>{if(ni.has(e))return ni.get(e);let t=h(e.send.bind(e));return ni.set(e,t),t},ni=new WeakMap,ri=(e,t)=>{let n=`cancelSignal`;return $n(n,!1,e.connected),ei({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:ci,message:t},message:t})},ii=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await ai({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),ui.signal),ai=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!oi){if(oi=!0,!r){or();return}if(t===null){li();return}Nr(e,t,n),await w.yield()}};let oi=!1;const si=e=>e?.type===ci?(ui.abort(e.message),!0):!1,ci=`execa:ipc:cancel`,li=()=>{ui.abort(ar())},ui=new AbortController,di=({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(t===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r===`json`)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},fi=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[pi({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],pi=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{throw await qn(t,i),await ri(e,mi(t)),Kn({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??=`gracefulCancel`,t.reason},mi=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,`stack`,{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},hi=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},gi=(e,t,n,r)=>t===0||t===void 0?[]:[_i(e,t,n,r)],_i=async(e,t,n,{signal:r})=>{throw await te(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e.kill(),new L},vi=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},yi=(e,t,{node:n=!1,nodePath:r=y,nodeOptions:i=v.filter(e=>!e.startsWith(`--inspect`)),cwd:a,execPath:o,...s})=>{if(o!==void 0)throw TypeError(`The "execPath" option has been removed. Please use the "nodePath" option instead.`);let c=ye(r,`The "nodePath" option`),l=C.resolve(a,c),u={...s,nodePath:l,node:n,cwd:a};if(!n)return[e,t,u];if(C.basename(e,`.exe`)===`node`)throw TypeError(`When the "node" option is true, the first argument does not need to be "node".`);return[l,[...i,e,...t],{ipc:!0,...u,shell:!1}]},bi=({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");xi[n](e)}},xi={advanced:e=>{try{oe(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},Si=async(e,t)=>{t!==void 0&&await e.sendMessage(t)},Ci=({encoding:e})=>{if(Ti.has(e))return;let t=Ei(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${Oi(e)}\`.
21
+ Please rename it to ${Oi(t)}.`);let n=[...Ti].map(e=>Oi(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${Oi(e)}\`.
22
+ Please rename it to one of: ${n}.`)},wi=new Set([`utf8`,`utf16le`]),W=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),Ti=new Set([...wi,...W]),Ei=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Di)return Di[t];if(Ti.has(t))return t},Di={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Oi=e=>typeof e==`string`?`"${e}"`:String(e),ki=(e=Ai())=>{let t=ye(e,`The "cwd" option`);return C.resolve(t)},Ai=()=>{try{return _.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},ji=(e,t)=>{if(t===Ai())return e;let n;try{n=de(t)}catch(n){return`The "cwd" option is invalid: ${t}.\n${n.message}\n${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`};var Mi=t(r(),1);const Ni=(e,t,n)=>{n.cwd=ki(n.cwd);let[r,i,a]=yi(e,t,n),{command:o,args:s,options:c}=Mi.default._parse(r,i,a),l=Pi(qe(c));return hi(l),Ci(l),bi(l),Jn(l),di(l),l.shell=Se(l.shell),l.env=Fi(l),l.killSignal=An(l.killSignal),l.forceKillAfterDelay=Bn(l.forceKillAfterDelay),l.lines=l.lines.map((e,t)=>e&&!W.has(l.encoding)&&l.buffer[t]),_.platform===`win32`&&C.basename(o,`.exe`)===`cmd`&&s.unshift(`/q`),{file:o,commandArguments:s,options:l}},Pi=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i=`utf8`,reject:a=!0,cleanup:o=!0,all:s=!1,windowsHide:c=!0,killSignal:l=`SIGTERM`,forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m=`advanced`,...h})=>({...h,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:a,cleanup:o,all:s,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),Fi=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{..._.env,...e}:e;return n||r?ln({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o},Ii=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function Li(e){if(typeof e==`string`)return Ri(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return zi(e)}const Ri=e=>e.at(-1)===Bi?e.slice(0,e.at(-2)===Hi?-2:-1):e,zi=e=>e.at(-1)===Vi?e.subarray(0,e.at(-2)===Ui?-2:-1):e,Bi=`
23
+ `,Vi=`
24
+ `.codePointAt(0),Hi=`\r`,Ui=`\r`.codePointAt(0);function G(e,{checkOpen:t=!0}={}){return typeof e==`object`&&!!e&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe==`function`}function Wi(e,{checkOpen:t=!0}={}){return G(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`}function Gi(e,{checkOpen:t=!0}={}){return G(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`}function Ki(e,t){return Wi(e,t)&&Gi(e,t)}const qi=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var Ji=class{#t;#n;#r=!1;#e=void 0;constructor(e,t){this.#t=e,this.#n=t}next(){let e=()=>this.#s();return this.#e=this.#e?this.#e.then(e,e):e(),this.#e}return(e){let t=()=>this.#i(e);return this.#e?this.#e.then(t,t):t()}async#s(){if(this.#r)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(e){throw this.#e=void 0,this.#r=!0,this.#t.releaseLock(),e}return e.done&&(this.#e=void 0,this.#r=!0,this.#t.releaseLock()),e}async#i(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#n){let t=this.#t.cancel(e);return this.#t.releaseLock(),await t,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}};const Yi=Symbol();function Xi(){return this[Yi].next()}Object.defineProperty(Xi,`name`,{value:`next`});function Zi(e){return this[Yi].return(e)}Object.defineProperty(Zi,`name`,{value:`return`});const Qi=Object.create(qi,{next:{enumerable:!0,configurable:!0,writable:!0,value:Xi},return:{enumerable:!0,configurable:!0,writable:!0,value:Zi}});function $i({preventCancel:e=!1}={}){let t=new Ji(this.getReader(),e),n=Object.create(Qi);return n[Yi]=t,n}const ea=e=>{if(Gi(e,{checkOpen:!1})&&ia.on!==void 0)return na(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(ta.call(e)===`[object ReadableStream]`)return $i.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:ta}=Object.prototype,na=async function*(e){let t=new AbortController,n={};ra(e,t,n);try{for await(let[n]of ia.on(e,`data`,{signal:t.signal}))yield n}catch(e){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},ra=async(e,t,n)=>{try{await ia.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},ia={},aa=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=ea(e),u=t();u.length=0;try{for await(let e of l)sa({convertedChunk:n[la(e)](e,u),state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c});return oa({state:u,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(u)}catch(e){let t=typeof e==`object`&&e?e:Error(e);throw t.bufferedData=s(u),t}},oa=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&sa({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},sa=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){ca(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&ca(c,t,i,a),new da},ca=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},la=e=>{let t=typeof e;if(t===`string`)return`string`;if(t!==`object`||e===null)return`others`;if(globalThis.Buffer?.isBuffer(e))return`buffer`;let n=ua.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&ua.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:ua}=Object.prototype;var da=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const K=e=>e,fa=()=>void 0,pa=({contents:e})=>e,ma=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},ha=e=>e.length;async function ga(e,t){return aa(e,_a,t)}const _a={init:()=>({contents:[]}),convertChunk:{string:K,buffer:K,arrayBuffer:K,dataView:K,typedArray:K,others:K},getSize:()=>1,truncateChunk:fa,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:fa,finalize:pa};async function va(e,t){return aa(e,Ma,t)}const ya=()=>({contents:new ArrayBuffer(0)}),ba=e=>xa.encode(e),xa=new TextEncoder,Sa=e=>new Uint8Array(e),Ca=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),wa=(e,t)=>e.slice(0,t),Ta=(e,{contents:t,length:n},r)=>{let i=ja()?Da(t,r):Ea(t,r);return new Uint8Array(i).set(e,n),i},Ea=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Oa(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Da=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Oa(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},Oa=e=>ka**Math.ceil(Math.log(e)/Math.log(ka)),ka=2,Aa=({contents:e,length:t})=>ja()?e:e.slice(0,t),ja=()=>`resize`in ArrayBuffer.prototype,Ma={init:ya,convertChunk:{string:ba,buffer:Sa,arrayBuffer:Sa,dataView:Ca,typedArray:Ca,others:ma},getSize:ha,truncateChunk:wa,addChunk:Ta,getFinalChunk:fa,finalize:Aa};async function Na(e,t){return aa(e,Ia,t)}const Pa=()=>({contents:``,textDecoder:new TextDecoder}),Fa=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Ia={init:Pa,convertChunk:{string:K,buffer:Fa,arrayBuffer:Fa,dataView:Fa,typedArray:Fa,others:ma},getSize:ha,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:pa},La=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof da))throw e;if(a===`all`)return e;throw e.maxBufferInfo={fdNumber:a,unit:Ra(n,r,i)},t.destroy(),e},Ra=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,za=(e,t,n)=>{if(t.length!==n)return;let r=new da;throw r.maxBufferInfo={fdNumber:`ipc`},r},Ba=(e,t)=>{let{streamName:n,threshold:r,unit:i}=Va(e,t);return`Command's ${n} was larger than ${r} ${i}`},Va=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:`output`,threshold:t[1],unit:`bytes`};let{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;let i=P(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:Ke(n),threshold:i,unit:r}},Ha=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>Wa(n)),Ua=(e,t,n)=>{if(!t)return e;let r=Wa(n);return e.length>r?e.slice(0,r):e},Wa=([,e])=>e,Ga=({stdio:e,all:t,ipcOutput:n,originalError:r,signal:i,signalDescription:a,exitCode:o,escapedCommand:s,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:_})=>{let v=r?.code,y=Ka({originalError:r,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:v,signal:i,signalDescription:a,exitCode:o,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),b=Ja(r,_),x=`${y}: ${s}${b===void 0?``:`\n${b}`}`;return{originalMessage:b,shortMessage:x,message:[x,...t===void 0?[e[2],e[1]]:[t],...e.slice(3),n.map(e=>Ya(e)).join(`
25
+ `)].map(e=>mt(Li(Xa(e)))).filter(Boolean).join(`
26
+
27
+ `)}},Ka=({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:a,signal:o,signalDescription:s,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=qa(d,f);return t?`Command timed out after ${n} milliseconds${m}`:u?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${o} (${s})`:l?`Command was canceled${m}`:r?`${Ba(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${zn(p)})${m}`:o===void 0?c===void 0?`Command failed`:`Command failed with exit code ${c}`:`Command was killed with ${o} (${s})`:`Command failed with ${a}${m}`},qa=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,Ja=(e,t)=>{if(e instanceof L)return;let n=mt(ji(fn(e)?e.originalMessage:String(e?.message??e),t));return n===``?void 0:n},Ya=e=>typeof e==`string`?e:m(e),Xa=e=>Array.isArray(e)?e.map(e=>Li(Za(e))).filter(Boolean).join(`
28
+ `):Za(e),Za=e=>typeof e==`string`?e:A(e)?ke(e):``,Qa=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>no({command:e,escapedCommand:t,cwd:a,durationMs:tn(o),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:[]}),$a=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>eo({error:e,command:t,escapedCommand:n,startTime:a,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),eo=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:_,cwd:v,maxBuffer:y},isSync:b})=>{let{exitCode:x,signal:S,signalDescription:C}=ro(l,u),{originalMessage:w,shortMessage:ee,message:te}=Ga({stdio:d,all:f,ipcOutput:p,originalError:e,signal:S,signalDescription:C,exitCode:x,escapedCommand:n,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:_,maxBuffer:y,timeout:h,cwd:v}),T=un(e,te,b);return Object.assign(T,to({error:T,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:x,signal:S,signalDescription:C,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:w,shortMessage:ee})),T},to=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:_})=>no({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:tn(r),failed:!0,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isTerminated:u!==void 0,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:e.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),no=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),ro=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t;return{exitCode:n,signal:r,signalDescription:r===void 0?void 0:zn(t)}},io=e=>Number.isFinite(e)?e:0;function ao(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(io(e*1e3)%1e3),nanoseconds:Math.trunc(io(e*1e6)%1e3)}}function oo(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function so(e){switch(typeof e){case`number`:if(Number.isFinite(e))return ao(e);break;case`bigint`:return oo(e)}throw TypeError(`Expected a finite number or bigint`)}const co=e=>e===0||e===0n,lo=(e,t)=>t===1||t===1n?e:`${e}s`,uo=24n*60n*60n*1000n;function fo(e,t){let n=typeof e==`bigint`;if(!n&&!Number.isFinite(e))throw TypeError(`Expected a finite number or bigint`);t={...t};let 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=[],a=(e,t)=>{let n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&co(e)&&!(t.colonNotation&&r===`m`))){if(a??=String(e),t.colonNotation){let e=a.includes(`.`)?a.split(`.`)[0].length:a.length,t=i.length>0?2:1;a=`0`.repeat(Math.max(0,t-e))+a}else a+=t.verbose?` `+lo(n,e):r;i.push(a)}},s=so(e),c=BigInt(s.days);if(t.hideYearAndDays?o(BigInt(c)*24n+BigInt(s.hours),`hour`,`h`):(t.hideYear?o(c,`day`,`d`):(o(c/365n,`year`,`y`),o(c%365n,`day`,`d`)),o(Number(s.hours),`hour`,`h`)),o(Number(s.minutes),`minute`,`m`),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(s.seconds),n=Number(s.milliseconds),r=Number(s.microseconds),i=Number(s.nanoseconds);if(o(e,`second`,`s`),t.formatSubMilliseconds)o(n,`millisecond`,`ms`),o(r,`microsecond`,`µs`),o(i,`nanosecond`,`ns`);else{let e=n+r/1e3+i/1e6,a=typeof t.millisecondsDecimalDigits==`number`?t.millisecondsDecimalDigits:0,s=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);o(Number.parseFloat(s),`millisecond`,`ms`,s)}}else{let r=a((n?Number(e%uo):e)/1e3%60,typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?r:r.replace(/\.0+$/,``);o(Number.parseFloat(i),`second`,`s`,i)}if(i.length===0)return r+`0`+(t.verbose?` milliseconds`:`ms`);let l=t.colonNotation?`:`:` `;return typeof t.unitCount==`number`&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(l)}const po=(e,t)=>{e.failed&&I({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},mo=(e,t)=>{ot(t)&&(po(e,t),ho(e,t))},ho=(e,t)=>{I({type:`duration`,verboseMessage:`(done in ${fo(e.durationMs)})`,verboseInfo:t,result:e})},go=(e,t,{reject:n})=>{if(mo(e,t),e.failed&&n)throw e;return e},_o=(e,t)=>q(e)?`asyncGenerator`:Eo(e)?`generator`:Oo(e)?`fileUrl`:Ao(e)?`filePath`:Lo(e)?`webStream`:G(e,{checkOpen:!1})?`native`:A(e)?`uint8Array`:zo(e)?`asyncIterable`:Bo(e)?`iterable`:Ro(e)?bo({transform:e},t):Do(e)?vo(e,t):`native`,vo=(e,t)=>Ki(e.transform,{checkOpen:!1})?yo(e,t):Ro(e.transform)?bo(e,t):Co(e,t),yo=(e,t)=>(xo(e,t,`Duplex stream`),`duplex`),bo=(e,t)=>(xo(e,t,`web TransformStream`),`webTransform`),xo=({final:e,binary:t,objectMode:n},r,i)=>{So(e,`${r}.final`,i),So(t,`${r}.binary`,i),wo(n,`${r}.objectMode`)},So=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Co=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!To(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Ki(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(Ro(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!To(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return wo(n,`${i}.binary`),wo(r,`${i}.objectMode`),q(e)||q(t)?`asyncGenerator`:`generator`},wo=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},To=e=>q(e)||Eo(e),q=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Eo=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Do=e=>k(e)&&(e.transform!==void 0||e.final!==void 0),Oo=e=>Object.prototype.toString.call(e)===`[object URL]`,ko=e=>Oo(e)&&e.protocol!==`file:`,Ao=e=>k(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>jo.has(e))&&Mo(e.file),jo=new Set([`file`,`append`]),Mo=e=>typeof e==`string`,No=(e,t)=>e===`native`&&typeof t==`string`&&!Po.has(t),Po=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),Fo=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,Io=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,Lo=e=>Fo(e)||Io(e),Ro=e=>Fo(e?.readable)&&Io(e?.writable),zo=e=>Vo(e)&&typeof e[Symbol.asyncIterator]==`function`,Bo=e=>Vo(e)&&typeof e[Symbol.iterator]==`function`,Vo=e=>typeof e==`object`&&!!e,J=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),Ho=new Set([`fileUrl`,`filePath`,`fileNumber`]),Uo=new Set([`fileUrl`,`filePath`]),Wo=new Set([...Uo,`webStream`,`nodeStream`]),Go=new Set([`webTransform`,`duplex`]),Ko={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`},qo=(e,t,n,r)=>r===`output`?Jo(e,t,n):Yo(e,t,n),Jo=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},Yo=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},Xo=(e,t)=>{let n=e.findLast(({type:e})=>J.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},Zo=(e,t,n,r)=>[...e.filter(({type:e})=>!J.has(e)),...Qo(e,t,n,r)],Qo=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>J.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=$o({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return rs(a,n)},$o=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?es({stdioItem:e,optionName:i}):t===`webTransform`?ts({stdioItem:e,index:n,newTransforms:r,direction:a}):ns({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),es=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:a})=>{if(i&&!r)throw TypeError(`The \`${a}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw TypeError(`The \`${a}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},ts=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=k(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=qo(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},ns=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:a})=>{let{transform:o,final:s,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=k(t)?t:{transform:t},d=c||W.has(a),{writableObjectMode:f,readableObjectMode:p}=qo(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},rs=(e,t)=>t===`input`?e.reverse():e,is=(e,t,n)=>{let r=e.map(e=>as(e,t));if(r.includes(`input`)&&r.includes(`output`))throw TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??us},as=({type:e,value:t},n)=>os[n]??cs[e](t),os=[`input`,`output`,`output`],Y=()=>void 0,ss=()=>`input`,cs={generator:Y,asyncGenerator:Y,fileUrl:Y,filePath:Y,iterable:ss,asyncIterable:ss,uint8Array:ss,webStream:e=>Io(e)?`output`:`input`,nodeStream(e){return Gi(e,{checkOpen:!1})?Wi(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:Y,duplex:Y,native(e){let t=ls(e);if(t!==void 0)return t;if(G(e,{checkOpen:!1}))return cs.nodeStream(e)}},ls=e=>{if([0,_.stdin].includes(e))return`input`;if([1,2,_.stdout,_.stderr].includes(e))return`output`},us=`output`,ds=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e,fs=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=ps(e,r).map((e,t)=>hs(e,t));return a?gs(o,n,i):ds(o,t)},ps=(e,t)=>{if(e===void 0)return N.map(e=>t[e]);if(ms(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${N.map(e=>`\`${e}\``).join(`, `)}`);if(typeof e==`string`)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let n=Math.max(e.length,N.length);return Array.from({length:n},(t,n)=>e[n])},ms=e=>N.some(t=>e[t]!==void 0),hs=(e,t)=>Array.isArray(e)?e.map(e=>hs(e,t)):e??(t>=N.length?`ignore`:`pipe`),gs=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!st(n,r)&&_s(e)?`ignore`:e),_s=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`),vs=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?ys({stdioItem:e,fdNumber:r,direction:i}):Ss({stdioItem:e,fdNumber:r}),ys=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=bs({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(G(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},bs=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=xs(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(S.isatty(i))throw TypeError(`The \`${t}: ${Sr(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:j(ue(i)),optionName:t}}},xs=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Ge.indexOf(e);if(n!==-1)return n},Ss=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:Cs(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:Cs(t,t,n),optionName:n}:G(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,Cs=(e,t,n)=>{let r=Ge[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},ws=({input:e,inputFile:t},n)=>n===0?[...Ts(e),...Ds(t)]:[],Ts=e=>e===void 0?[]:[{type:Es(e),value:e,optionName:`input`}],Es=e=>{if(Gi(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(A(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Ds=e=>e===void 0?[]:[{...Os(e),optionName:`inputFile`}],Os=e=>{if(Oo(e))return{type:`fileUrl`,value:e};if(Mo(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},ks=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),As=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=js(i,e);if(o.length!==0){if(a){Ms({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(Wo.has(e))return Ns({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});Go.has(e)&&Fs({otherStdioItems:o,type:e,value:t,optionName:n})}},js=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),Ms=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{Uo.has(t)&&Ns({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},Ns=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>Ps(e,n));if(a.length!==0)return Is(a.find(e=>e.direction!==i),r,t),i===`output`?a[0].stream:void 0},Ps=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,Fs=({otherStdioItems:e,type:t,value:n,optionName:r})=>{Is(e.find(({value:{transform:e}})=>e===n.transform),r,t)},Is=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Ko[n]} that is the same.`)},Ls=(e,t,n,r)=>{let i=Ks({initialFileDescriptors:fs(t,n,r).map((e,n)=>Rs({stdioOption:e,fdNumber:n,options:t,isSync:r})),addProperties:e,options:t,isSync:r});return t.stdio=i.map(({stdioItems:e})=>Xs(e)),i},Rs=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Ke(t),{stdioItems:a,isStdioArray:o}=zs({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=is(a,t,i),c=Zo(a.map(e=>vs({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),i,s,n),l=Xo(c,s);return Gs(c,l),{direction:s,objectMode:l,stdioItems:c}},zs=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=ks([...(Array.isArray(e)?e:[e]).map(e=>Bs(e,r)),...ws(n,t)]),a=i.length>1;return Vs(i,a,r),Us(i),{stdioItems:i,isStdioArray:a}},Bs=(e,t)=>({type:_o(e,t),value:e,optionName:t}),Vs=(e,t,n)=>{if(e.length===0)throw TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(let{value:t,optionName:n}of e)if(Hs.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},Hs=new Set([`ignore`,`ipc`]),Us=e=>{for(let t of e)Ws(t)},Ws=({type:e,value:t,optionName:n})=>{if(ko(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
29
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(No(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},Gs=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>Ho.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},Ks=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(qs({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw Ys(i),e}},qs=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>({direction:e,objectMode:t,stdioItems:n.map(t=>Js({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}))}),Js=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=As({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},Ys=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!M(e)&&e.destroy()},Xs=e=>{if(e.length>1)return e.some(({value:e})=>e===`overlapped`)?`overlapped`:`pipe`;let[{type:t,value:n}]=e;return t===`native`?n:`pipe`},Zs=(e,t)=>Ls(tc,e,t,!0),X=({type:e,optionName:t})=>{$s(t,Ko[e])},Qs=({optionName:e,value:t})=>((t===`ipc`||t===`overlapped`)&&$s(e,`"${t}"`),{}),$s=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},ec={generator(){},asyncGenerator:X,webStream:X,nodeStream:X,webTransform:X,duplex:X,asyncIterable:X,native:Qs},tc={input:{...ec,fileUrl:({value:e})=>({contents:[j(ue(e))]}),filePath:({value:{file:e}})=>({contents:[j(ue(e))]}),fileNumber:X,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...ec,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:X,string:X,uint8Array:X}},Z=(e,{stripFinalNewline:t},n)=>nc(t,n)&&e!==void 0&&!Array.isArray(e)?Li(e):e,nc=(e,t)=>t===`all`?e[1]||e[2]:e[t],rc=(e,t,n,r)=>e||n?void 0:oc(t,r),ic=(e,t,n)=>n?e.flatMap(e=>ac(e,t)):ac(e,t),ac=(e,t)=>{let{transform:n,final:r}=oc(t,{});return[...n(e),...r()]},oc=(e,t)=>(t.previousChunks=``,{transform:sc.bind(void 0,t,e),final:lc.bind(void 0,t)}),sc=function*(e,t,n){if(typeof n!=`string`){yield n;return}let{previousChunks:r}=e,i=-1;for(let a=0;a<n.length;a+=1)if(n[a]===`
30
+ `){let o=cc(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=fc(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=fc(r,n.slice(i+1))),e.previousChunks=r},cc=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),lc=function*({previousChunks:e}){e.length>0&&(yield e)},uc=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:dc.bind(void 0,r)},dc=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?pc:mc;if(t.at(-1)===i){yield t;return}yield a(t,e?r:n)},fc=(e,t)=>`${e}${t}`,pc={windowsNewline:`\r
31
+ `,unixNewline:`
32
+ `,LF:`
33
+ `,concatBytes:fc},mc={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}},hc=(e,t)=>e?void 0:gc.bind(void 0,t),gc=function*(e,t){if(typeof t!=`string`&&!A(t)&&!ve.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},_c=(e,t)=>e?vc.bind(void 0,t):yc.bind(void 0,t),vc=function*(e,t){bc(e,t),yield t},yc=function*(e,t){if(bc(e,t),typeof t!=`string`&&!A(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},bc=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
34
+ Instead, \`yield\` should either be called with a value, or not be called at all. For example:
35
+ if (condition) { yield value; }`)},xc=(e,t,n)=>{if(n)return;if(e)return{transform:Sc.bind(void 0,new TextEncoder)};let r=new u(t);return{transform:Cc.bind(void 0,r),final:wc.bind(void 0,r)}},Sc=function*(e,t){ve.isBuffer(t)?yield j(t):typeof t==`string`?yield e.encode(t):yield t},Cc=function*(e,t){yield A(t)?e.write(t):t},wc=function*(e){let t=e.end();t!==``&&(yield t)},Tc=f(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),Ec=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Ac}=t[n];for await(let i of r(e))yield*Ec(i,t,n+1)},Dc=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Oc(n,Number(t),e)},Oc=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Ec(r,n,t+1)},kc=f(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Ac=function*(e){yield e},jc=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},Mc=(e,t)=>[...t.flatMap(t=>[...Q(t,e,0)]),...Nc(e)],Q=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Fc}=t[n];for(let i of r(e))yield*Q(i,t,n+1)},Nc=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Pc(n,Number(t),e)},Pc=function*(e,t,n){if(e!==void 0)for(let r of e())yield*Q(r,n,t+1)},Fc=function*(e){yield e},Ic=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=Rc(e,o,a),l=q(t),u=q(n),d=l?Tc.bind(void 0,Ec,s):jc.bind(void 0,Q),f=l||u?Tc.bind(void 0,Dc,s):jc.bind(void 0,Nc),p=l||u?kc.bind(void 0,s):void 0;return{stream:new he({writableObjectMode:r,writableHighWaterMark:_e(r),readableObjectMode:i,readableHighWaterMark:_e(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},Lc=(e,t,n,r)=>{let i=t.filter(({type:e})=>e===`generator`),a=r?i.reverse():i;for(let{value:t,optionName:r}of a)e=Mc(Rc(t,n,r),e);return e},Rc=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:hc(r,s)},xc(n,o,r),rc(n,a,r,c),{transform:e,final:t},{transform:_c(i,s)},uc({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},zc=(e,t)=>{for(let n of Bc(e))Vc(e,n,t)},Bc=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),Vc=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length!==0){if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${Ko[e]} with synchronous methods.`)}n.input=Me(i.map(({contents:e})=>e).map(e=>Hc(e,r)))}},Hc=(e,t)=>{let n=Lc(e,t,`utf8`,!0);return Uc(n),Me(n)},Uc=e=>{let t=e.find(e=>typeof e!=`string`&&!A(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},Wc=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&st(n,r)&&!W.has(t)&&Gc(r)&&(e.some(({type:e,value:t})=>e===`native`&&Kc.has(t))||e.every(({type:e})=>J.has(e))),Gc=e=>e===1||e===2,Kc=new Set([`pipe`,`overlapped`]),qc=async(e,t,n,r)=>{for await(let i of e)Yc(t)||Xc(i,n,r)},Jc=(e,t,n)=>{for(let r of e)Xc(r,t,n)},Yc=e=>e._readableState.pipes.length>0,Xc=(e,t,n)=>{I({type:`output`,verboseMessage:qt(e),fdNumber:t,verboseInfo:n})},Zc=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set([]);return{output:t.map((t,s)=>Qc({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},Qc=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:a,verboseInfo:o},{buffer:s,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(e===null)return;let f=j(Ua(e,a,d)),{stdioItems:p,objectMode:m}=t[n],{serializedResult:h,finalResult:g=h}=el({chunks:$c([f],p,c,r),objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});tl({serializedResult:h,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});let _=s[n]?g:void 0;try{return r.error===void 0&&nl(h,p,i),_}catch(e){return r.error=e,_}},$c=(e,t,n,r)=>{try{return Lc(e,t,n,!1)}catch(t){return r.error=t,e}},el=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:Me(e)};let o=Ae(e,n);return r[a]?{serializedResult:o,finalResult:ic(o,!i[a],t)}:{serializedResult:o}},tl=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!Wc({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=ic(e,!1,o);try{Jc(s,t,r)}catch(e){n.error??=e}},nl=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>Ho.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?se(r,e):(n.add(t),fe(r,e))}},rl=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Z(t,n,`all`)]:Array.isArray(t)?[Z(e,n,`all`),...t]:A(e)&&A(t)?Pe([e,t]):`${e}${t}`},il=async(e,t)=>{let[n,r]=await al(e);return t.isForcefullyTerminated??=!1,[n,r]},al=async e=>{let[t,n]=await Promise.allSettled([E(e,`spawn`),E(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?ol(e):n.value},ol=async e=>{try{return await E(e,`exit`)}catch{return ol(e)}},sl=async e=>{let[t,n]=await e;if(!cl(t,n)&&ll(t,n))throw new L;return[t,n]},cl=(e,t)=>e===void 0&&t===void 0,ll=(e,t)=>e!==0||t!==null,ul=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=dl(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:Ha(a,r,i)}},dl=(e,t,n)=>e===void 0?ll(t,n)?new L:void 0:e,fl=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=pl(e,t,n);return go(_l({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},pl=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=nn(e,t,n),{file:s,commandArguments:c,options:l}=Ni(e,t,ml(n));return hl(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:Zs(l,o)}},ml=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,hl=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&gl(`ipcInput`),e&&gl(`ipc: true`),n&&gl(`detached: true`),r&&gl(`cancelSignal`)},gl=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},_l=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=vl({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:s});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=ul(c,n),{output:m,error:h=l}=Zc({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a});return bl({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:m.map((e,t)=>Z(e,n,t)),all:Z(rl(m,n),n,`all`),options:n,command:r,escapedCommand:i,startTime:s})},vl=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return zc(a,n),l(...Ii(e,t,yl(n)))}catch(e){return $a({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},yl=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:Wa(t)}),bl=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:a,all:o,options:s,command:c,escapedCommand:l,startTime:u})=>e===void 0?Qa({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):eo({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:a,all:o,ipcOutput:[],options:s,startTime:u,isSync:!0}),xl=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(Zn({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Ir(e)}),Sl({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),Sl=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{wr(t,i);let a=Nr(e,t,n),o=new AbortController;try{return await Promise.race([Cl(a,r,o),wl(a,n,o),Tl(a,n,o)])}catch(t){throw pr(e),t}finally{o.abort(),Er(t,i)}},Cl=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await E(e,`message`,{signal:n});return t}for await(let[r]of ie(e,`message`,{signal:n}))if(t(r))return r},wl=async(e,t,{signal:n})=>{await E(e,`disconnect`,{signal:n}),er(t)},Tl=async(e,t,{signal:n})=>{let[r]=await E(e,`strict:error`,{signal:n});throw nr(r,t)},El=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>Dl({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),Dl=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{Zn({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:Ir(e)}),wr(t,a);let o=Nr(e,t,n),s=new AbortController,c={};return Ol(e,o,s),kl({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),Al({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},Ol=async(e,t,n)=>{try{await E(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},kl=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await E(e,`strict:error`,{signal:n.signal});r.error=nr(i,t),n.abort()}catch{}},Al=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of ie(n,`message`,{signal:a.signal}))jl(o),yield e}catch{jl(o)}finally{a.abort(),Er(t,s),r||pr(e),i&&await e}},jl=({error:e})=>{if(e)throw e},Ml=(e,{ipc:t})=>{Object.assign(e,Pl(e,!1,t))},Nl=()=>{let e=_,t=_.channel!==void 0;return{...Pl(e,!0,t),getCancelSignal:ii.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},Pl=(e,t,n)=>({sendMessage:Qr.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:xl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:El.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),Fl=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:s})=>{Ys(r);let c=new o;return Il(c,r),Object.assign(c,{readable:Rl,writable:zl,duplex:Bl}),{subprocess:c,promise:Vl($a({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1}),s,i)}},Il=(e,t)=>{let n=Ll(),r=Ll(),i=Ll(),a=Array.from({length:t.length-3},Ll),o=Ll(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},Ll=()=>{let e=new me;return e.end(),e},Rl=()=>new O({read(){}}),zl=()=>new ge({write(){}}),Bl=()=>new pe({read(){},write(){}}),Vl=async(e,t,n)=>go(e,t,n),Hl=(e,t)=>Ls(Gl,e,t,!1),Ul=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${Ko[e]}.`)},Wl={fileNumber:Ul,generator:Ic,asyncGenerator:Ic,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:pe.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Gl={input:{...Wl,fileUrl:({value:e})=>({stream:ce(e)}),filePath:({value:{file:e}})=>({stream:ce(e)}),webStream:({value:e})=>({stream:O.fromWeb(e)}),iterable:({value:e})=>({stream:O.from(e)}),asyncIterable:({value:e})=>({stream:O.from(e)}),string:({value:e})=>({stream:O.from(e)}),uint8Array:({value:e})=>({stream:O.from(ve.from(e))})},output:{...Wl,fileUrl:({value:e})=>({stream:le(e)}),filePath:({value:{file:e,append:t}})=>({stream:le(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:ge.fromWeb(e)}),iterable:Ul,asyncIterable:Ul,string:Ul,uint8Array:Ul}};function Kl(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Ql(t);let t=e.some(({readableObjectMode:e})=>e),n=ql(e,t),r=new Jl({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const ql=(e,t)=>{if(e.length===0)return _e(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)};var Jl=class extends me{#streams=new Set([]);#ended=new Set([]);#aborted=new Set([]);#onFinished;#unpipeEvent=Symbol(`unpipe`);#streamPromises=new WeakMap;add(e){if(Ql(e),this.#streams.has(e))return;this.#streams.add(e),this.#onFinished??=Yl(this,this.#streams,this.#unpipeEvent);let t=$l({passThroughStream:this,stream:e,streams:this.#streams,ended:this.#ended,aborted:this.#aborted,onFinished:this.#onFinished,unpipeEvent:this.#unpipeEvent});this.#streamPromises.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Ql(e),!this.#streams.has(e))return!1;let t=this.#streamPromises.get(e);return t===void 0?!1:(this.#streamPromises.delete(e),e.unpipe(this),await t,!0)}};const Yl=async(e,t,n)=>{lu(e,uu);let r=new AbortController;try{await Promise.race([Xl(e,r),Zl(e,t,n,r)])}finally{r.abort(),lu(e,-uu)}},Xl=async(e,{signal:t})=>{try{await D(e,{signal:t,cleanup:!0})}catch(t){throw iu(e,t),t}},Zl=async(e,t,n,{signal:r})=>{for await(let[i]of ie(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Ql=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},$l=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{lu(e,du);let s=new AbortController;try{await Promise.race([eu(a,t,s),tu({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),nu({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),lu(e,-du)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?ou(e):ru(e))},eu=async(e,t,{signal:n})=>{try{await e,n.aborted||ou(t)}catch(e){n.aborted||iu(t,e)}},tu=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await D(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;au(r)?i.add(t):su(e,r)}},nu=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await E(e,i,{signal:a}),!e.readable)return E(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},ru=e=>{e.writable&&e.end()},iu=(e,t)=>{au(t)?ou(e):su(e,t)},au=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,ou=e=>{(e.readable||e.writable)&&e.destroy()},su=(e,t)=>{e.destroyed||(e.once(`error`,cu),e.destroy(t))},cu=()=>{},lu=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},uu=2,du=1,fu=(e,t)=>{e.pipe(t),pu(e,t),hu(e,t)},pu=async(e,t)=>{if(!(M(e)||M(t))){try{await D(e,{cleanup:!0,readable:!0,writable:!1})}catch{}mu(t)}},mu=e=>{e.writable&&e.end()},hu=async(e,t)=>{if(!(M(e)||M(t))){try{await D(t,{cleanup:!0,readable:!1,writable:!0})}catch{}gu(e)}},gu=e=>{e.readable&&e.destroy()},_u=(e,t,n)=>{let r=new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){for(let{stream:t}of a.filter(({type:e})=>J.has(e)))vu(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!J.has(e)))bu({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())fu(t.length===1?t[0]:Kl(t),e)},vu=(e,t,n,r)=>{n===`output`?fu(e.stdio[r],t):fu(t,e.stdio[r]);let i=yu[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},yu=[`stdin`,`stdout`,`stderr`],bu=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;xu(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},xu=(e,{signal:t})=>{M(e)&&Cr(e,Su,t)},Su=2,Cu=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let a=i(()=>{e.kill()});re(r,()=>{a()})},wu=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=en(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=Tu(n,r,i),{sourceStream:d,sourceError:f}=Ou(e,l),{options:p,fileDescriptors:m}=V.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},Tu=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=Eu(e,t,...n);return{destination:r,destinationStream:mr(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},Eu=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(Du,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||xe(n)){if(Object.keys(e).length>0)throw TypeError(`Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).`);let[i,a,o]=Ce(n,...r);return{destination:t(Du)(i,a,o),pipeOptions:o}}if(V.has(n)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},Du=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),Ou=(e,t)=>{try{return{sourceStream:hr(e,t)}}catch(e){return{sourceError:e}}},ku=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=Au({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw ju({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},Au=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return gu(e),r;if(t!==void 0)return mu(n),t},ju=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>$a({error:e,command:Mu,escapedCommand:Mu,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Mu=`source.pipe(destination)`,Nu=async e=>{let[{status:t,reason:n,value:r=n},{status:i,reason:a,value:o=a}]=await e;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i===`rejected`)throw o;if(t===`rejected`)throw r;return o},Pu=(e,t,n)=>{let r=Ru.has(t)?Iu(e,t):Fu(e,t);return Cr(e,zu,n.signal),Cr(t,Bu,n.signal),Lu(t),r},Fu=(e,t)=>{let n=Kl([e]);return fu(n,t),Ru.set(t,n),n},Iu=(e,t)=>{let n=Ru.get(t);return n.add(e),n},Lu=async e=>{try{await D(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Ru.delete(e)},Ru=new WeakMap,zu=2,Bu=1,Vu=(e,t)=>e===void 0?[]:[Hu(e,t)],Hu=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await d(e,t),await n.remove(t),ju({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})},Uu=(e,...t)=>{if(k(t[0]))return Uu.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=wu(e,...t),i=Wu({...r,destination:n});return i.pipe=Uu.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},Wu=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=Gu(e,i);ku({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=Pu(t,a,d);return await Promise.race([Nu(u),...Vu(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Gu=(e,t)=>Promise.allSettled([e,t]),Ku=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return qu(t,o),Xu({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},qu=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Ju=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Yu(t,o,e);let s=e.readableObjectMode&&!a;return Xu({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Yu=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Xu=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>$u({onStdoutChunk:ie(e,`data`,{signal:t.signal,highWaterMark:Qu,highWatermark:Qu}),controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}),Zu=_e(!0),Qu=Zu,$u=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=ed({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*Q(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*Nc(s)}},ed=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[xc(e,n,!t),rc(e,i,!r,{})].filter(Boolean),td=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:a,lines:o,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=nd({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([rd(e),d]);return}let f=Ju({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:nc(c,n),allMixed:s}),[p]=await Promise.all([id({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},nd=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{Wc({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await qc(Ju({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},rd=async e=>{await ee(),e.readableFlowing===null&&e.resume()},id=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await ga(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await va(n,{maxBuffer:a})):await Na(n,{maxBuffer:a})}catch(n){return od(La({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},ad=async e=>{try{return await e}catch(e){return od(e)}},od=({bufferedData:e})=>Te(e)?new Uint8Array(e):e,sd=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=cd(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],D(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||dd(e,t,n,r)}finally{o.abort()}},cd=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&ld(e,n,r),r},ld=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{ud(t,n),r.call(e,...i)}},ud=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},dd=(e,t,n,r)=>{if(!fd(e,t,n,r))throw e},fd=(e,t,n,r=!0)=>n.propagating?hd(e)||md(e):(n.propagating=!0,pd(n,t)===r?hd(e):md(e)),pd=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,md=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,hd=e=>e?.code===`EPIPE`,gd=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>_d({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),_d=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l})=>{if(!e)return;let u=sd(e,t,l);if(pd(l,t)){await u;return}let[d]=await Promise.all([td({stream:e,onStreamEnd:u,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l}),u]);return d},vd=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Kl([e,t].filter(Boolean)):void 0,yd=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>_d({...bd(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:xd(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),bd=({stdout:e,stderr:t,all:n},[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},xd=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,Sd=e=>st(e,`ipc`),Cd=(e,t)=>{I({type:`ipc`,verboseMessage:qt(e),fdNumber:`ipc`,verboseInfo:t})},wd=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Sd(a),s=P(t,`ipc`),c=P(n,`ipc`);for await(let t of Dl({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(za(e,i,c),i.push(t)),o&&Cd(t,a);return i},Td=async(e,t)=>(await Promise.allSettled([e]),t),Ed=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:a,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:_})=>{let v=il(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=gd({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=yd({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),S=[],C=wd({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:S,verboseInfo:p}),w=Dd(h,e,y),ee=Od(m,y);try{return await Promise.race([Promise.all([{},sl(v),Promise.all(b),x,C,Si(e,d),...w,...ee]),g,kd(e,_),...gi(e,a,f,_),...Yn({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...fi({subprocess:e,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,context:f,controller:_})])}catch(e){return f.terminationReason??=`other`,Promise.all([{error:e},v,Promise.all(b.map(e=>ad(e))),ad(x),Td(C,S),Promise.allSettled(w),Promise.allSettled(ee)])}},Dd=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:sd(e,r,n)),Od=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>G(t,{checkOpen:!1})&&!M(t)).map(({type:e,value:r,stream:i=r})=>sd(i,n,t,{isSameDirection:J.has(e),stopOnExit:e===`native`}))),kd=async(e,{signal:t})=>{let[n]=await E(e,`error`,{signal:t});throw n},Ad=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),jd=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=B();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},Md=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},Nd=async e=>{if(e!==void 0)try{await Fd(e)}catch{}},Pd=async e=>{if(e!==void 0)try{await Id(e)}catch{}},Fd=async e=>{await D(e,{cleanup:!0,readable:!1,writable:!0})},Id=async e=>{await D(e,{cleanup:!0,readable:!0,writable:!1})},Ld=async(e,t)=>{if(await e,t)throw t},Rd=(e,t,n)=>{n&&!md(n)?e.destroy(n):t&&e.destroy()},zd=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||W.has(n),{subprocessStdout:s,waitReadableDestroy:c}=Bd(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Vd(s,o),{read:p,onStdoutDataDone:m}=Hd({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),h=new O({read:p,destroy:f(Gd.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return Wd({subprocessStdout:s,onStdoutDataDone:m,readable:h,subprocess:e}),h},Bd=(e,t,n)=>{let r=hr(e,t);return{subprocessStdout:r,waitReadableDestroy:jd(n,r,`readableDestroy`)}},Vd=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Zu},Hd=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=B(),o=Ku({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Ud(this,o,a)},onStdoutDataDone:a}},Ud=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},Wd=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Id(e),await r,await Nd(i),await t,n.readable&&n.push(null)}catch(e){await Nd(i),Kd(n,e)}},Gd=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Md(n,t)&&(Kd(e,r),await Ld(t,r))},Kd=(e,t)=>{Rd(e,e.readable,t)},qd=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=Jd(e,n,t),o=new ge({...Yd(r,e,i),destroy:f($d.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Qd(r,o),o},Jd=(e,t,n)=>{let r=mr(e,t);return{subprocessStdin:r,waitWritableFinal:jd(n,r,`writableFinal`),waitWritableDestroy:jd(n,r,`writableDestroy`)}},Yd=(e,t,n)=>({write:Xd.bind(void 0,e),final:f(Zd.bind(void 0,e,t,n))}),Xd=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},Zd=async(e,t,n)=>{await Md(n,t)&&(e.writable&&e.end(),await t)},Qd=async(e,t,n)=>{try{await Fd(e),t.writable&&t.end()}catch(e){await Pd(n),ef(t,e)}},$d=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Md(n,t),await Md(r,t)&&(ef(e,i),await Ld(t,i))},ef=(e,t)=>{Rd(e,e.writable,t)},tf=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||W.has(n),{subprocessStdout:c,waitReadableDestroy:l}=Bd(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:p}=Jd(e,i,t),{readableEncoding:m,readableObjectMode:h,readableHighWaterMark:g}=Vd(c,s),{read:_,onStdoutDataDone:v}=Hd({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),y=new pe({read:_,...Yd(u,e,d),destroy:f(nf.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:p})),readableHighWaterMark:g,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:m});return Wd({subprocessStdout:c,onStdoutDataDone:v,readable:y,subprocess:e,subprocessStdin:u}),Qd(u,y,c),y},nf=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([Gd({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),$d({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},rf=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||W.has(t),o=hr(e,n);return af(Ku({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i}),o,e)},af=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},of=(e,{encoding:t})=>{let n=Ad();e.readable=zd.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=qd.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=tf.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=rf.bind(void 0,e,t),e[Symbol.asyncIterator]=rf.bind(void 0,e,t,{})},sf=(e,t)=>{for(let[n,r]of lf){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},cf=(async()=>{})().constructor.prototype,lf=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(cf,e)]),uf=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=df(e,t,n),{subprocess:f,promise:p}=pf({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=Uu.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),sf(f,p),V.set(f,{options:u,fileDescriptors:d}),f},df=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=nn(e,t,n),{file:s,commandArguments:c,options:l}=Ni(e,t,n),u=ff(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:Hl(u,o)}},ff=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},pf=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let l;try{l=c(...Ii(e,t,n))}catch(e){return Fl({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let u=new AbortController;ae(1/0,u.signal);let d=[...l.stdio];_u(l,s,u),Cu(l,n,u);let f={},p=B();l.kill=Hn.bind(void 0,{kill:l.kill.bind(l),options:n,onInternalError:p,context:f,controller:u}),l.all=vd(l,n),of(l,n),Ml(l,n);let m=mf({subprocess:l,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:d,command:a,escapedCommand:o,context:f,onInternalError:p,controller:u});return{subprocess:l,promise:m}},mf=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:a,command:o,escapedCommand:s,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await Ed({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});return u.abort(),l.resolve(),go(hf({errorInfo:d,exitCode:f,signal:p,stdio:m.map((e,n)=>Z(e,t,n)),all:Z(h,t,`all`),ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},hf=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,context:o,options:s,command:c,escapedCommand:l,startTime:u})=>`error`in e?eo({error:e.error,command:c,escapedCommand:l,timedOut:o.terminationReason===`timeout`,isCanceled:o.terminationReason===`cancel`||o.terminationReason===`gracefulCancel`,isGracefullyCanceled:o.terminationReason===`gracefulCancel`,isMaxBuffer:e.error instanceof da,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):Qa({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),gf=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,_f(t,e[t],n)]));return{...e,...n}},_f=(e,t,n)=>vf.has(e)&&k(t)&&k(n)?{...t,...n}:n,vf=new Set([`env`,...at]),$=(e,t,n,r)=>{let i=(e,t,r)=>$(e,t,n,r),a=(...a)=>yf({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},yf=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(k(a))return i(e,gf(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=bf({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?fl(s,c,l):uf(s,c,l,i)},bf=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Ce(...Ie(t)?Le(t,n):[t,...n]),c=gf(gf(r,i),s),{file:l=a,commandArguments:u=o,options:d=c,isSync:f=!1}=e({file:a,commandArguments:o,options:c});return{file:l,commandArguments:u,options:d,isSync:f}},xf=({file:e,commandArguments:t})=>Cf(e,t),Sf=({file:e,commandArguments:t})=>({...Cf(e,t),isSync:!0}),Cf=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[n,...r]=wf(e);return{file:n,commandArguments:r}},wf=e=>{if(typeof e!=`string`)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t===``)return[];let n=[];for(let e of t.split(Tf)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Tf=/ +/g,Ef=(e,t,n)=>{e.sync=t(Of,n),e.s=e.sync},Df=({options:e})=>kf(e),Of=({options:e})=>({...kf(e),isSync:!0}),kf=e=>({options:{...Af(e),...e}}),Af=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},jf={preferLocal:!0},Mf=$(()=>({})),Nf=$(()=>({isSync:!0}));$(xf),$(Sf),$(vi),$(Df,{},jf,Ef);const{sendMessage:Pf,getOneMessage:Ff,getEachMessage:If,getCancelSignal:Lf}=Nl();var Rf=e({builder:()=>Kf,command:()=>zf,description:()=>Bf});const zf=`git`,Bf=``,Vf=process.cwd();function Hf(){try{return!!Nf(`git`,[`--version`],{cwd:Vf}).stdout}catch{throw Error(`git is not installed`)}}function Uf(){try{return Nf(`git`,[`rev-parse`,`--is-inside-work-tree`],{cwd:Vf}).stdout===`true`}catch{throw Error(`not a git repository`)}}function Wf(){return Mf(`git`,[`config`,`core.hooksPath`,`.githooks`],{cwd:Vf})}function Gf(){try{return Hf()&&Uf()}catch(e){return console.error(`Fail:`,e.message),!1}}function Kf(e){e.command(`hooks`,`Set .githooks as git.hooksPath`,{},()=>{Gf()&&Wf().then(()=>{console.log(`Done: set .githooks`)}).catch(()=>{console.error(`Fail:`,`setting hooks failed`),process.exitCode=1})}),e.demandCommand(1,"Typing `hooks`")}export{Kf as builder,zf as command,Bf as description,Mf as execa,Rf as git_hooks_exports};
@@ -1,2 +1,2 @@
1
- import{source_default as e}from"./source-DtPIOlG2.mjs";const t=[` `,`⚠`,`✖`],n=[`white`,`yellow`,`red`];function r(e={},t={}){let{results:n=[]}=e,r=e=>i(e,t),o=e=>a(e,t);return n.filter(e=>Array.isArray(e.warnings)||Array.isArray(e.errors)).map(e=>[...r(e),...o(e)]).reduce((e,t)=>Array.isArray(t)?[...e,...t]:[...e,t],[]).join(`
2
- `)}function i(t,n={}){let{color:r=!0}=n,{errors:i=[],warnings:a=[],input:o=``}=t;if(!o)return[``];let s=`⧗`,c=r?e.gray(s):s,l=r?e.bold(o):o,u=i.length>0||a.length>0;return n.verbose||u?[`${c} input: ${l}`]:[]}function a(r={},i={}){let{signs:a=t,colors:o=n,color:l=!0}=i,{errors:u=[],warnings:d=[]}=r,f=[...u,...d].map(t=>{let n=a[t.level]||``,r=o[t.level]||`white`,i=l?e[r](n):n,s=l?e.grey(`[${t.name}]`):`[${t.name}]`;return`${i} ${t.message} ${s}`}),p=s(r),m=c(r),h=l?e[m](p):p,g=u.length,_=d.length,v=f.length>0,y=i.verbose||v?`${h} found ${g} problems, ${_} warnings`:void 0,b=l&&typeof y==`string`?e.bold(y):y,x=v&&i.helpUrl?`ⓘ Get help: ${i.helpUrl}`:void 0;return[...f,v?``:void 0,b,x,v?``:void 0].filter(e=>typeof e==`string`)}var o=r;function s(e){return(e.errors||[]).length>0?`✖`:(e.warnings||[]).length?`⚠`:`✔`}function c(e){return(e.errors||[]).length>0?`red`:(e.warnings||[]).length?`yellow`:`green`}export{o as default};
1
+ import{source_default as e}from"./source-bo4Uy7dl.mjs";const t=[` `,`⚠`,`✖`],n=[`white`,`yellow`,`red`];function r(e={},t={}){let{results:n=[]}=e,r=e=>i(e,t),o=e=>a(e,t);return n.filter(e=>Array.isArray(e.warnings)||Array.isArray(e.errors)).map(e=>[...r(e),...o(e)]).reduce((e,t)=>Array.isArray(t)?[...e,...t]:[...e,t],[]).join(`
2
+ `)}function i(t,n={}){let{color:r=!0}=n,{errors:i=[],warnings:a=[],input:o=``}=t;if(!o)return[``];let s=r?e.gray(`⧗`):`⧗`,c=r?e.bold(o):o,l=i.length>0||a.length>0;return n.verbose||l?[`${s} input: ${c}`]:[]}function a(r={},i={}){let{signs:a=t,colors:o=n,color:l=!0}=i,{errors:u=[],warnings:d=[]}=r,f=[...u,...d].map(t=>{let n=a[t.level]||``,r=o[t.level]||`white`,i=l?e[r](n):n,s=l?e.grey(`[${t.name}]`):`[${t.name}]`;return`${i} ${t.message} ${s}`}),p=s(r),m=c(r),h=l?e[m](p):p,g=u.length,_=d.length,v=f.length>0,y=i.verbose||v?`${h} found ${g} problems, ${_} warnings`:void 0,b=l&&typeof y==`string`?e.bold(y):y,x=v&&i.helpUrl?`ⓘ Get help: ${i.helpUrl}`:void 0;return[...f,v?``:void 0,b,x,v?``:void 0].filter(e=>typeof e==`string`)}var o=r;function s(e){return(e.errors||[]).length>0?`✖`:(e.warnings||[]).length?`⚠`:`✔`}function c(e){return(e.errors||[]).length>0?`red`:(e.warnings||[]).length?`yellow`:`green`}export{o as default};