@nice-move/cli 0.11.16 → 0.11.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/107.mjs +1 -0
- package/dist/145.mjs +1 -1
- package/dist/216.mjs +1 -1
- package/dist/572.mjs +1 -0
- package/dist/782.mjs +1 -1
- package/dist/799.mjs +1 -1
- package/dist/909.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/cmd/git.mjs +1 -1
- package/dist/cmd/lint.mjs +1 -1
- package/dist/runtime.mjs +1 -1
- package/package.json +6 -7
- package/dist/340.mjs +0 -1
- package/dist/441.mjs +0 -1
- package/dist/564.mjs +0 -1
- package/dist/849.mjs +0 -1
package/dist/cmd/git.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";export const id=60;export const ids=[60];export const modules={526:(e,t,r)=>{const n=r(5317),o=r(4705),i=r(2369);function s(e,t,r){const s=o(e,t,r),a=n.spawn(s.command,s.args,s.options);return i.hookChildProcess(a,s),a}e.exports=s,e.exports.spawn=s,e.exports.sync=function(e,t,r){const s=o(e,t,r),a=n.spawnSync(s.command,s.args,s.options);return a.error=a.error||i.verifyENOENTSync(a.status,s),a},e.exports._parse=o,e.exports._enoent=i},2369:e=>{const t="win32"===process.platform;function r(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function n(e,n){return t&&1===e&&!n.file?r(n.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;const o=e.emit;e.emit=function(t,i){if("exit"===t){const t=n(i,r);if(t)return o.call(e,"error",t)}return o.apply(e,arguments)}},verifyENOENT:n,verifyENOENTSync:function(e,n){return t&&1===e&&!n.file?r(n.original,"spawnSync"):null},notFoundError:r}},4705:(e,t,r)=>{const n=r(6928),o=r(6694),i=r(1192),s=r(3179),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);const d={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?d:function(e){if(!a)return e;const t=function(e){e.file=o(e);const t=e.file&&s(e.file);return t?(e.args.unshift(e.file),e.command=t,o(e)):e.file}(e),r=!c.test(t);if(e.options.forceShell||r){const r=l.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map((e=>i.argument(e,r)));const o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(d)}},1192:e=>{const t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=`"${e=(e=(e=`${e}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},3179:(e,t,r)=>{const n=r(9896),o=r(600);e.exports=function(e){const t=Buffer.alloc(150);let r;try{r=n.openSync(e,"r"),n.readSync(r,t,0,150,0),n.closeSync(r)}catch(e){}return o(t.toString())}},6694:(e,t,r)=>{const n=r(6928),o=r(1905),i=r(9695);function s(e,t){const r=e.options.env||process.env,s=process.cwd(),a=null!=e.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}let l;try{l=o.sync(e.command,{path:r[i({env:r})],pathExt:t?n.delimiter:void 0})}catch(e){}finally{c&&process.chdir(s)}return l&&(l=n.resolve(a?e.options.cwd:"",l)),l}e.exports=function(e){return s(e)||s(e,!0)}},9344:(e,t,r)=>{var n;function o(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(r,n){o(e,t||{},(function(e,t){e?n(e):r(t)}))}))}n(e,t||{},(function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)}))}r(9896),n="win32"===process.platform||global.TESTING_WINDOWS?r(8541):r(709),e.exports=o,o.sync=function(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},709:(e,t,r)=>{e.exports=o,o.sync=function(e,t){return i(n.statSync(e),t)};var n=r(9896);function o(e,t,r){n.stat(e,(function(e,n){r(e,!e&&i(n,t))}))}function i(e,t){return e.isFile()&&function(e,t){var r=e.mode,n=e.uid,o=e.gid,i=void 0!==t.uid?t.uid:process.getuid&&process.getuid(),s=void 0!==t.gid?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8);return r&parseInt("001",8)||r&c&&o===s||r&a&&n===i||r&(a|c)&&0===i}(e,t)}},8541:(e,t,r)=>{e.exports=i,i.sync=function(e,t){return o(n.statSync(e),e,t)};var n=r(9896);function o(e,t,r){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var r=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!r)return!0;if(-1!==(r=r.split(";")).indexOf(""))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}(t,r)}function i(e,t,r){n.stat(e,(function(n,i){r(n,!n&&o(i,e,t))}))}},9695:e=>{const t=(e={})=>{const t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"};e.exports=t,e.exports.default=t},600:(e,t,r)=>{const n=r(7257);e.exports=(e="")=>{const t=e.match(n);if(!t)return null;const[r,o]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return"env"===i?o:o?`${i} ${o}`:i}},7257:e=>{e.exports=/^#!(.*)/},1905:(e,t,r)=>{const n="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,o=r(6928),i=n?";":":",s=r(9344),a=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),c=(e,t)=>{const r=t.colon||i,o=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],s=n?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=n?s.split(r):[""];return n&&-1!==e.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:o,pathExt:a,pathExtExe:s}},l=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});const{pathEnv:n,pathExt:i,pathExtExe:l}=c(e,t),d=[],u=r=>new Promise(((i,s)=>{if(r===n.length)return t.all&&d.length?i(d):s(a(e));const c=n[r],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=o.join(l,e),m=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;i(p(m,r,0))})),p=(e,r,n)=>new Promise(((o,a)=>{if(n===i.length)return o(u(r+1));const c=i[n];s(e+c,{pathExt:l},((i,s)=>{if(!i&&s){if(!t.all)return o(e+c);d.push(e+c)}return o(p(e,r,n+1))}))}));return r?u(0).then((e=>r(null,e)),r):u(0)};e.exports=l,l.sync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:i}=c(e,t),l=[];for(let a=0;a<r.length;a++){const c=r[a],d=/^".*"$/.test(c)?c.slice(1,-1):c,u=o.join(d,e),p=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let e=0;e<n.length;e++){const r=p+n[e];try{if(s.sync(r,{pathExt:i})){if(!t.all)return r;l.push(r)}}catch(e){}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw a(e)}},5317:t=>{t.exports=e(import.meta.url)("child_process")},9896:t=>{t.exports=e(import.meta.url)("fs")},4573:t=>{t.exports=e(import.meta.url)("node:buffer")},1421:t=>{t.exports=e(import.meta.url)("node:child_process")},3024:t=>{t.exports=e(import.meta.url)("node:fs")},8161:t=>{t.exports=e(import.meta.url)("node:os")},6760:t=>{t.exports=e(import.meta.url)("node:path")},1708:t=>{t.exports=e(import.meta.url)("node:process")},7075:t=>{t.exports=e(import.meta.url)("node:stream")},8500:t=>{t.exports=e(import.meta.url)("node:timers/promises")},7066:t=>{t.exports=e(import.meta.url)("node:tty")},3136:t=>{t.exports=e(import.meta.url)("node:url")},7975:t=>{t.exports=e(import.meta.url)("node:util")},6928:t=>{t.exports=e(import.meta.url)("path")},724:(t,r,n)=>{function o(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}n.d(r,{Ho:()=>fl,Kc:()=>hl});var i=n(3136);const s=(e,t)=>{const r=a(e);if("string"!=typeof r)throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},a=e=>e instanceof URL?(0,i.fileURLToPath)(e):e,c=(e,t=[],r={})=>{const n=s(e,"First argument"),[i,a]=o(t)?[[],t]:[t,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some((e=>"object"==typeof e&&null!==e)))throw new TypeError(`Second argument must be an array of strings: ${i}`);const c=i.map(String),l=c.find((e=>e.includes("\0")));if(void 0!==l)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${l}`);if(!o(a))throw new TypeError(`Last argument must be an options object: ${a}`);return[n,c,a]};var l=n(1421);const d=e(import.meta.url)("node:string_decoder"),{toString:u}=Object.prototype,p=e=>"[object Uint8Array]"===u.call(e),m=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),f=new TextEncoder,h=e=>f.encode(e),b=new TextDecoder,g=e=>b.decode(e),y=e=>1===e.length&&p(e[0])?e[0]:v(w(e)),w=e=>e.map((e=>"string"==typeof e?h(e):e)),v=e=>{const t=new Uint8Array(S(e));let r=0;for(const n of e)t.set(n,r),r+=n.length;return t},S=e=>{let t=0;for(const r of e)t+=r.length;return t},x=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(void 0===o)throw new TypeError(`Invalid backslash sequence: ${e.raw[n]}`);const{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:a}=E(o,e.raw[n]),c=I(r,i,s);if(n===t.length)return c;const l=t[n],d=Array.isArray(l)?l.map((e=>O(e))):[O(l)];return I(c,d,a)},E=(e,t)=>{if(0===t.length)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const r=[];let n=0;const o=T.has(t[0]);for(let o=0,i=0;o<e.length;o+=1,i+=1){const s=t[i];if(T.has(s))n!==o&&r.push(e.slice(n,o)),n=o+1;else if("\\"===s){const e=t[i+1];"u"===e&&"{"===t[i+2]?i=t.indexOf("}",i+3):i+=D[e]??1}}const i=n===e.length;return i||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:i}},T=new Set([" ","\t","\r","\n"]),D={x:3,u:5},I=(e,t,r)=>r||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],O=e=>{const t=typeof e;if("string"===t)return e;if("number"===t)return String(e);if(o(e)&&("stdout"in e||"isMaxBuffer"in e))return M(e);if(e instanceof l.ChildProcess||"[object Promise]"===Object.prototype.toString.call(e))throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw new TypeError(`Unexpected "${t}" in template expression`)},M=({stdout:e})=>{if("string"==typeof e)return e;if(p(e))return g(e);if(void 0===e)throw new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.');throw new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};var N=n(7975),C=n(1708);const $=e=>A.includes(e),A=[C.stdin,C.stdout,C.stderr],B=["stdin","stdout","stderr"],j=e=>B[e]??`stdio[${e}]`,P=(e,t)=>{const r=Array.from({length:k(e)+1}),n=R(e[t],r,t);return z(n,t)},k=({stdio:e})=>Array.isArray(e)?Math.max(e.length,B.length):B.length,R=(e,t,r)=>o(e)?L(e,t,r):t.fill(e),L=(e,t,r)=>{for(const n of Object.keys(e).sort(U))for(const o of G(n,r,t))t[o]=e[n];return t},U=(e,t)=>F(e)<F(t)?1:-1,F=e=>"stdout"===e||"stderr"===e?0:"all"===e?2:1,G=(e,t,r)=>{if("ipc"===e)return[r.length-1];const n=W(e);if(void 0===n||0===n)throw new TypeError(`"${t}.${e}" is invalid.\nIt must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`);return"all"===n?[1,2]:[n]},W=e=>{if("all"===e)return e;if(B.includes(e))return B.indexOf(e);const t=_.exec(e);return null!==t?Number(t[1]):void 0},_=/^fd(\d+)$/,z=(e,t)=>e.map((e=>void 0===e?V[t]:e)),V={lines:!1,buffer:!0,maxBuffer:1e8,verbose:(0,N.debuglog)("execa").enabled?"full":"none",stripFinalNewline:!0},H=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],K=(e,t)=>"ipc"===t?e.at(-1):e[t],q=({verbose:e},t)=>"none"!==X(e,t),Y=({verbose:e},t)=>!["none","short"].includes(X(e,t)),X=(e,t)=>void 0===t?Q(e):K(e,t),Q=e=>e.find((e=>J(e)))??Z.findLast((t=>e.includes(t))),J=e=>"function"==typeof e,Z=["none","short","full"];var ee=n(3024);const te=e=>(0,N.stripVTControlCharacters)(e).split("\n").map((e=>re(e))).join("\n"),re=e=>e.replaceAll(oe,(e=>ne(e))),ne=e=>{const t=ie[e];if(void 0!==t)return t;const r=e.codePointAt(0),n=r.toString(16);return r<=se?`\\u${n.padStart(4,"0")}`:`\\U${n}`},oe=(()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),ie={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},se=65535,ae=/^[\w./-]+$/,ce={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258c",squareRight:"\u2590",squareCenter:"\u25a0",bullet:"\u25cf",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203a",triangleUp:"\u25b2",triangleUpSmall:"\u25b4",triangleDown:"\u25bc",triangleDownSmall:"\u25be",triangleLeftSmall:"\u25c2",triangleRightSmall:"\u25b8",home:"\u2302",heart:"\u2665",musicNote:"\u266a",musicNoteBeamed:"\u266b",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221e",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xbd",oneThird:"\u2153",oneQuarter:"\xbc",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215b",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xbe",threeFifths:"\u2157",threeEighths:"\u215c",fourFifths:"\u2158",fiveSixths:"\u215a",fiveEighths:"\u215d",sevenEighths:"\u215e",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254c",lineDashed5:"\u254d",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257a",lineDashed10:"\u257c",lineDashed11:"\u257e",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250a",lineVerticalDashed3:"\u250b",lineVerticalDashed4:"\u254e",lineVerticalDashed5:"\u254f",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257b",lineVerticalDashed10:"\u257d",lineVerticalDashed11:"\u257f",lineDownLeft:"\u2510",lineDownLeftArc:"\u256e",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250c",lineDownRightArc:"\u256d",lineDownBoldRightBold:"\u250f",lineDownBoldRight:"\u250e",lineDownRightBold:"\u250d",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256f",lineUpBoldLeftBold:"\u251b",lineUpBoldLeft:"\u251a",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255d",lineUpDoubleLeft:"\u255c",lineUpLeftDouble:"\u255b",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255a",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252b",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252a",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251c",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251d",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251f",lineUpBoldDownRight:"\u251e",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255f",lineUpDownRightDouble:"\u255e",lineDownLeftRight:"\u252c",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252f",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252e",lineDownLeftBoldRight:"\u252d",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253b",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253a",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253c",lineUpBoldDownBoldLeftBoldRightBold:"\u254b",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254a",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253d",lineUpDownLeftRightBold:"\u253e",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253f",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256c",lineUpDoubleDownDoubleLeftRight:"\u256b",lineUpDownLeftDoubleRightDouble:"\u256a",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},le={tick:"\u2714",info:"\u2139",warning:"\u26a0",cross:"\u2718",squareSmall:"\u25fb",squareSmallFilled:"\u25fc",circle:"\u25ef",circleFilled:"\u25c9",circleDotted:"\u25cc",circleDouble:"\u25ce",circleCircle:"\u24de",circleCross:"\u24e7",circlePipe:"\u24be",radioOn:"\u25c9",radioOff:"\u25ef",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24e7",checkboxCircleOff:"\u24be",pointer:"\u276f",triangleUpOutline:"\u25b3",triangleLeft:"\u25c0",triangleRight:"\u25b6",lozenge:"\u25c6",lozengeOutline:"\u25c7",hamburger:"\u2630",smiley:"\u32e1",mustache:"\u0df4",star:"\u2605",play:"\u25b6",nodejs:"\u2b22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},de={...ce,...le},ue={...ce,tick:"\u221a",info:"i",warning:"\u203c",cross:"\xd7",squareSmall:"\u25a1",squareSmallFilled:"\u25a0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25cb)",circleCross:"(\xd7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xd7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xd7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25c4",triangleRight:"\u25ba",lozenge:"\u2666",lozengeOutline:"\u25ca",hamburger:"\u2261",smiley:"\u263a",mustache:"\u250c\u2500\u2510",star:"\u2736",play:"\u25ba",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},pe=function(){const{env:e}=C,{TERM:t,TERM_PROGRAM:r}=e;return"win32"!==C.platform?"linux"!==t:Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===r||"vscode"===r||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}()?de:ue;Object.entries(le);var me=n(7066);const fe=me?.WriteStream?.prototype?.hasColors?.()??!1,he=(e,t)=>{if(!fe)return e=>e;const r=`\x1b[${e}m`,n=`\x1b[${t}m`;return e=>{const t=e+"";let o=t.indexOf(n);if(-1===o)return r+t+n;let i=r,s=0;for(;-1!==o;)i+=t.slice(s,o)+r,s=o+n.length,o=t.indexOf(n,s);return i+=t.slice(s)+n,i}},be=(he(0,0),he(1,22)),ge=(he(2,22),he(3,23),he(4,24),he(53,55),he(7,27),he(8,28),he(9,29),he(30,39),he(31,39),he(32,39),he(33,39),he(34,39),he(35,39),he(36,39),he(37,39),he(90,39)),ye=(he(40,49),he(41,49),he(42,49),he(43,49),he(44,49),he(45,49),he(46,49),he(47,49),he(100,49),he(91,39)),we=(he(92,39),he(93,39)),ve=(he(94,39),he(95,39),he(96,39),he(97,39),he(101,49),he(102,49),he(103,49),he(104,49),he(105,49),he(106,49),he(107,49),e=>`${Se(e.getHours(),2)}:${Se(e.getMinutes(),2)}:${Se(e.getSeconds(),2)}.${Se(e.getMilliseconds(),3)}`),Se=(e,t)=>String(e).padStart(t,"0"),xe=({failed:e,reject:t})=>e?t?pe.cross:pe.warning:pe.tick,Ee={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:xe,duration:xe},Te=e=>e,De={command:()=>be,output:()=>Te,ipc:()=>Te,error:({reject:e})=>e?ye:we,duration:()=>ge},Ie=(e,t,r)=>{if(void 0===r)return e;const n=r(e,t);return"string"==typeof n?n:void 0},Oe=e=>e.endsWith("\n")?e:`${e}\n`,Me=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:o})=>{const i=Ne({type:e,result:o,verboseInfo:n}),s=((e,t,r)=>{const n=(({verbose:e},t)=>{const r=X(e,t);return J(r)?r:void 0})(t,r);return e.map((({verboseLine:e,verboseObject:t})=>Ie(e,t,n))).filter((e=>void 0!==e)).map((e=>Oe(e))).join("")})(Ce(t,i),n,r);(0,ee.writeFileSync)(Ae,s)},Ne=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:o=!1,...i}}})=>({type:e,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:o,result:t,options:i}),Ce=(e,t)=>e.split("\n").map((e=>$e({...t,message:e}))),$e=e=>({verboseLine:(({type:e,message:t,timestamp:r,piped:n,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{const a=ve(r),c=Ee[e]({failed:i,reject:s,piped:n}),l=De[e]({reject:s});return`${ge(`[${a}]`)} ${ge(`[${o}]`)} ${l(c)} ${l(t)}`})(e),verboseObject:e}),Ae=2,Be=e=>{const t="string"==typeof e?e:(0,N.inspect)(e);return te(t).replaceAll("\t"," ".repeat(je))},je=2,Pe=e=>q({verbose:e})?ke++:void 0;let ke=0n;const Re=()=>C.hrtime.bigint(),Le=e=>Number(C.hrtime.bigint()-e)/1e6,Ue=(e,t,r)=>{const n=Re(),{command:o,escapedCommand:i}=((e,t)=>{const r=[e,...t];return{command:r.join(" "),escapedCommand:r.map((e=>{return t=re(e),ae.test(t)?t:"win32"===C.platform?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`;var t})).join(" ")}})(e,t),s=((e,t,r)=>((e=>{for(const t of e){if(!1===t)throw new TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".');if(!0===t)throw new TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".');if(!Z.includes(t)&&!J(t)){const e=Z.map((e=>`'${e}'`)).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}})(e),{verbose:e,escapedCommand:t,commandId:Pe(e),rawOptions:r}))(P(r,"verbose"),i,{...r});return((e,t)=>{q(t)&&Me({type:"command",verboseMessage:e,verboseInfo:t})})(i,s),{command:o,escapedCommand:i,startTime:n,verboseInfo:s}};var Fe=n(6760),Ge=n(526),We=n(7235);function _e(e){return e instanceof URL?(0,i.fileURLToPath)(e):e}(0,N.promisify)(l.execFile);const ze=({env:e=C.env,...t}={})=>{e={...e};const r=(0,We.A)({env:e});return t.path=e[r],e[r]=(({cwd:e=C.cwd(),path:t=C.env[(0,We.A)()],preferLocal:r=!0,execPath:n=C.execPath,addExecPath:o=!0}={})=>{const i=Fe.resolve(_e(e)),s=[],a=t.split(Fe.delimiter);return r&&((e,t,r)=>{for(const n of function(e){return{*[Symbol.iterator](){let t,r=Fe.resolve(_e(e));for(;t!==r;)yield r,t=r,r=Fe.resolve(r,"..")}}}(r)){const r=Fe.join(n,"node_modules/.bin");t.includes(r)||e.push(r)}})(s,a,i),o&&((e,t,r,n)=>{const o=Fe.resolve(n,_e(r),"..");t.includes(o)||e.push(o)})(s,a,n,i),""===t||t===Fe.delimiter?`${s.join(Fe.delimiter)}${t}`:[...s,t].join(Fe.delimiter)})(t),e};var Ve=n(8500);class He extends Error{}const Ke=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,qe,{value:!0,writable:!1,enumerable:!1,configurable:!1})},qe=Symbol("isExecaError"),Ye=e=>"[object Error]"===Object.prototype.toString.call(e);class Xe extends Error{}Ke(Xe,Xe.name);class Qe extends Error{}Ke(Qe,Qe.name);var Je=n(8161);const Ze=(e,t)=>({name:`SIGRT${t+1}`,number:et+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),et=34,tt=[{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"}],rt=()=>{const e=(()=>{const e=64-et+1;return Array.from({length:e},Ze)})();return[...tt,...e].map(nt)},nt=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{const{signals:{[e]:s}}=Je.constants,a=void 0!==s;return{name:e,number:a?s:t,description:r,supported:a,action:n,forced:o,standard:i}},ot=({name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s}],it=(()=>{const e=rt();return Object.fromEntries(e.map(ot))})(),st=(e,t)=>{const r=t.find((({name:t})=>Je.constants.signals[t]===e));return void 0!==r?r:t.find((t=>t.number===e))},at=((()=>{const e=rt(),t=Array.from({length:65},((t,r)=>((e,t)=>{const r=st(e,t);if(void 0===r)return{};const{name:n,description:o,supported:i,action:s,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:a,standard:c}}})(r,e)));Object.assign({},...t)})(),e=>0===e?e:ct(e,"`subprocess.kill()`'s argument")),ct=(e,t)=>{if(Number.isInteger(e))return lt(e,t);if("string"==typeof e)return ut(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${pt()}`)},lt=(e,t)=>{if(dt.has(e))return dt.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${pt()}`)},dt=new Map(Object.entries(Je.constants.signals).reverse().map((([e,t])=>[t,e]))),ut=(e,t)=>{if(e in Je.constants.signals)return e;if(e.toUpperCase()in Je.constants.signals)throw new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`);throw new TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${pt()}`)},pt=()=>`Available signal names: ${mt()}.\nAvailable signal numbers: ${ft()}.`,mt=()=>Object.keys(Je.constants.signals).sort().map((e=>`'${e}'`)).join(", "),ft=()=>[...new Set(Object.values(Je.constants.signals).sort(((e,t)=>e-t)))].join(", "),ht=e=>it[e].description,bt=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:o,controller:i},s,a)=>{const{signal:c,error:l}=gt(s,a,r);yt(l,n);const d=e(c);return wt({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:d,context:o,controller:i}),d},gt=(e,t,r)=>{const[n=r,o]=Ye(e)?[void 0,e]:[e,t];if("string"!=typeof n&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(void 0!==o&&!Ye(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:at(n),error:o}},yt=(e,t)=>{void 0!==e&&t.reject(e)},wt=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:o,context:i,controller:s})=>{t===n&&o&&vt({kill:e,forceKillAfterDelay:r,context:i,controllerSignal:s.signal})},vt=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(!1!==t)try{await(0,Ve.setTimeout)(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}},St=e(import.meta.url)("node:events"),xt=async(e,t)=>{e.aborted||await(0,St.once)(e,"abort",{signal:t})},Et=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:o})=>void 0===t||r?[]:[Tt(e,t,n,o)],Tt=async(e,t,r,{signal:n})=>{throw await xt(t,n),r.terminationReason??="cancel",e.kill(),t.reason},Dt=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{It(e,t,r),Ot(e,t,n)},It=(e,t,r)=>{if(!r)throw new Error(`${$t(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Ot=(e,t,r)=>{if(!r)throw new Error(`${$t(e,t)} cannot be used: the ${Bt(t)} has already exited or disconnected.`)},Mt=(e,t)=>new Error(`${$t("sendMessage",t)} failed when sending an acknowledgment response to the ${Bt(t)}.`,{cause:e}),Nt=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Ct=["could not be cloned","circular structure","call stack size exceeded"],$t=(e,t,r="")=>"cancelSignal"===e?"`cancelSignal`'s `controller.abort()`":`${At(t)}${e}(${r})`,At=e=>e?"":"subprocess.",Bt=e=>e?"parent process":"subprocess",jt=e=>{e.connected&&e.disconnect()},Pt=()=>{const e={},t=new Promise(((t,r)=>{Object.assign(e,{resolve:t,reject:r})}));return Object.assign(t,e)},kt=(e,t="stdin")=>{const r=!0,{options:n,fileDescriptors:o}=Lt.get(e),i=Ut(o,t,r),s=e.stdio[i];if(null===s)throw new TypeError(Wt(i,t,n,r));return s},Rt=(e,t="stdout")=>{const r=!1,{options:n,fileDescriptors:o}=Lt.get(e),i=Ut(o,t,r),s="all"===i?e.all:e.stdio[i];if(null==s)throw new TypeError(Wt(i,t,n,r));return s},Lt=new WeakMap,Ut=(e,t,r)=>{const n=Ft(t,r);return Gt(n,t,r,e),n},Ft=(e,t)=>{const r=W(e);if(void 0!==r)return r;const{validOptions:n,defaultValue:o}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Vt(t)}" must not be "${e}".\nIt must be ${n} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${o}".`)},Gt=(e,t,r,n)=>{const o=n[zt(e)];if(void 0===o)throw new TypeError(`"${Vt(r)}" must not be ${t}. That file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`);if("input"===o.direction&&!r)throw new TypeError(`"${Vt(r)}" must not be ${t}. It must be a readable stream, not writable.`);if("input"!==o.direction&&r)throw new TypeError(`"${Vt(r)}" must not be ${t}. It must be a writable stream, not readable.`)},Wt=(e,t,r,n)=>{if("all"===e&&!r.all)return'The "all" option must be true to use "from: \'all\'".';const{optionName:o,optionValue:i}=_t(e,r);return`The "${o}: ${Ht(i)}" option is incompatible with using "${Vt(n)}: ${Ht(t)}".\nPlease set this option with "pipe" instead.`},_t=(e,{stdin:t,stdout:r,stderr:n,stdio:o})=>{const i=zt(e);return 0===i&&void 0!==t?{optionName:"stdin",optionValue:t}:1===i&&void 0!==r?{optionName:"stdout",optionValue:r}:2===i&&void 0!==n?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${i}]`,optionValue:o[i]}},zt=e=>"all"===e?1:e,Vt=e=>e?"to":"from",Ht=e=>"string"==typeof e?`'${e}'`:"number"==typeof e?`${e}`:"Stream",Kt=(e,t,r)=>{const n=e.getMaxListeners();0!==n&&n!==Number.POSITIVE_INFINITY&&(e.setMaxListeners(n+t),(0,St.addAbortListener)(r,(()=>{e.setMaxListeners(e.getMaxListeners()-t)})))},qt=(e,t)=>{t&&Yt(e)},Yt=e=>{e.refCounted()},Xt=(e,t)=>{t&&Qt(e)},Qt=e=>{e.unrefCounted()},Jt=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},o)=>{if(cr(o)||Ir(o))return;er.has(e)||er.set(e,[]);const i=er.get(e);if(i.push(o),!(i.length>1))for(;i.length>0;){await fr(e,n,o),await Ve.scheduler.yield();const s=await ar({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});i.shift(),n.emit("message",s),n.emit("message:done")}},Zt=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{Mr();const i=er.get(e);for(;i?.length>0;)await(0,St.once)(n,"message:done");e.removeListener("message",o),((e,t)=>{t&&(Yt(e),Yt(e))})(t,r),n.connected=!1,n.emit("disconnect")},er=new WeakMap,tr=(e,t,r)=>{if(rr.has(e))return rr.get(e);const n=new St.EventEmitter;return n.connected=!0,rr.set(e,n),nr({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},rr=new WeakMap,nr=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{const o=Jt.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",o),t.once("disconnect",Zt.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:o})),((e,t)=>{t&&(Qt(e),Qt(e))})(r,n)},or=e=>{const t=rr.get(e);return void 0===t?null!==e.channel:t.connected};let ir=0n;const sr=(e,t)=>{if(t?.type===pr&&!t.hasListeners)for(const{id:t}of e)void 0!==t&&dr[t].resolve({isDeadlock:!0,hasListeners:!1})},ar=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(e?.type!==pr||!t.connected)return e;const{id:i,message:s}=e,a={id:i,type:mr,message:br(t,o)};try{await yr({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},a)}catch(e){o.emit("strict:error",e)}return s},cr=e=>{if(e?.type!==mr)return!1;const{id:t,message:r}=e;return dr[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},lr=async(e,t,r)=>{if(e?.type!==pr)return;const n=Pt();dr[e.id]=n;const o=new AbortController;try{const{isDeadlock:e,hasListeners:i}=await Promise.race([n,ur(t,r,o)]);e&&(e=>{throw new Error(`${$t("sendMessage",e)} failed: the ${Bt(e)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${$t("getOneMessage",e)},\n\t${$t("sendMessage",e,"message, {strict: true}")},\n]);`)})(r),i||(e=>{throw new Error(`${$t("sendMessage",e)} failed: the ${Bt(e)} is not listening to incoming messages.`)})(r)}finally{o.abort(),delete dr[e.id]}},dr={},ur=async(e,t,{signal:r})=>{Kt(e,1,r),await(0,St.once)(e,"disconnect",{signal:r}),(e=>{throw new Error(`${$t("sendMessage",e)} failed: the ${Bt(e)} exited without listening to incoming messages.`)})(t)},pr="execa:ipc:request",mr="execa:ipc:response",fr=async(e,t,r)=>{for(;!br(e,t)&&hr.get(e)?.size>0;){const t=[...hr.get(e)];sr(t,r),await Promise.all(t.map((({onMessageSent:e})=>e)))}},hr=new WeakMap,br=(e,t)=>t.listenerCount("message")>gr(e),gr=e=>Lt.has(e)&&!K(Lt.get(e).options.buffer,"ipc")?1:0,yr=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o,{strict:i=!1}={})=>{const s="sendMessage";return Dt({methodName:s,isSubprocess:r,ipc:n,isConnected:e.connected}),wr({anyProcess:e,channel:t,methodName:s,isSubprocess:r,message:o,strict:i})},wr=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:o,strict:i})=>{const s=(({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;const i=tr(e,t,r),s=br(e,i);return{id:ir++,type:pr,message:n,hasListeners:s}})({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:i}),a=((e,t,r)=>{hr.has(e)||hr.set(e,new Set);const n=hr.get(e),o={onMessageSent:Pt(),id:r?t.id:void 0};return n.add(o),{outgoingMessages:n,outgoingMessage:o}})(e,s,i);try{await vr({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:s,message:o})}catch(t){throw jt(e),t}finally{(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()})(a)}},vr=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:o})=>{const i=Sr(e);try{await Promise.all([lr(n,e,r),i(n)])}catch(e){throw(({error:e,methodName:t,isSubprocess:r})=>{if("EPIPE"===e.code)throw new Error(`${$t(t,r)} cannot be used: the ${Bt(r)} is disconnecting.`,{cause:e})})({error:e,methodName:t,isSubprocess:r}),(({error:e,methodName:t,isSubprocess:r,message:n})=>{if((({code:e,message:t})=>Nt.has(e)||Ct.some((e=>t.includes(e))))(e))throw new Error(`${$t(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:e})})({error:e,methodName:t,isSubprocess:r,message:o}),e}},Sr=e=>{if(xr.has(e))return xr.get(e);const t=(0,N.promisify)(e.send.bind(e));return xr.set(e,t),t},xr=new WeakMap,Er=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await Tr({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Nr.signal),Tr=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{Dr||(Dr=!0,n?null!==t?(tr(e,t,r),await Ve.scheduler.yield()):Mr():(()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")})())};let Dr=!1;const Ir=e=>e?.type===Or&&(Nr.abort(e.message),!0),Or="execa:ipc:cancel",Mr=()=>{Nr.abort(new Error(`\`cancelSignal\` aborted: the ${Bt(!0)} disconnected.`))},Nr=new AbortController,Cr=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:i})=>r?[$r({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:o,controller:i})]:[],$r=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await xt(t,o);const i=Ar(t);throw await((e,t)=>{const r="cancelSignal";return Ot(r,!1,e.connected),vr({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:Or,message:t},message:t})})(e,i),vt({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",t.reason},Ar=({reason:e})=>{if(!(e instanceof DOMException))return e;const t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},Br=(e,t,r,n)=>0===t||void 0===t?[]:[jr(e,t,r,n)],jr=async(e,t,r,{signal:n})=>{throw await(0,Ve.setTimeout)(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new He},Pr=e(import.meta.url)("node:v8"),kr={advanced:e=>{try{(0,Pr.serialize)(e)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},Rr=async(e,t)=>{void 0!==t&&await e.sendMessage(t)},Lr=new Set(["utf8","utf16le"]),Ur=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Fr=new Set([...Lr,...Ur]),Gr={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Wr=e=>"string"==typeof e?`"${e}"`:String(e),_r=()=>{try{return C.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},zr=(e,t,r)=>{r.cwd=((e=_r())=>{const t=s(e,'The "cwd" option');return Fe.resolve(t)})(r.cwd);const[n,o,i]=((e,t,{node:r=!1,nodePath:n=C.execPath,nodeOptions:o=C.execArgv.filter((e=>!e.startsWith("--inspect"))),cwd:i,execPath:a,...c})=>{if(void 0!==a)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const l=s(n,'The "nodePath" option'),d=Fe.resolve(i,l),u={...c,nodePath:d,node:r,cwd:i};if(!r)return[e,t,u];if("node"===Fe.basename(e,".exe"))throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[d,[...o,e,...t],{ipc:!0,...u,shell:!1}]})(e,t,r),{command:c,args:l,options:d}=Ge._parse(n,o,i),u=(e=>{const t={...e};for(const r of H)t[r]=P(e,r);return t})(d),p=Vr(u);return(({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)})(p),(({encoding:e})=>{if(Fr.has(e))return;const t=(e=>{if(null===e)return"buffer";if("string"!=typeof e)return;const t=e.toLowerCase();return t in Gr?Gr[t]:Fr.has(t)?t:void 0})(e);if(void 0!==t)throw new TypeError(`Invalid option \`encoding: ${Wr(e)}\`.\nPlease rename it to ${Wr(t)}.`);const r=[...Fr].map((e=>Wr(e))).join(", ");throw new TypeError(`Invalid option \`encoding: ${Wr(e)}\`.\nPlease rename it to one of: ${r}.`)})(p),(({ipcInput:e,ipc:t,serialization:r})=>{if(void 0!==e){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");kr[r](e)}})(p),(({cancelSignal:e})=>{if(void 0!==e&&"[object AbortSignal]"!==Object.prototype.toString.call(e))throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)})(p),(({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(e){if(void 0===t)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if("json"===n)throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}})(p),p.shell=a(p.shell),p.env=Hr(p),p.killSignal=(e=>{const t="option `killSignal`";if(0===e)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return ct(e,t)})(p.killSignal),p.forceKillAfterDelay=(e=>{if(!1===e)return e;if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e})(p.forceKillAfterDelay),p.lines=p.lines.map(((e,t)=>e&&!Ur.has(p.encoding)&&p.buffer[t])),"win32"===C.platform&&"cmd"===Fe.basename(c,".exe")&&l.unshift("/q"),{file:c,commandArguments:l,options:p}},Vr=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:o="utf8",reject:i=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:d=!0,gracefulCancel:u=!1,ipcInput:p,ipc:m=void 0!==p||u,serialization:f="advanced",...h})=>({...h,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:o,reject:i,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:d,gracefulCancel:u,ipcInput:p,ipc:m,serialization:f}),Hr=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:o,nodePath:i})=>{const s=t?{...C.env,...e}:e;return r||n?ze({env:s,cwd:o,execPath:i,preferLocal:r,addExecPath:n}):s};function Kr(e){if("string"==typeof e)return qr(e);if(!ArrayBuffer.isView(e)||1!==e.BYTES_PER_ELEMENT)throw new Error("Input must be a string or a Uint8Array");return Yr(e)}const qr=e=>e.at(-1)===Xr?e.slice(0,e.at(-2)===Jr?-2:-1):e,Yr=e=>e.at(-1)===Qr?e.subarray(0,e.at(-2)===Zr?-2:-1):e,Xr="\n",Qr=Xr.codePointAt(0),Jr="\r",Zr=Jr.codePointAt(0);function en(e,{checkOpen:t=!0}={}){return null!==e&&"object"==typeof e&&(e.writable||e.readable||!t||void 0===e.writable&&void 0===e.readable)&&"function"==typeof e.pipe}function tn(e,{checkOpen:t=!0}={}){return en(e,{checkOpen:t})&&(e.writable||!t)&&"function"==typeof e.write&&"function"==typeof e.end&&"boolean"==typeof e.writable&&"boolean"==typeof e.writableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function rn(e,{checkOpen:t=!0}={}){return en(e,{checkOpen:t})&&(e.readable||!t)&&"function"==typeof e.read&&"boolean"==typeof e.readable&&"boolean"==typeof e.readableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function nn(e,t){return tn(e,t)&&rn(e,t)}const on=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class sn{#e;#t;#r=!1;#n=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){const e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){const t=()=>this.#i(e);return this.#n?this.#n.then(t,t):t()}async#o(){if(this.#r)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#n=void 0,this.#r=!0,this.#e.releaseLock(),e}return e.done&&(this.#n=void 0,this.#r=!0,this.#e.releaseLock()),e}async#i(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#t){const t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}}const an=Symbol();function cn(){return this[an].next()}function ln(e){return this[an].return(e)}Object.defineProperty(cn,"name",{value:"next"}),Object.defineProperty(ln,"name",{value:"return"});const dn=Object.create(on,{next:{enumerable:!0,configurable:!0,writable:!0,value:cn},return:{enumerable:!0,configurable:!0,writable:!0,value:ln}});function un({preventCancel:e=!1}={}){const t=this.getReader(),r=new sn(t,e),n=Object.create(dn);return n[an]=r,n}const pn=e=>{if(rn(e,{checkOpen:!1})&&void 0!==bn.on)return fn(e);if("function"==typeof e?.[Symbol.asyncIterator])return e;if("[object ReadableStream]"===mn.call(e))return un.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:mn}=Object.prototype,fn=async function*(e){const t=new AbortController,r={};hn(e,t,r);try{for await(const[r]of bn.on(e,"data",{signal:t.signal}))yield r}catch(e){if(void 0!==r.error)throw r.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},hn=async(e,t,r)=>{try{await bn.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){r.error=e}finally{t.abort()}},bn={},gn=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const l=pn(e),d=t();d.length=0;try{for await(const e of l){const t=r[Sn(e)](e,d);wn({convertedChunk:t,state:d,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:c})}return yn({state:d,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,maxBuffer:c}),a(d)}catch(e){const t="object"==typeof e&&null!==e?e:new Error(e);throw t.bufferedData=a(d),t}},yn=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{const s=o(e);void 0!==s&&wn({convertedChunk:s,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},wn=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:i})=>{const s=r(e),a=t.length+s;if(a<=i)return void vn(e,t,o,a);const c=n(e,i-t.length);throw void 0!==c&&vn(c,t,o,i),new En},vn=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},Sn=e=>{const t=typeof e;if("string"===t)return"string";if("object"!==t||null===e)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";const r=xn.call(e);return"[object ArrayBuffer]"===r?"arrayBuffer":"[object DataView]"===r?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===xn.call(e.buffer)?"typedArray":"others"},{toString:xn}=Object.prototype;class En extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const Tn=(e,t,r)=>{if(t.length!==r)return;const n=new En;throw n.maxBufferInfo={fdNumber:"ipc"},n},Dn=([,e])=>e,In=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:i,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:d,isForcefullyTerminated:u,forceKillAfterDelay:p,killSignal:m})=>{const f=On(u,p);return t?`Command timed out after ${r} milliseconds${f}`:d?void 0===s?`Command was gracefully canceled with exit code ${c}`:u?`Command was gracefully canceled${f}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${f}`:n?`${((e,t)=>{const{streamName:r,threshold:n,unit:o}=((e,t)=>{if(void 0===e?.maxBufferInfo)return{streamName:"output",threshold:t[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;const o=K(t,r);return"ipc"===r?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:j(r),threshold:o,unit:n}})(e,t);return`Command's ${r} was larger than ${n} ${o}`})(e,o)}${f}`:void 0!==i?`Command failed with ${i}${f}`:u?`Command was killed with ${m} (${ht(m)})${f}`:void 0!==s?`Command was killed with ${s} (${a})`:void 0!==c?`Command failed with exit code ${c}`:"Command failed"},On=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",Mn=e=>"string"==typeof e?e:p(e)?g(e):"",Nn=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:o,options:{cwd:i},startTime:s})=>Bn({command:e,escapedCommand:t,cwd:i,durationMs:Le(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),Cn=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:s})=>$n({error:e,command:t,escapedCommand:r,startTime:i,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:s}),$n=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:d,stdio:u,all:p,ipcOutput:m,options:{timeoutDuration:f,timeout:h=f,forceKillAfterDelay:b,killSignal:g,cwd:y,maxBuffer:w},isSync:v})=>{const{exitCode:S,signal:x,signalDescription:E}=jn(l,d),{originalMessage:T,shortMessage:D,message:I}=(({stdio:e,all:t,ipcOutput:r,originalError:n,signal:o,signalDescription:i,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:d,isMaxBuffer:u,isForcefullyTerminated:p,forceKillAfterDelay:m,killSignal:f,maxBuffer:h,timeout:b,cwd:g})=>{const y=n?.code,w=In({originalError:n,timedOut:c,timeout:b,isMaxBuffer:u,maxBuffer:h,errorCode:y,signal:o,signalDescription:i,exitCode:s,isCanceled:l,isGracefullyCanceled:d,isForcefullyTerminated:p,forceKillAfterDelay:m,killSignal:f}),v=((e,t)=>{if(e instanceof He)return;const r=Ye(n=e)&&qe in n?e.originalMessage:String(e?.message??e);var n;const o=te(((e,t)=>{if(t===_r())return e;let r;try{r=(0,ee.statSync)(t)}catch(r){return`The "cwd" option is invalid: ${t}.\n${r.message}\n${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`})(r,t));return""===o?void 0:o})(n,g),S=`${w}: ${a}${void 0===v?"":`\n${v}`}`,x=[S,...void 0===t?[e[2],e[1]]:[t],...e.slice(3),r.map((e=>(e=>"string"==typeof e?e:(0,N.inspect)(e))(e))).join("\n")].map((e=>te(Kr((e=>Array.isArray(e)?e.map((e=>Kr(Mn(e)))).filter(Boolean).join("\n"):Mn(e))(e))))).filter(Boolean).join("\n\n");return{originalMessage:v,shortMessage:S,message:x}})({stdio:u,all:p,ipcOutput:m,originalError:e,signal:x,signalDescription:E,exitCode:S,escapedCommand:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:b,killSignal:g,maxBuffer:w,timeout:h,cwd:y}),O=((e,t,r)=>new(r?Qe:Xe)(t,e instanceof He?{}:{cause:e}))(e,I,v);return Object.assign(O,An({error:O,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:S,signal:x,signalDescription:E,stdio:u,all:p,ipcOutput:m,cwd:y,originalMessage:T,shortMessage:D})),O},An=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:d,signalDescription:u,stdio:p,all:m,ipcOutput:f,cwd:h,originalMessage:b,shortMessage:g})=>Bn({shortMessage:g,originalMessage:b,command:t,escapedCommand:r,cwd:h,durationMs:Le(n),failed:!0,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isTerminated:void 0!==d,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:d,signalDescription:u,code:e.cause?.code,stdout:p[1],stderr:p[2],all:m,stdio:p,ipcOutput:f,pipedFrom:[]}),Bn=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e))),jn=(e,t)=>{const r=null===t?void 0:t;return{exitCode:null===e?void 0:e,signal:r,signalDescription:void 0===r?void 0:ht(t)}},Pn=e=>Number.isFinite(e)?e:0;function kn(e,t){const r="bigint"==typeof e;if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");const n=e<0?"-":"";e=e<0?-e:e,(t={...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 o=[];const i=(e,r,n,i)=>{if(0!==o.length&&t.colonNotation||!(e=>0===e||0n===e)(e)||t.colonNotation&&"m"===n){if(i??=String(e),t.colonNotation){const e=i.includes(".")?i.split(".")[0].length:i.length,t=o.length>0?2:1;i="0".repeat(Math.max(0,t-e))+i}else i+=t.verbose?" "+((e,t)=>1===t||1n===t?e:`${e}s`)(r,e):n;o.push(i)}},s=function(e){switch(typeof e){case"number":if(Number.isFinite(e))return function(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(Pn(1e3*e)%1e3),nanoseconds:Math.trunc(Pn(1e6*e)%1e3)}}(e);break;case"bigint":return function(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}(e)}throw new TypeError("Expected a finite number or bigint")}(e),a=BigInt(s.days);if(i(a/365n,"year","y"),i(a%365n,"day","d"),i(Number(s.hours),"hour","h"),i(Number(s.minutes),"minute","m"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3){const e=Number(s.seconds),r=Number(s.milliseconds),n=Number(s.microseconds),o=Number(s.nanoseconds);if(i(e,"second","s"),t.formatSubMilliseconds)i(r,"millisecond","ms"),i(n,"microsecond","\xb5s"),i(o,"nanosecond","ns");else{const e=r+n/1e3+o/1e6,s="number"==typeof t.millisecondsDecimalDigits?t.millisecondsDecimalDigits:0,a=e>=1?Math.round(e):Math.ceil(e),c=s?e.toFixed(s):a;i(Number.parseFloat(c),"millisecond","ms",c)}}else{const n=((e,t)=>{const r=Math.floor(e*10**t+1e-7);return(Math.round(r)/10**t).toFixed(t)})((r?Number(e%86400000n):e)/1e3%60,"number"==typeof t.secondsDecimalDigits?t.secondsDecimalDigits:1),o=t.keepDecimalsOnWholeSeconds?n:n.replace(/\.0+$/,"");i(Number.parseFloat(o),"second","s",o)}if(0===o.length)return n+"0"+(t.verbose?" milliseconds":"ms");const c=t.colonNotation?":":" ";return"number"==typeof t.unitCount&&(o=o.slice(0,Math.max(t.unitCount,1))),n+o.join(c)}const Rn=(e,t)=>{const r=`(done in ${kn(e.durationMs)})`;Me({type:"duration",verboseMessage:r,verboseInfo:t,result:e})},Ln=(e,t,{reject:r})=>{if(((e,t)=>{q(t)&&(((e,t)=>{e.failed&&Me({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})})(e,t),Rn(e,t))})(e,t),e.failed&&r)throw e;return e},Un=(e,t)=>qn(e)?"asyncGenerator":Yn(e)?"generator":Qn(e)?"fileUrl":Jn(e)?"filePath":no(e)?"webStream":en(e,{checkOpen:!1})?"native":p(e)?"uint8Array":io(e)?"asyncIterable":so(e)?"iterable":oo(e)?Wn({transform:e},t):Xn(e)?Fn(e,t):"native",Fn=(e,t)=>nn(e.transform,{checkOpen:!1})?Gn(e,t):oo(e.transform)?Wn(e,t):Vn(e,t),Gn=(e,t)=>(_n(e,t,"Duplex stream"),"duplex"),Wn=(e,t)=>(_n(e,t,"web TransformStream"),"webTransform"),_n=({final:e,binary:t,objectMode:r},n,o)=>{zn(e,`${n}.final`,o),zn(t,`${n}.binary`,o),Hn(r,`${n}.objectMode`)},zn=(e,t,r)=>{if(void 0!==e)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},Vn=({transform:e,final:t,binary:r,objectMode:n},o)=>{if(void 0!==e&&!Kn(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(nn(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(oo(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(void 0!==t&&!Kn(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return Hn(r,`${o}.binary`),Hn(n,`${o}.objectMode`),qn(e)||qn(t)?"asyncGenerator":"generator"},Hn=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw new TypeError(`The \`${t}\` option must use a boolean.`)},Kn=e=>qn(e)||Yn(e),qn=e=>"[object AsyncGeneratorFunction]"===Object.prototype.toString.call(e),Yn=e=>"[object GeneratorFunction]"===Object.prototype.toString.call(e),Xn=e=>o(e)&&(void 0!==e.transform||void 0!==e.final),Qn=e=>"[object URL]"===Object.prototype.toString.call(e),Jn=e=>o(e)&&1===Object.keys(e).length&&Zn(e.file),Zn=e=>"string"==typeof e,eo=new Set(["ipc","ignore","inherit","overlapped","pipe"]),to=e=>"[object ReadableStream]"===Object.prototype.toString.call(e),ro=e=>"[object WritableStream]"===Object.prototype.toString.call(e),no=e=>to(e)||ro(e),oo=e=>to(e?.readable)&&ro(e?.writable),io=e=>ao(e)&&"function"==typeof e[Symbol.asyncIterator],so=e=>ao(e)&&"function"==typeof e[Symbol.iterator],ao=e=>"object"==typeof e&&null!==e,co=new Set(["generator","asyncGenerator","duplex","webTransform"]),lo=new Set(["fileUrl","filePath","fileNumber"]),uo=new Set(["fileUrl","filePath"]),po=new Set([...uo,"webStream","nodeStream"]),mo=new Set(["webTransform","duplex"]),fo={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"},ho=(e,t,r,n)=>"output"===n?bo(e,t,r):go(e,t,r),bo=(e,t,r)=>{const n=0!==t&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},go=(e,t,r)=>{const n=0===t?!0===e:r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t!==r.length-1&&(e??n)}},yo=(e,t,r,{encoding:n})=>{const o=e.filter((({type:e})=>co.has(e))),i=Array.from({length:o.length});for(const[e,s]of Object.entries(o))i[e]=wo({stdioItem:s,index:Number(e),newTransforms:i,optionName:t,direction:r,encoding:n});return Eo(i,r)},wo=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:o,direction:i,encoding:s})=>"duplex"===t?vo({stdioItem:e,optionName:o}):"webTransform"===t?So({stdioItem:e,index:r,newTransforms:n,direction:i}):xo({stdioItem:e,index:r,newTransforms:n,direction:i,encoding:s}),vo=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:i})=>{if(o&&!n)throw new TypeError(`The \`${i}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${i}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:n}}},So=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:i})=>{const{transform:s,objectMode:a}=o(t)?t:{transform:t},{writableObjectMode:c,readableObjectMode:l}=ho(a,r,n,i);return{...e,value:{transform:s,writableObjectMode:c,readableObjectMode:l}}},xo=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:i,encoding:s})=>{const{transform:a,final:c,binary:l=!1,preserveNewlines:d=!1,objectMode:u}=o(t)?t:{transform:t},p=l||Ur.has(s),{writableObjectMode:m,readableObjectMode:f}=ho(u,r,n,i);return{...e,value:{transform:a,final:c,binary:p,preserveNewlines:d,writableObjectMode:m,readableObjectMode:f}}},Eo=(e,t)=>"input"===t?e.reverse():e,To=["input","output","output"],Do=()=>{},Io=()=>"input",Oo={generator:Do,asyncGenerator:Do,fileUrl:Do,filePath:Do,iterable:Io,asyncIterable:Io,uint8Array:Io,webStream:e=>ro(e)?"output":"input",nodeStream:e=>rn(e,{checkOpen:!1})?tn(e,{checkOpen:!1})?void 0:"input":"output",webTransform:Do,duplex:Do,native(e){const t=Mo(e);return void 0!==t?t:en(e,{checkOpen:!1})?Oo.nodeStream(e):void 0}},Mo=e=>[0,C.stdin].includes(e)?"input":[1,2,C.stdout,C.stderr].includes(e)?"output":void 0,No=e=>B.some((t=>void 0!==e[t])),Co=(e,t)=>Array.isArray(e)?e.map((e=>Co(e,t))):null==e?t>=B.length?"ignore":"pipe":e,$o=e=>"pipe"===e||Array.isArray(e)&&e.every((e=>"pipe"===e)),Ao=({value:e,optionName:t,fdNumber:r,direction:n})=>{const o=Bo(e,r);if(void 0!==o){if("output"===n)return{type:"fileNumber",value:o,optionName:t};if(me.isatty(o))throw new TypeError(`The \`${t}: ${Ht(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:m((0,ee.readFileSync)(o)),optionName:t}}},Bo=(e,t)=>{if("inherit"===e)return t;if("number"==typeof e)return e;const r=A.indexOf(e);return-1!==r?r:void 0},jo=(e,t,r)=>{const n=A[e];if(void 0===n)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n},Po=({input:e,inputFile:t},r)=>0===r?[...ko(e),...Lo(t)]:[],ko=e=>void 0===e?[]:[{type:Ro(e),value:e,optionName:"input"}],Ro=e=>{if(rn(e,{checkOpen:!1}))return"nodeStream";if("string"==typeof e)return"string";if(p(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Lo=e=>void 0===e?[]:[{...Uo(e),optionName:"inputFile"}],Uo=e=>{if(Qn(e))return{type:"fileUrl",value:e};if(Zn(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},Fo=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{const i=e.filter((e=>Go(e,r)));if(0===i.length)return;const s=i.find((e=>e.direction!==o));return Wo(s,n,t),"output"===o?i[0].stream:void 0},Go=({type:e,value:t},r)=>"filePath"===e?t.file===r.file:"fileUrl"===e?t.href===r.href:t===r,Wo=(e,t,r)=>{if(void 0!==e)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${fo[r]} that is the same.`)},_o=(e,t,r,n)=>{const o=(({stdio:e,ipc:t,buffer:r,...n},o,i)=>{const s=((e,t)=>{if(void 0===e)return B.map((e=>t[e]));if(No(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${B.map((e=>`\`${e}\``)).join(", ")}`);if("string"==typeof e)return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const r=Math.max(e.length,B.length);return Array.from({length:r},((t,r)=>e[r]))})(e,n).map(((e,t)=>Co(e,t)));return i?((e,t,r)=>e.map(((e,n)=>t[n]||0===n||Y(r,n)||!$o(e)?e:"ignore")))(s,r,o):((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e)(s,t)})(t,r,n),i=o.map(((e,r)=>zo({stdioOption:e,fdNumber:r,options:t,isSync:n}))),s=Jo({initialFileDescriptors:i,addProperties:e,options:t,isSync:n});return t.stdio=s.map((({stdioItems:e})=>ri(e))),s},zo=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{const o=j(t),{stdioItems:i,isStdioArray:s}=Vo({stdioOption:e,fdNumber:t,options:r,optionName:o}),a=((e,t,r)=>{const n=e.map((e=>(({type:e,value:t},r)=>To[r]??Oo[e](t))(e,t)));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??"output"})(i,t,o),c=i.map((e=>(({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:o,isSync:i})=>r&&"native"===t?i?(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:o})=>{const i=Ao({value:t,optionName:r,fdNumber:n,direction:o});if(void 0!==i)return i;if(en(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e})({stdioItem:e,fdNumber:n,direction:o}):(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>"inherit"===t?{type:"nodeStream",value:jo(n,t,r),optionName:r}:"number"==typeof t?{type:"nodeStream",value:jo(t,t,r),optionName:r}:en(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e)({stdioItem:e,fdNumber:n}):e)({stdioItem:e,isStdioArray:s,fdNumber:t,direction:a,isSync:n}))),l=((e,t,r,n)=>[...e.filter((({type:e})=>!co.has(e))),...yo(e,t,r,n)])(c,o,a,r),d=((e,t)=>{const r=e.findLast((({type:e})=>co.has(e)));return void 0!==r&&("input"===t?r.value.writableObjectMode:r.value.readableObjectMode)})(l,a);return Qo(l,d),{direction:a,objectMode:d,stdioItems:l}},Vo=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{const o=(e=>e.filter(((t,r)=>e.every(((e,n)=>t.value!==e.value||r>=n||"generator"===t.type||"asyncGenerator"===t.type)))))([...(Array.isArray(e)?e:[e]).map((e=>Ho(e,n))),...Po(r,t)]),i=o.length>1;return Ko(o,i,n),Yo(o),{stdioItems:o,isStdioArray:i}},Ho=(e,t)=>({type:Un(e,t),value:e,optionName:t}),Ko=(e,t,r)=>{if(0===e.length)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t)for(const{value:t,optionName:r}of e)if(qo.has(t))throw new Error(`The \`${r}\` option must not include \`${t}\`.`)},qo=new Set(["ignore","ipc"]),Yo=e=>{for(const t of e)Xo(t)},Xo=({type:e,value:t,optionName:r})=>{if((e=>Qn(e)&&"file:"!==e.protocol)(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.\nFor example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(((e,t)=>"native"===e&&"string"==typeof t&&!eo.has(t))(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Qo=(e,t)=>{if(!t)return;const r=e.find((({type:e})=>lo.has(e)));if(void 0!==r)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},Jo=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{const o=[];try{for(const i of e)o.push(Zo({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:r,isSync:n}));return o}catch(e){throw ti(o),e}},Zo=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:o,options:i,isSync:s})=>{const a=r.map((t=>ei({stdioItem:t,addProperties:o,direction:e,options:i,fileDescriptors:n,isSync:s})));return{direction:e,objectMode:t,stdioItems:a}},ei=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:o,isSync:i})=>{const s=(({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:o,isSync:i})=>{const s=((e,t)=>e.flatMap((({direction:e,stdioItems:r})=>r.filter((e=>e.type===t)).map((t=>({...t,direction:e}))))))(o,e);if(0!==s.length){if(!i)return po.has(e)?Fo({otherStdioItems:s,type:e,value:t,optionName:r,direction:n}):void(mo.has(e)&&(({otherStdioItems:e,type:t,value:r,optionName:n})=>{const o=e.find((({value:{transform:e}})=>e===r.transform));Wo(o,n,t)})({otherStdioItems:s,type:e,value:t,optionName:r}));(({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{uo.has(t)&&Fo({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})})({otherStdioItems:s,type:e,value:t,optionName:r,direction:n})}})({stdioItem:e,direction:r,fileDescriptors:o,isSync:i});return void 0!==s?{...e,stream:s}:{...e,...t[r][e.type](e,n)}},ti=e=>{for(const{stdioItems:t}of e)for(const{stream:e}of t)void 0===e||$(e)||e.destroy()},ri=e=>{if(e.length>1)return e.some((({value:e})=>"overlapped"===e))?"overlapped":"pipe";const[{type:t,value:r}]=e;return"native"===t?r:"pipe"},ni=({type:e,optionName:t})=>{oi(t,fo[e])},oi=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},ii={generator(){},asyncGenerator:ni,webStream:ni,nodeStream:ni,webTransform:ni,duplex:ni,asyncIterable:ni,native:({optionName:e,value:t})=>("ipc"!==t&&"overlapped"!==t||oi(e,`"${t}"`),{})},si={input:{...ii,fileUrl:({value:e})=>({contents:[m((0,ee.readFileSync)(e))]}),filePath:({value:{file:e}})=>({contents:[m((0,ee.readFileSync)(e))]}),fileNumber:ni,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...ii,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e}})=>({path:e}),fileNumber:({value:e})=>({path:e}),iterable:ni,string:ni,uint8Array:ni}},ai=(e,{stripFinalNewline:t},r)=>ci(t,r)&&void 0!==e&&!Array.isArray(e)?Kr(e):e,ci=(e,t)=>"all"===t?e[1]||e[2]:e[t];var li=n(7075);const di=(e,t,r,n)=>e||r?void 0:mi(t,n),ui=(e,t,r)=>r?e.flatMap((e=>pi(e,t))):pi(e,t),pi=(e,t)=>{const{transform:r,final:n}=mi(t,{});return[...r(e),...n()]},mi=(e,t)=>(t.previousChunks="",{transform:fi.bind(void 0,t,e),final:bi.bind(void 0,t)}),fi=function*(e,t,r){if("string"!=typeof r)return void(yield r);let{previousChunks:n}=e,o=-1;for(let i=0;i<r.length;i+=1)if("\n"===r[i]){const s=hi(r,i,t,e);let a=r.slice(o+1,i+1-s);n.length>0&&(a=wi(n,a),n=""),yield a,o=i}o!==r.length-1&&(n=wi(n,r.slice(o+1))),e.previousChunks=n},hi=(e,t,r,n)=>r?0:(n.isWindowsNewline=0!==t&&"\r"===e[t-1],n.isWindowsNewline?2:1),bi=function*({previousChunks:e}){e.length>0&&(yield e)},gi=({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:yi.bind(void 0,n)},yi=function*({isWindowsNewline:e=!1},t){const{unixNewline:r,windowsNewline:n,LF:o,concatBytes:i}="string"==typeof t?vi:Si;if(t.at(-1)===o)return void(yield t);const s=e?n:r;yield i(t,s)},wi=(e,t)=>`${e}${t}`,vi={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:wi},Si={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}};var xi=n(4573);const Ei=(e,t)=>e?void 0:Ti.bind(void 0,t),Ti=function*(e,t){if("string"!=typeof t&&!p(t)&&!xi.Buffer.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Di=(e,t)=>e?Ii.bind(void 0,t):Oi.bind(void 0,t),Ii=function*(e,t){Mi(e,t),yield t},Oi=function*(e,t){if(Mi(e,t),"string"!=typeof t&&!p(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Mi=(e,t)=>{if(null==t)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.\nInstead, \`yield\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`)},Ni=(e,t,r)=>{if(r)return;if(e)return{transform:Ci.bind(void 0,new TextEncoder)};const n=new d.StringDecoder(t);return{transform:$i.bind(void 0,n),final:Ai.bind(void 0,n)}},Ci=function*(e,t){xi.Buffer.isBuffer(t)?yield m(t):"string"==typeof t?yield e.encode(t):yield t},$i=function*(e,t){yield p(t)?e.write(t):t},Ai=function*(e){const t=e.end();""!==t&&(yield t)},Bi=(0,N.callbackify)((async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(const e of t.currentIterable)n.push(e)}finally{delete t.currentIterable}})),ji=async function*(e,t,r){if(r===t.length)return void(yield e);const{transform:n=Li}=t[r];for await(const o of n(e))yield*ji(o,t,r+1)},Pi=async function*(e){for(const[t,{final:r}]of Object.entries(e))yield*ki(r,Number(t),e)},ki=async function*(e,t,r){if(void 0!==e)for await(const n of e())yield*ji(n,r,t+1)},Ri=(0,N.callbackify)((async({currentIterable:e},t)=>{if(void 0===e){if(t)throw t}else await(t?e.throw(t):e.return())})),Li=function*(e){yield e},Ui=(e,t,r,n)=>{try{for(const n of e(...t))r.push(n);n()}catch(e){n(e)}},Fi=(e,t)=>[...t.flatMap((t=>[...Gi(t,e,0)])),...Wi(e)],Gi=function*(e,t,r){if(r===t.length)return void(yield e);const{transform:n=zi}=t[r];for(const o of n(e))yield*Gi(o,t,r+1)},Wi=function*(e){for(const[t,{final:r}]of Object.entries(e))yield*_i(r,Number(t),e)},_i=function*(e,t,r){if(void 0!==e)for(const n of e())yield*Gi(n,r,t+1)},zi=function*(e){yield e},Vi=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:o},optionName:i},{encoding:s})=>{const a={},c=Ki(e,s,i),l=qn(t),d=qn(r),u=l?Bi.bind(void 0,ji,a):Ui.bind(void 0,Gi),p=l||d?Bi.bind(void 0,Pi,a):Ui.bind(void 0,Wi),m=l||d?Ri.bind(void 0,a):void 0;return{stream:new li.Transform({writableObjectMode:n,writableHighWaterMark:(0,li.getDefaultHighWaterMark)(n),readableObjectMode:o,readableHighWaterMark:(0,li.getDefaultHighWaterMark)(o),transform(e,t,r){u([e,c,0],this,r)},flush(e){p([c],this,e)},destroy:m})}},Hi=(e,t,r,n)=>{const o=t.filter((({type:e})=>"generator"===e)),i=n?o.reverse():o;for(const{value:t,optionName:n}of i){const o=Ki(t,r,n);e=Fi(o,e)}return e},Ki=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:i},s,a)=>{const c={};return[{transform:Ei(n,a)},Ni(r,s,n),di(r,i,n,c),{transform:e,final:t},{transform:Di(o,a)},gi({binary:r,preserveNewlines:i,readableObjectMode:o,state:c})].filter(Boolean)},qi=(e,t,r)=>{const{stdioItems:n}=e[t],o=n.filter((({contents:e})=>void 0!==e));if(0===o.length)return;if(0!==t){const[{type:e,optionName:t}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${fo[e]} with synchronous methods.`)}const i=o.map((({contents:e})=>e)).map((e=>Yi(e,n)));r.input=y(i)},Yi=(e,t)=>{const r=Hi(e,t,"utf8",!0);return Xi(r),y(r)},Xi=e=>{const t=e.find((e=>"string"!=typeof e&&!p(e)));if(void 0!==t)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},Qi=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>"all"!==n&&Y(r,n)&&!Ur.has(t)&&Ji(n)&&(e.some((({type:e,value:t})=>"native"===e&&Zi.has(t)))||e.every((({type:e})=>co.has(e)))),Ji=e=>1===e||2===e,Zi=new Set(["pipe","overlapped"]),es=e=>e._readableState.pipes.length>0,ts=(e,t,r)=>{const n=Be(e);Me({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})},rs=(e,t,r,n)=>{try{return Hi(e,t,r,!1)}catch(t){return n.error=t,e}},ns=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if("buffer"===r)return{serializedResult:y(e)};const s=((e,t)=>((e,t)=>{if("utf8"===t&&e.every((e=>"string"==typeof e)))return e;const r=new d.StringDecoder(t),n=e.map((e=>"string"==typeof e?h(e):e)).map((e=>r.write(e))),o=r.end();return""===o?n:[...n,o]})(e,t).join(""))(e,r);return n[i]?{serializedResult:s,finalResult:ui(s,!o[i],t)}:{serializedResult:s}},os=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:o,stdioItems:i,objectMode:s})=>{if(!Qi({stdioItems:i,encoding:o,verboseInfo:n,fdNumber:t}))return;const a=ui(e,!1,s);try{((e,t,r)=>{for(const n of e)ts(n,t,r)})(a,t,n)}catch(e){r.error??=e}},is=(e,t,r)=>{for(const{path:n}of t.filter((({type:e})=>lo.has(e)))){const t="string"==typeof n?n:n.toString();r.has(t)?(0,ee.appendFileSync)(n,e):(r.add(t),(0,ee.writeFileSync)(n,e))}},ss=async e=>{try{return await(0,St.once)(e,"exit")}catch{return ss(e)}},as=async e=>{const[t,r]=await e;if(!cs(t,r)&&ls(t,r))throw new He;return[t,r]},cs=(e,t)=>void 0===e&&void 0===t,ls=(e,t)=>0!==e||null!==t,ds=(e,t,r)=>void 0!==e?e:ls(t,r)?new He:void 0,us=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,ps=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&ms("ipcInput"),e&&ms("ipc: true"),r&&ms("detached: true"),n&&ms("cancelSignal")},ms=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},fs=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:a})=>{const c=hs({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:a});if(c.failed)return c;const{resultError:l,exitCode:d,signal:u,timedOut:f,isMaxBuffer:h}=(({error:e,status:t,signal:r,output:n},{maxBuffer:o})=>{const i=ds(e,t,r),s="ETIMEDOUT"===i?.code,a=((e,t,r)=>"ENOBUFS"===e?.code&&null!==t&&t.some((e=>null!==e&&e.length>Dn(r))))(i,n,o);return{resultError:i,exitCode:t,signal:r,timedOut:s,isMaxBuffer:a}})(c,r),{output:b,error:g=l}=(({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(null===t)return{output:Array.from({length:3})};const i={},s=new Set([]);return{output:t.map(((t,a)=>(({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:i,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:d,maxBuffer:u})=>{if(null===e)return;const p=((e,t,r)=>{if(!t)return e;const n=Dn(r);return e.length>n?e.slice(0,n):e})(e,i,u),f=m(p),{stdioItems:h,objectMode:b}=t[r],g=rs([f],h,c,n),{serializedResult:y,finalResult:w=y}=ns({chunks:g,objectMode:b,encoding:c,lines:l,stripFinalNewline:d,fdNumber:r});os({serializedResult:y,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:b});const v=a[r]?w:void 0;try{return void 0===n.error&&is(y,h,o),v}catch(e){return n.error=e,v}})({result:t,fileDescriptors:e,fdNumber:a,state:i,outputFiles:s,isMaxBuffer:n,verboseInfo:o},r))),...i}})({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:h,verboseInfo:i}),y=b.map(((e,t)=>ai(e,r,t))),w=ai((([,e,t],r)=>{if(r.all)return void 0===e?t:void 0===t?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,ai(t,r,"all")]:Array.isArray(t)?[ai(e,r,"all"),...t]:p(e)&&p(t)?v([e,t]):`${e}${t}`})(b,r),r,"all");return gs({error:g,exitCode:d,signal:u,timedOut:f,isMaxBuffer:h,stdio:y,all:w,options:r,command:n,escapedCommand:o,startTime:a})},hs=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{((e,t)=>{for(const r of(e=>new Set(Object.entries(e).filter((([,{direction:e}])=>"input"===e)).map((([e])=>Number(e)))))(e))qi(e,r,t)})(i,r);const n=bs(r);return(0,l.spawnSync)(e,t,n)}catch(e){return Cn({error:e,command:n,escapedCommand:o,fileDescriptors:i,options:r,startTime:s,isSync:!0})}},bs=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:Dn(t)}),gs=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:o,stdio:i,all:s,options:a,command:c,escapedCommand:l,startTime:d})=>void 0===e?Nn({command:c,escapedCommand:l,stdio:i,all:s,ipcOutput:[],options:a,startTime:d}):$n({error:e,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:i,all:s,ipcOutput:[],options:a,startTime:d,isSync:!0}),ys=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0,filter:i}={})=>(Dt({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:or(e)}),ws({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:o})),ws=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:o})=>{qt(t,o);const i=tr(e,t,r),s=new AbortController;try{return await Promise.race([vs(i,n,s),Ss(i,r,s),xs(i,r,s)])}catch(t){throw jt(e),t}finally{s.abort(),Xt(t,o)}},vs=async(e,t,{signal:r})=>{if(void 0===t){const[t]=await(0,St.once)(e,"message",{signal:r});return t}for await(const[n]of(0,St.on)(e,"message",{signal:r}))if(t(n))return n},Ss=async(e,t,{signal:r})=>{await(0,St.once)(e,"disconnect",{signal:r}),(e=>{throw new Error(`${$t("getOneMessage",e)} could not complete: the ${Bt(e)} exited or disconnected.`)})(t)},xs=async(e,t,{signal:r})=>{const[n]=await(0,St.once)(e,"strict:error",{signal:r});throw Mt(n,t)},Es=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0}={})=>Ts({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),Ts=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:o,reference:i})=>{Dt({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:or(e)}),qt(t,i);const s=tr(e,t,r),a=new AbortController,c={};return Ds(e,s,a),Is({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),Os({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:r,shouldAwait:o,controller:a,state:c,reference:i})},Ds=async(e,t,r)=>{try{await(0,St.once)(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},Is=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{const[o]=await(0,St.once)(e,"strict:error",{signal:r.signal});n.error=Mt(o,t),r.abort()}catch{}},Os=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:i,state:s,reference:a}){try{for await(const[e]of(0,St.on)(r,"message",{signal:i.signal}))Ms(s),yield e}catch{Ms(s)}finally{i.abort(),Xt(t,a),n||jt(e),o&&await e}},Ms=({error:e})=>{if(e)throw e},Ns=(e,t,r)=>({sendMessage:yr.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:ys.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:Es.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}),Cs=()=>{const e=new li.PassThrough;return e.end(),e},$s=()=>new li.Readable({read(){}}),As=()=>new li.Writable({write(){}}),Bs=()=>new li.Duplex({read(){},write(){}}),js=async(e,t,r)=>Ln(e,t,r),Ps=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${fo[e]}.`)},ks={fileNumber:Ps,generator:Vi,asyncGenerator:Vi,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){const n=t||r;return{stream:li.Duplex.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Rs={input:{...ks,fileUrl:({value:e})=>({stream:(0,ee.createReadStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,ee.createReadStream)(e)}),webStream:({value:e})=>({stream:li.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:li.Readable.from(e)}),asyncIterable:({value:e})=>({stream:li.Readable.from(e)}),string:({value:e})=>({stream:li.Readable.from(e)}),uint8Array:({value:e})=>({stream:li.Readable.from(xi.Buffer.from(e))})},output:{...ks,fileUrl:({value:e})=>({stream:(0,ee.createWriteStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,ee.createWriteStream)(e)}),webStream:({value:e})=>({stream:li.Writable.fromWeb(e)}),iterable:Ps,asyncIterable:Ps,string:Ps,uint8Array:Ps}},Ls=e(import.meta.url)("node:stream/promises");function Us(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const t of e)Vs(t);const t=e.some((({readableObjectMode:e})=>e)),r=Fs(e,t),n=new Gs({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(const t of e)n.add(t);return n}const Fs=(e,t)=>{if(0===e.length)return(0,li.getDefaultHighWaterMark)(t);const r=e.filter((({readableObjectMode:e})=>e===t)).map((({readableHighWaterMark:e})=>e));return Math.max(...r)};class Gs extends li.PassThrough{#s=new Set([]);#a=new Set([]);#c=new Set([]);#l;#d=Symbol("unpipe");#u=new WeakMap;add(e){if(Vs(e),this.#s.has(e))return;this.#s.add(e),this.#l??=Ws(this,this.#s,this.#d);const t=Hs({passThroughStream:this,stream:e,streams:this.#s,ended:this.#a,aborted:this.#c,onFinished:this.#l,unpipeEvent:this.#d});this.#u.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Vs(e),!this.#s.has(e))return!1;const t=this.#u.get(e);return void 0!==t&&(this.#u.delete(e),e.unpipe(this),await t,!0)}}const Ws=async(e,t,r)=>{ra(e,na);const n=new AbortController;try{await Promise.race([_s(e,n),zs(e,t,r,n)])}finally{n.abort(),ra(e,-na)}},_s=async(e,{signal:t})=>{try{await(0,Ls.finished)(e,{signal:t,cleanup:!0})}catch(t){throw Qs(e,t),t}},zs=async(e,t,r,{signal:n})=>{for await(const[o]of(0,St.on)(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},Vs=e=>{if("function"!=typeof e?.pipe)throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Hs=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{ra(e,oa);const a=new AbortController;try{await Promise.race([Ks(i,t,a),qs({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),Ys({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),ra(e,-oa)}r.size>0&&r.size===n.size+o.size&&(0===n.size&&o.size>0?Zs(e):Xs(e))},Ks=async(e,t,{signal:r})=>{try{await e,r.aborted||Zs(t)}catch(e){r.aborted||Qs(t,e)}},qs=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await(0,Ls.finished)(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(n){if(i.aborted||!r.has(t))return;Js(n)?o.add(t):ea(e,n)}},Ys=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await(0,St.once)(e,o,{signal:i}),!e.readable)return(0,St.once)(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},Xs=e=>{e.writable&&e.end()},Qs=(e,t)=>{Js(t)?Zs(e):ea(e,t)},Js=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,Zs=e=>{(e.readable||e.writable)&&e.destroy()},ea=(e,t)=>{e.destroyed||(e.once("error",ta),e.destroy(t))},ta=()=>{},ra=(e,t)=>{const r=e.getMaxListeners();0!==r&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},na=2,oa=1,ia=(e,t)=>{e.pipe(t),sa(e,t),ca(e,t)},sa=async(e,t)=>{if(!$(e)&&!$(t)){try{await(0,Ls.finished)(e,{cleanup:!0,readable:!0,writable:!1})}catch{}aa(t)}},aa=e=>{e.writable&&e.end()},ca=async(e,t)=>{if(!$(e)&&!$(t)){try{await(0,Ls.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}la(e)}},la=e=>{e.readable&&e.destroy()},da=(e,t,r,n)=>{"output"===r?ia(e.stdio[n],t):ia(t,e.stdio[n]);const o=ua[n];void 0!==o&&(e[o]=t),e.stdio[n]=t},ua=["stdin","stdout","stderr"],pa=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:o,controller:i})=>{if(void 0===t)return;ma(t,i);const[s,a]="output"===r?[t,e.stdio[n]]:[e.stdio[n],t],c=o.get(s)??[];o.set(s,[...c,a])},ma=(e,{signal:t})=>{$(e)&&Kt(e,fa,t)},fa=2;var ha=n(7017);const ba=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(ga,e)(r,...n),pipeOptions:e};if("string"==typeof r||r instanceof URL){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[o,i,s]=c(r,...n);return{destination:t(ga)(o,i,s),pipeOptions:s}}if(Lt.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},ga=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),ya=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>Cn({error:e,command:wa,escapedCommand:wa,fileDescriptors:t,options:r,startTime:n,isSync:!1}),wa="source.pipe(destination)",va=async e=>{const[{status:t,reason:r,value:n=r},{status:o,reason:i,value:s=i}]=await e;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),"rejected"===o)throw s;if("rejected"===t)throw n;return s},Sa=new WeakMap,xa=(e,t)=>void 0===e?[]:[Ea(e,t)],Ea=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:i})=>{await(0,N.aborted)(e,t),await r.remove(t);const s=new Error("Pipe canceled by `unpipeSignal` option.");throw ya({error:s,fileDescriptors:n,sourceOptions:o,startTime:i})},Ta=(e,...t)=>{if(o(t[0]))return Ta.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});const{destination:r,...n}=(({source:e,sourcePromise:t,boundOptions:r,createNested:n},...o)=>{const i=Re(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:d}=((e,t,r)=>{try{const{destination:n,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=ba(e,t,...r);return{destination:n,destinationStream:kt(n,i),from:o,unpipeSignal:s}}catch(e){return{destinationError:e}}})(r,n,o),{sourceStream:u,sourceError:p}=((e,t)=>{try{return{sourceStream:Rt(e,t)}}catch(e){return{sourceError:e}}})(e,l),{options:m,fileDescriptors:f}=Lt.get(e);return{sourcePromise:t,sourceStream:u,sourceOptions:m,sourceError:p,destination:s,destinationStream:a,destinationError:c,unpipeSignal:d,fileDescriptors:f,startTime:i}})(e,...t),i=Da({...n,destination:r});return i.pipe=Ta.bind(void 0,{...e,source:r,sourcePromise:i,boundOptions:{}}),i},Da=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:o,destinationStream:i,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{const d=Ia(e,o);(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:i,startTime:s})=>{const a=(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>void 0!==t&&void 0!==n?n:void 0!==n?(la(e),n):void 0!==t?(aa(r),t):void 0)({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(void 0!==a)throw ya({error:a,fileDescriptors:o,sourceOptions:i,startTime:s})})({sourceStream:t,sourceError:n,destinationStream:i,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});const u=new AbortController;try{const e=((e,t,r)=>{const n=Sa.has(t)?((e,t)=>{const r=Sa.get(t);return r.add(e),r})(e,t):((e,t)=>{const r=Us([e]);return ia(r,t),Sa.set(t,r),r})(e,t);return Kt(e,2,r.signal),Kt(t,1,r.signal),(async e=>{try{await(0,Ls.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Sa.delete(e)})(t),n})(t,i,u);return await Promise.race([va(d),...xa(a,{sourceStream:t,mergedStream:e,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{u.abort()}},Ia=(e,t)=>Promise.allSettled([e,t]),Oa=e=>e,Ma=()=>{},Na=({contents:e})=>e,Ca=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},$a=e=>e.length,Aa={init:()=>({contents:[]}),convertChunk:{string:Oa,buffer:Oa,arrayBuffer:Oa,dataView:Oa,typedArray:Oa,others:Oa},getSize:()=>1,truncateChunk:Ma,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:Ma,finalize:Na},Ba=new TextEncoder,ja=e=>new Uint8Array(e),Pa=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ka=e=>Ra**Math.ceil(Math.log(e)/Math.log(Ra)),Ra=2,La=()=>"resize"in ArrayBuffer.prototype,Ua={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>Ba.encode(e),buffer:ja,arrayBuffer:ja,dataView:Pa,typedArray:Pa,others:Ca},getSize:$a,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:r},n)=>{const o=La()?((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;const r=new ArrayBuffer(t,{maxByteLength:ka(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n):((e,t)=>{if(t<=e.byteLength)return e;const r=new ArrayBuffer(ka(t));return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n);return new Uint8Array(o).set(e,r),o},getFinalChunk:Ma,finalize:({contents:e,length:t})=>La()?e:e.slice(0,t)},Fa=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Ga={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:Oa,buffer:Fa,arrayBuffer:Fa,dataView:Fa,typedArray:Fa,others:Ca},getSize:$a,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{const t=e.decode();return""===t?void 0:t},finalize:Na},Wa=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:o,preserveNewlines:i})=>{const s=new AbortController;return _a(t,s),Ha({stream:e,controller:s,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},_a=async(e,t)=>{try{await e}catch{}finally{t.abort()}},za=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:o,allMixed:i})=>{const s=new AbortController;Va(t,s,e);const a=e.readableObjectMode&&!i;return Ha({stream:e,controller:s,binary:"buffer"===n,shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},Va=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},Ha=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})=>{const a=(0,St.on)(e,"data",{signal:t.signal,highWaterMark:qa,highWatermark:qa});return Ya({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})},Ka=(0,li.getDefaultHighWaterMark)(!0),qa=Ka,Ya=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s}){const a=Xa({binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(const[t]of e)yield*Gi(t,a,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*Wi(a)}},Xa=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:o})=>[Ni(e,r,!t),di(e,o,!n,{})].filter(Boolean),Qa=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:d})=>{const u=Ja({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:d});if(!o)return void await Promise.all([Za(e),u]);const p=ci(c,r),m=za({stream:e,onStreamEnd:t,lines:s,encoding:n,stripFinalNewline:p,allMixed:a}),[f]=await Promise.all([ec({stream:e,iterable:m,fdNumber:r,encoding:n,maxBuffer:i,lines:s}),u]);return f},Ja=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!Qi({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:i,fdNumber:r}))return;const a=za({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await(async(e,t,r,n)=>{for await(const o of e)es(t)||ts(o,r,n)})(a,e,r,i)},Za=async e=>{await(0,Ve.setImmediate)(),null===e.readableFlowing&&e.resume()},ec=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:o,maxBuffer:i,lines:s})=>{try{return t||s?await async function(e,t){return gn(e,Aa,t)}(r,{maxBuffer:i}):"buffer"===o?new Uint8Array(await async function(e,t){return gn(e,Ua,t)}(r,{maxBuffer:i})):await async function(e,t){return gn(e,Ga,t)}(r,{maxBuffer:i})}catch(r){return rc((({error:e,stream:t,readableObjectMode:r,lines:n,encoding:o,fdNumber:i})=>{if(!(e instanceof En))throw e;if("all"===i)return e;const s=((e,t,r)=>e?"objects":t?"lines":"buffer"===r?"bytes":"characters")(r,n,o);throw e.maxBufferInfo={fdNumber:i,unit:s},t.destroy(),e})({error:r,stream:e,readableObjectMode:t,lines:s,encoding:o,fdNumber:n}))}},tc=async e=>{try{return await e}catch(e){return rc(e)}},rc=({bufferedData:e})=>{return t=e,"[object ArrayBuffer]"===u.call(t)?new Uint8Array(e):e;var t},nc=async(e,t,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{const i=oc(e,r),s=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],(0,Ls.finished)(e,{cleanup:!0,signal:s.signal})])}catch(e){i.stdinCleanedUp||ac(e,t,r,n)}finally{s.abort()}},oc=(e,{originalStreams:[t],subprocess:r})=>{const n={stdinCleanedUp:!1};return e===t&&ic(e,r,n),n},ic=(e,t,r)=>{const{_destroy:n}=e;e._destroy=(...o)=>{sc(t,r),n.call(e,...o)}},sc=({exitCode:e,signalCode:t},r)=>{null===e&&null===t||(r.stdinCleanedUp=!0)},ac=(e,t,r,n)=>{if(!cc(e,t,r,n))throw e},cc=(e,t,r,n=!0)=>r.propagating?uc(e)||dc(e):(r.propagating=!0,lc(r,t)===n?uc(e):dc(e)),lc=({fileDescriptors:e},t)=>"all"!==t&&"input"===e[t].direction,dc=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,uc=e=>"EPIPE"===e?.code,pc=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!e)return;const d=nc(e,t,l);if(lc(l,t))return void await d;const[u]=await Promise.all([Qa({stream:e,onStreamEnd:d,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),d]);return u},mc=({stdout:e,stderr:t,all:r},[,n,o])=>{const i=n||o;return i?n?o?{stream:r,buffer:i}:{stream:e,buffer:i}:{stream:t,buffer:i}:{stream:r,buffer:i}},fc=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode,hc=(e,t)=>{const r=Be(e);Me({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})},bc=async(e,t)=>(await Promise.allSettled([e]),t),gc=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:o,timeoutDuration:i,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:d,ipcInput:u},context:p,verboseInfo:m,fileDescriptors:f,originalStreams:h,onInternalError:b,controller:g})=>{const y=(async(e,t)=>{const[r,n]=await(async e=>{const[t,r]=await Promise.allSettled([(0,St.once)(e,"spawn"),(0,St.once)(e,"exit")]);return"rejected"===t.status?[]:"rejected"===r.status?ss(e):r.value})(e);return t.isForcefullyTerminated??=!1,[r,n]})(e,p),w={originalStreams:h,fileDescriptors:f,subprocess:e,exitPromise:y,propagating:!1},v=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>e.stdio.map(((e,c)=>pc({stream:e,fdNumber:c,encoding:t,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:i,verboseInfo:s,streamInfo:a}))))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:l,verboseInfo:m,streamInfo:w}),S=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>pc({...mc(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:fc(e),stripFinalNewline:i,verboseInfo:s,streamInfo:a}))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:l,verboseInfo:m,streamInfo:w}),x=[],E=(async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:i})=>{if(!n)return o;const s=(e=>Y(e,"ipc"))(i),a=K(t,"ipc"),c=K(r,"ipc");for await(const t of Ts({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Tn(0,o,c),o.push(t)),s&&hc(t,i);return o})({subprocess:e,buffer:r,maxBuffer:n,ipc:d,ipcOutput:x,verboseInfo:m}),T=yc(h,e,w),D=wc(f,w);try{return await Promise.race([Promise.all([{},as(y),Promise.all(v),S,E,Rr(e,u),...T,...D]),b,vc(e,g),...Br(e,i,p,g),...Et({subprocess:e,cancelSignal:s,gracefulCancel:a,context:p,controller:g}),...Cr({subprocess:e,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:p,controller:g})])}catch(e){return p.terminationReason??="other",Promise.all([{error:e},y,Promise.all(v.map((e=>tc(e)))),tc(S),bc(E,x),Promise.allSettled(T),Promise.allSettled(D)])}},yc=(e,t,r)=>e.map(((e,n)=>e===t.stdio[n]?void 0:nc(e,n,r))),wc=(e,t)=>e.flatMap((({stdioItems:e},r)=>e.filter((({value:e,stream:t=e})=>en(t,{checkOpen:!1})&&!$(t))).map((({type:e,value:n,stream:o=n})=>nc(o,r,t,{isSameDirection:co.has(e),stopOnExit:"native"===e}))))),vc=async(e,{signal:t})=>{const[r]=await(0,St.once)(e,"error",{signal:t});throw r},Sc=(e,t,r)=>{const n=e[r];n.has(t)||n.set(t,[]);const o=n.get(t),i=Pt();return o.push(i),{resolve:i.resolve.bind(i),promises:o}},xc=async({resolve:e,promises:t},r)=>{e();const[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n},Ec=async e=>{if(void 0!==e)try{await Tc(e)}catch{}},Tc=async e=>{await(0,Ls.finished)(e,{cleanup:!0,readable:!1,writable:!0})},Dc=async e=>{await(0,Ls.finished)(e,{cleanup:!0,readable:!0,writable:!1})},Ic=async(e,t)=>{if(await e,t)throw t},Oc=(e,t,r)=>{r&&!dc(r)?e.destroy(r):t&&e.destroy()},Mc=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:o=!0,preserveNewlines:i=!0}={})=>{const s=o||Ur.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Nc(e,n,t),{readableEncoding:l,readableObjectMode:d,readableHighWaterMark:u}=Cc(a,s),{read:p,onStdoutDataDone:m}=$c({subprocessStdout:a,subprocess:e,binary:s,encoding:r,preserveNewlines:i}),f=new li.Readable({read:p,destroy:(0,N.callbackify)(jc.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:u,objectMode:d,encoding:l});return Bc({subprocessStdout:a,onStdoutDataDone:m,readable:f,subprocess:e}),f},Nc=(e,t,r)=>{const n=Rt(e,t);return{subprocessStdout:n,waitReadableDestroy:Sc(r,n,"readableDestroy")}},Cc=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Ka},$c=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:o})=>{const i=Pt(),s=Wa({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){Ac(this,s,i)},onStdoutDataDone:i}},Ac=async(e,t,r)=>{try{const{value:n,done:o}=await t.next();o?r.resolve():e.push(n)}catch{}},Bc=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:o})=>{try{await Dc(e),await n,await Ec(o),await t,r.readable&&r.push(null)}catch(e){await Ec(o),Pc(r,e)}},jc=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await xc(r,t)&&(Pc(e,n),await Ic(t,n))},Pc=(e,t)=>{Oc(e,e.readable,t)},kc=({subprocess:e,concurrentStreams:t},{to:r}={})=>{const{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}=Rc(e,r,t),s=new li.Writable({...Lc(n,e,o),destroy:(0,N.callbackify)(Wc.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Gc(n,s),s},Rc=(e,t,r)=>{const n=kt(e,t);return{subprocessStdin:n,waitWritableFinal:Sc(r,n,"writableFinal"),waitWritableDestroy:Sc(r,n,"writableDestroy")}},Lc=(e,t,r)=>({write:Uc.bind(void 0,e),final:(0,N.callbackify)(Fc.bind(void 0,e,t,r))}),Uc=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},Fc=async(e,t,r)=>{await xc(r,t)&&(e.writable&&e.end(),await t)},Gc=async(e,t,r)=>{try{await Tc(e),t.writable&&t.end()}catch(e){await(async e=>{if(void 0!==e)try{await Dc(e)}catch{}})(r),_c(t,e)}},Wc=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await xc(r,t),await xc(n,t)&&(_c(e,o),await Ic(t,o))},_c=(e,t)=>{Oc(e,e.writable,t)},zc=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||Ur.has(r),{subprocessStdout:c,waitReadableDestroy:l}=Nc(e,n,t),{subprocessStdin:d,waitWritableFinal:u,waitWritableDestroy:p}=Rc(e,o,t),{readableEncoding:m,readableObjectMode:f,readableHighWaterMark:h}=Cc(c,a),{read:b,onStdoutDataDone:g}=$c({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),y=new li.Duplex({read:b,...Lc(d,e,u),destroy:(0,N.callbackify)(Vc.bind(void 0,{subprocessStdout:c,subprocessStdin:d,subprocess:e,waitReadableDestroy:l,waitWritableFinal:u,waitWritableDestroy:p})),readableHighWaterMark:h,writableHighWaterMark:d.writableHighWaterMark,readableObjectMode:f,writableObjectMode:d.writableObjectMode,encoding:m});return Bc({subprocessStdout:c,onStdoutDataDone:g,readable:y,subprocess:e,subprocessStdin:d}),Gc(d,y,c),y},Vc=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([jc({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},s),Wc({subprocessStdin:t,subprocess:r,waitWritableFinal:o,waitWritableDestroy:i},s)])},Hc=(e,t,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{const i=n||Ur.has(t),s=Rt(e,r),a=Wa({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return Kc(a,s,e)},Kc=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}},qc=(e,{encoding:t})=>{const r={readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap};e.readable=Mc.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=kc.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=zc.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=Hc.bind(void 0,e,t),e[Symbol.asyncIterator]=Hc.bind(void 0,e,t,{})},Yc=(async()=>{})().constructor.prototype,Xc=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(Yc,e)])),Qc=(e,t,r)=>{const{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ue(e,t,r),{file:a,commandArguments:c,options:l}=zr(e,t,r),d=Jc(l),u=((e,t)=>_o(Rs,e,t,!1))(d,s);return{file:a,commandArguments:c,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:d,fileDescriptors:u}},Jc=({timeout:e,signal:t,...r})=>{if(void 0!==t)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},Zc=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=(0,l.spawn)(e,t,r)}catch(e){return(({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,verboseInfo:s})=>{ti(n);const a=new l.ChildProcess;((e,t)=>{const r=Cs(),n=Cs(),o=Cs(),i=Array.from({length:t.length-3},Cs),s=Cs(),a=[r,n,o,...i];Object.assign(e,{stdin:r,stdout:n,stderr:o,all:s,stdio:a})})(a,n),Object.assign(a,{readable:$s,writable:As,duplex:Bs});const c=Cn({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:!1});return{subprocess:a,promise:js(c,s,o)}})({error:e,command:i,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}const d=new AbortController;(0,St.setMaxListeners)(Number.POSITIVE_INFINITY,d.signal);const u=[...c.stdio];((e,t,r)=>{const n=new Map;for(const[o,{stdioItems:i,direction:s}]of Object.entries(t)){for(const{stream:t}of i.filter((({type:e})=>co.has(e))))da(e,t,s,o);for(const{stream:t}of i.filter((({type:e})=>!co.has(e))))pa({subprocess:e,stream:t,direction:s,fdNumber:o,pipeGroups:n,controller:r})}for(const[e,t]of n.entries()){const r=1===t.length?t[0]:Us(t);ia(r,e)}})(c,a,d),((e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;const o=(0,ha.cf)((()=>{e.kill()}));(0,St.addAbortListener)(n,(()=>{o()}))})(c,r,d);const p={},m=Pt();return c.kill=bt.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:m,context:p,controller:d}),c.all=(({stdout:e,stderr:t},{all:r})=>r&&(e||t)?Us([e,t].filter(Boolean)):void 0)(c,r),qc(c,r),((e,{ipc:t})=>{Object.assign(e,Ns(e,!1,t))})(c,r),{subprocess:c,promise:el({subprocess:c,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:u,command:i,escapedCommand:s,context:p,onInternalError:m,controller:d})}},el=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:i,command:s,escapedCommand:a,context:c,onInternalError:l,controller:d})=>{const[u,[p,m],f,h,b]=await gc({subprocess:e,options:t,context:c,verboseInfo:n,fileDescriptors:o,originalStreams:i,onInternalError:l,controller:d});d.abort(),l.resolve();const g=f.map(((e,r)=>ai(e,t,r))),y=ai(h,t,"all"),w=tl({errorInfo:u,exitCode:p,signal:m,stdio:g,all:y,ipcOutput:b,context:c,options:t,command:s,escapedCommand:a,startTime:r});return Ln(w,n,t)},tl=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,context:s,options:a,command:c,escapedCommand:l,startTime:d})=>"error"in e?$n({error:e.error,command:c,escapedCommand:l,timedOut:"timeout"===s.terminationReason,isCanceled:"cancel"===s.terminationReason||"gracefulCancel"===s.terminationReason,isGracefullyCanceled:"gracefulCancel"===s.terminationReason,isMaxBuffer:e.error instanceof En,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,options:a,startTime:d,isSync:!1}):Nn({command:c,escapedCommand:l,stdio:n,all:o,ipcOutput:i,options:a,startTime:d}),rl=(e,t)=>{const r=Object.fromEntries(Object.entries(t).map((([t,r])=>[t,nl(t,e[t],r)])));return{...e,...r}},nl=(e,t,r)=>ol.has(e)&&o(t)&&o(r)?{...t,...r}:r,ol=new Set(["env",...H]),il=(e,t,r,n)=>{const o=(e,t,n)=>il(e,t,r,n),i=(...i)=>sl({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:o},...i);return void 0!==n&&n(i,o,t),i},sl=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:i},s,...a)=>{if(o(s))return i(e,rl(r,s),n);const{file:c,commandArguments:l,options:d,isSync:u}=al({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:r});return u?((e,t,r)=>{const{file:n,commandArguments:o,command:i,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:d}=((e,t,r)=>{const{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ue(e,t,r),a=us(r),{file:c,commandArguments:l,options:d}=zr(e,t,a);ps(d);const u=((e,t)=>_o(si,e,t,!0))(d,s);return{file:c,commandArguments:l,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:d,fileDescriptors:u}})(e,t,r),u=fs({file:n,commandArguments:o,options:l,command:i,escapedCommand:s,verboseInfo:c,fileDescriptors:d,startTime:a});return Ln(u,c,l)})(c,l,d):((e,t,r,n)=>{const{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:d,fileDescriptors:u}=Qc(e,t,r),{subprocess:p,promise:m}=Zc({file:o,commandArguments:i,options:d,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:u});return p.pipe=Ta.bind(void 0,{source:p,sourcePromise:m,boundOptions:{},createNested:n}),((e,t)=>{for(const[r,n]of Xc){const o=n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}})(p,m),Lt.set(p,{options:d,fileDescriptors:u}),p})(c,l,d,i)},al=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:o})=>{const i=(s=t,Array.isArray(s)&&Array.isArray(s.raw)?((e,t)=>{let r=[];for(const[n,o]of e.entries())r=x({templates:e,expressions:t,tokens:r,index:n,template:o});if(0===r.length)throw new TypeError("Template script must not be empty");const[n,...o]=r;return[n,o,{}]})(t,r):[t,...r]);var s;const[a,l,d]=c(...i),u=rl(rl(n,o),d),{file:p=a,commandArguments:m=l,options:f=u,isSync:h=!1}=e({file:a,commandArguments:l,options:u});return{file:p,commandArguments:m,options:f,isSync:h}},cl=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);const[r,...n]=ll(e);return{file:r,commandArguments:n}},ll=e=>{if("string"!=typeof e)throw new TypeError(`The command must be a string: ${String(e)}.`);const t=e.trim();if(""===t)return[];const r=[];for(const e of t.split(dl)){const t=r.at(-1);t&&t.endsWith("\\")?r[r.length-1]=`${t.slice(0,-1)} ${e}`:r.push(e)}return r},dl=/ +/g,ul=({options:e})=>({...pl(e),isSync:!0}),pl=e=>({options:{...ml(e),...e}}),ml=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},fl=il((()=>({}))),hl=il((()=>({isSync:!0}))),{sendMessage:bl,getOneMessage:gl,getEachMessage:yl,getCancelSignal:wl}=(il((({file:e,commandArguments:t})=>cl(e,t))),il((({file:e,commandArguments:t})=>({...cl(e,t),isSync:!0}))),il((({options:e})=>{if(!1===e.node)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}})),il((({options:e})=>pl(e)),{},{preferLocal:!0},((e,t,r)=>{e.sync=t(ul,r),e.s=e.sync})),(()=>{const e=C,t=!0,r=void 0!==C.channel;return{...Ns(e,t,r),getCancelSignal:Er.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}})())},7235:(e,t,r)=>{function n(e={}){const{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"}r.d(t,{A:()=>n})},7017:(e,t,r)=>{r.d(t,{cf:()=>u});const n=[];n.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&n.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&n.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const o=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,i=Symbol.for("signal-exit emitter"),s=globalThis,a=Object.defineProperty.bind(Object);class c{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(s[i])return s[i];a(s,i,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const r=this.listeners[e],n=r.indexOf(t);-1!==n&&(0===n&&1===r.length?r.length=0:r.splice(n,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const o of this.listeners[e])n=!0===o(t,r)||n;return"exit"===e&&(n=this.emit("afterExit",t,r)||n),n}}class l{}const d=globalThis.process,{onExit:u,load:p,unload:m}=(f=o(d)?new class extends l{#p="win32"===d.platform?"SIGINT":"SIGHUP";#m=new c;#f;#h;#b;#g={};#y=!1;constructor(e){super(),this.#f=e,this.#g={};for(const t of n)this.#g[t]=()=>{const r=this.#f.listeners(t);let{count:n}=this.#m;const o=e;if("object"==typeof o.__signal_exit_emitter__&&"number"==typeof o.__signal_exit_emitter__.count&&(n+=o.__signal_exit_emitter__.count),r.length===n){this.unload();const r=this.#m.emit("exit",null,t),n="SIGHUP"===t?this.#p:t;r||e.kill(e.pid,n)}};this.#b=e.reallyExit,this.#h=e.emit}onExit(e,t){if(!o(this.#f))return()=>{};!1===this.#y&&this.load();const r=t?.alwaysLast?"afterExit":"exit";return this.#m.on(r,e),()=>{this.#m.removeListener(r,e),0===this.#m.listeners.exit.length&&0===this.#m.listeners.afterExit.length&&this.unload()}}load(){if(!this.#y){this.#y=!0,this.#m.count+=1;for(const e of n)try{const t=this.#g[e];t&&this.#f.on(e,t)}catch(e){}this.#f.emit=(e,...t)=>this.#w(e,...t),this.#f.reallyExit=e=>this.#v(e)}}unload(){this.#y&&(this.#y=!1,n.forEach((e=>{const t=this.#g[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#f.removeListener(e,t)}catch(e){}})),this.#f.emit=this.#h,this.#f.reallyExit=this.#b,this.#m.count-=1)}#v(e){return o(this.#f)?(this.#f.exitCode=e||0,this.#m.emit("exit",this.#f.exitCode,null),this.#b.call(this.#f,this.#f.exitCode)):0}#w(e,...t){const r=this.#h;if("exit"===e&&o(this.#f)){"number"==typeof t[0]&&(this.#f.exitCode=t[0]);const n=r.call(this.#f,e,...t);return this.#m.emit("exit",this.#f.exitCode,null),n}return r.call(this.#f,e,...t)}}(d):new class extends l{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>f.onExit(e,t),load:()=>f.load(),unload:()=>f.unload()});var f},3938:(e,t,r)=>{r.r(t),r.d(t,{builder:()=>a,command:()=>o,description:()=>i});var n=r(724);const o="git",i="",s=process.cwd();function a(e){e.command("hooks","Set .githooks as git.hooksPath",{},(()=>{(function(){try{return function(){try{return Boolean((0,n.Kc)("git",["--version"],{cwd:s}).stdout)}catch{throw new Error("git is not installed")}}()&&function(){try{return"true"===(0,n.Kc)("git",["rev-parse","--is-inside-work-tree"],{cwd:s}).stdout}catch{throw new Error("not a git repository")}}()}catch(e){return console.error("Fail:",e.message),!1}})()&&(0,n.Ho)("git",["config","core.hooksPath",".githooks"],{cwd:s}).then((()=>{console.log("Done: set .githooks")})).catch((()=>{console.error("Fail:","setting hooks failed"),process.exitCode=1}))})),e.demandCommand(1,"Typing `hooks`")}}};import t from"../runtime.mjs";import*as r from"./git.mjs";t.C(r);var n=t(t.s=3938),o=n.builder,i=n.command,s=n.description;export{o as builder,i as command,s as description};
|
|
1
|
+
import{createRequire as e}from"node:module";export const __webpack_id__=60;export const __webpack_ids__=[60];export const __webpack_modules__={6507:(e,t,n)=>{const r=n(5317),o=n(8388),i=n(442);function s(e,t,n){const s=o(e,t,n),a=r.spawn(s.command,s.args,s.options);return i.hookChildProcess(a,s),a}e.exports=s,e.exports.spawn=s,e.exports.sync=function(e,t,n){const s=o(e,t,n),a=r.spawnSync(s.command,s.args,s.options);return a.error=a.error||i.verifyENOENTSync(a.status,s),a},e.exports._parse=o,e.exports._enoent=i},442:e=>{const t="win32"===process.platform;function n(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function r(e,r){return t&&1===e&&!r.file?n(r.original,"spawn"):null}e.exports={hookChildProcess:function(e,n){if(!t)return;const o=e.emit;e.emit=function(t,i){if("exit"===t){const t=r(i,n);if(t)return o.call(e,"error",t)}return o.apply(e,arguments)}},verifyENOENT:r,verifyENOENTSync:function(e,r){return t&&1===e&&!r.file?n(r.original,"spawnSync"):null},notFoundError:n}},8388:(e,t,n)=>{const r=n(6928),o=n(3803),i=n(2077),s=n(1880),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null);const d={command:e,args:t=t?t.slice(0):[],options:n=Object.assign({},n),file:void 0,original:{command:e,args:t}};return n.shell?d:function(e){if(!a)return e;const t=function(e){e.file=o(e);const t=e.file&&s(e.file);return t?(e.args.unshift(e.file),e.command=t,o(e)):e.file}(e),n=!c.test(t);if(e.options.forceShell||n){const n=l.test(t);e.command=r.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map((e=>i.argument(e,n)));const o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(d)}},2077:e=>{const t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,n){return e=(e=`"${e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1")}"`).replace(t,"^$1"),n&&(e=e.replace(t,"^$1")),e}},1880:(e,t,n)=>{const r=n(9896),o=n(600);e.exports=function(e){const t=Buffer.alloc(150);let n;try{n=r.openSync(e,"r"),r.readSync(n,t,0,150,0),r.closeSync(n)}catch(e){}return o(t.toString())}},3803:(e,t,n)=>{const r=n(6928),o=n(1905),i=n(9695);function s(e,t){const n=e.options.env||process.env,s=process.cwd(),a=null!=e.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}let l;try{l=o.sync(e.command,{path:n[i({env:n})],pathExt:t?r.delimiter:void 0})}catch(e){}finally{c&&process.chdir(s)}return l&&(l=r.resolve(a?e.options.cwd:"",l)),l}e.exports=function(e){return s(e)||s(e,!0)}},9344:(e,t,n)=>{var r;function o(e,t,n){if("function"==typeof t&&(n=t,t={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(n,r){o(e,t||{},(function(e,t){e?r(e):n(t)}))}))}r(e,t||{},(function(e,r){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)}))}n(9896),r="win32"===process.platform||global.TESTING_WINDOWS?n(8541):n(709),e.exports=o,o.sync=function(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},709:(e,t,n)=>{e.exports=o,o.sync=function(e,t){return i(r.statSync(e),t)};var r=n(9896);function o(e,t,n){r.stat(e,(function(e,r){n(e,!e&&i(r,t))}))}function i(e,t){return e.isFile()&&function(e,t){var n=e.mode,r=e.uid,o=e.gid,i=void 0!==t.uid?t.uid:process.getuid&&process.getuid(),s=void 0!==t.gid?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8);return n&parseInt("001",8)||n&c&&o===s||n&a&&r===i||n&(a|c)&&0===i}(e,t)}},8541:(e,t,n)=>{e.exports=i,i.sync=function(e,t){return o(r.statSync(e),e,t)};var r=n(9896);function o(e,t,n){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var n=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}(t,n)}function i(e,t,n){r.stat(e,(function(r,i){n(r,!r&&o(i,e,t))}))}},9695:e=>{const t=(e={})=>{const t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"};e.exports=t,e.exports.default=t},600:(e,t,n)=>{const r=n(7257);e.exports=(e="")=>{const t=e.match(r);if(!t)return null;const[n,o]=t[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return"env"===i?o:o?`${i} ${o}`:i}},7257:e=>{e.exports=/^#!(.*)/},1905:(e,t,n)=>{const r="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,o=n(6928),i=r?";":":",s=n(9344),a=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),c=(e,t)=>{const n=t.colon||i,o=e.match(/\//)||r&&e.match(/\\/)?[""]:[...r?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],s=r?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=r?s.split(n):[""];return r&&-1!==e.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:o,pathExt:a,pathExtExe:s}},l=(e,t,n)=>{"function"==typeof t&&(n=t,t={}),t||(t={});const{pathEnv:r,pathExt:i,pathExtExe:l}=c(e,t),d=[],u=n=>new Promise(((i,s)=>{if(n===r.length)return t.all&&d.length?i(d):s(a(e));const c=r[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=o.join(l,e),m=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;i(p(m,n,0))})),p=(e,n,r)=>new Promise(((o,a)=>{if(r===i.length)return o(u(n+1));const c=i[r];s(e+c,{pathExt:l},((i,s)=>{if(!i&&s){if(!t.all)return o(e+c);d.push(e+c)}return o(p(e,n,r+1))}))}));return n?u(0).then((e=>n(null,e)),n):u(0)};e.exports=l,l.sync=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:r,pathExtExe:i}=c(e,t),l=[];for(let a=0;a<n.length;a++){const c=n[a],d=/^".*"$/.test(c)?c.slice(1,-1):c,u=o.join(d,e),p=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let e=0;e<r.length;e++){const n=p+r[e];try{if(s.sync(n,{pathExt:i})){if(!t.all)return n;l.push(n)}}catch(e){}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw a(e)}},5317:t=>{t.exports=e(import.meta.url)("child_process")},9896:t=>{t.exports=e(import.meta.url)("fs")},4573:t=>{t.exports=e(import.meta.url)("node:buffer")},1421:t=>{t.exports=e(import.meta.url)("node:child_process")},3024:t=>{t.exports=e(import.meta.url)("node:fs")},8161:t=>{t.exports=e(import.meta.url)("node:os")},6760:t=>{t.exports=e(import.meta.url)("node:path")},1708:t=>{t.exports=e(import.meta.url)("node:process")},7075:t=>{t.exports=e(import.meta.url)("node:stream")},8500:t=>{t.exports=e(import.meta.url)("node:timers/promises")},7066:t=>{t.exports=e(import.meta.url)("node:tty")},3136:t=>{t.exports=e(import.meta.url)("node:url")},7975:t=>{t.exports=e(import.meta.url)("node:util")},6928:t=>{t.exports=e(import.meta.url)("path")},2283:(t,n,r)=>{function o(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}r.d(n,{Ho:()=>bl,Kc:()=>gl});var i=r(3136);const s=(e,t)=>{const n=l(a(e));if("string"!=typeof n)throw new TypeError(`${t} must be a string or a file URL: ${n}.`);return n},a=e=>c(e)?e.toString():e,c=e=>"string"!=typeof e&&e&&Object.getPrototypeOf(e)===String.prototype,l=e=>e instanceof URL?(0,i.fileURLToPath)(e):e,d=(e,t=[],n={})=>{const r=s(e,"First argument"),[i,a]=o(t)?[[],t]:[t,n];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some((e=>"object"==typeof e&&null!==e)))throw new TypeError(`Second argument must be an array of strings: ${i}`);const c=i.map(String),l=c.find((e=>e.includes("\0")));if(void 0!==l)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${l}`);if(!o(a))throw new TypeError(`Last argument must be an options object: ${a}`);return[r,c,a]};var u=r(1421);const p=e(import.meta.url)("node:string_decoder"),{toString:m}=Object.prototype,f=e=>"[object Uint8Array]"===m.call(e),h=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),b=new TextEncoder,g=e=>b.encode(e),y=new TextDecoder,w=e=>y.decode(e),v=e=>1===e.length&&f(e[0])?e[0]:x(S(e)),S=e=>e.map((e=>"string"==typeof e?g(e):e)),x=e=>{const t=new Uint8Array(E(e));let n=0;for(const r of e)t.set(r,n),n+=r.length;return t},E=e=>{let t=0;for(const n of e)t+=n.length;return t},T=({templates:e,expressions:t,tokens:n,index:r,template:o})=>{if(void 0===o)throw new TypeError(`Invalid backslash sequence: ${e.raw[r]}`);const{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:a}=D(o,e.raw[r]),c=M(n,i,s);if(r===t.length)return c;const l=t[r],d=Array.isArray(l)?l.map((e=>N(e))):[N(l)];return M(c,d,a)},D=(e,t)=>{if(0===t.length)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const o=I.has(t[0]);for(let o=0,i=0;o<e.length;o+=1,i+=1){const s=t[i];if(I.has(s))r!==o&&n.push(e.slice(r,o)),r=o+1;else if("\\"===s){const e=t[i+1];"\n"===e?(o-=1,i+=1):"u"===e&&"{"===t[i+2]?i=t.indexOf("}",i+3):i+=O[e]??1}}const i=r===e.length;return i||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:o,trailingWhitespaces:i}},I=new Set([" ","\t","\r","\n"]),O={x:3,u:5},M=(e,t,n)=>n||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],N=e=>{const t=typeof e;if("string"===t)return e;if("number"===t)return String(e);if(o(e)&&("stdout"in e||"isMaxBuffer"in e))return C(e);if(e instanceof u.ChildProcess||"[object Promise]"===Object.prototype.toString.call(e))throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw new TypeError(`Unexpected "${t}" in template expression`)},C=({stdout:e})=>{if("string"==typeof e)return e;if(f(e))return w(e);if(void 0===e)throw new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.');throw new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};var $=r(7975),A=r(1708);const B=e=>j.includes(e),j=[A.stdin,A.stdout,A.stderr],P=["stdin","stdout","stderr"],k=e=>P[e]??`stdio[${e}]`,R=(e,t)=>{const n=Array.from({length:L(e)+1}),r=U(e[t],n,t);return H(r,t)},L=({stdio:e})=>Array.isArray(e)?Math.max(e.length,P.length):P.length,U=(e,t,n)=>o(e)?F(e,t,n):t.fill(e),F=(e,t,n)=>{for(const r of Object.keys(e).sort(G))for(const o of _(r,n,t))t[o]=e[r];return t},G=(e,t)=>W(e)<W(t)?1:-1,W=e=>"stdout"===e||"stderr"===e?0:"all"===e?2:1,_=(e,t,n)=>{if("ipc"===e)return[n.length-1];const r=z(e);if(void 0===r||0===r)throw new TypeError(`"${t}.${e}" is invalid.\nIt must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`);return"all"===r?[1,2]:[r]},z=e=>{if("all"===e)return e;if(P.includes(e))return P.indexOf(e);const t=V.exec(e);return null!==t?Number(t[1]):void 0},V=/^fd(\d+)$/,H=(e,t)=>e.map((e=>void 0===e?K[t]:e)),K={lines:!1,buffer:!0,maxBuffer:1e8,verbose:(0,$.debuglog)("execa").enabled?"full":"none",stripFinalNewline:!0},q=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Y=(e,t)=>"ipc"===t?e.at(-1):e[t],X=({verbose:e},t)=>"none"!==J(e,t),Q=({verbose:e},t)=>!["none","short"].includes(J(e,t)),J=(e,t)=>void 0===t?Z(e):Y(e,t),Z=e=>e.find((e=>ee(e)))??te.findLast((t=>e.includes(t))),ee=e=>"function"==typeof e,te=["none","short","full"],ne=e=>(0,$.stripVTControlCharacters)(e).split("\n").map((e=>re(e))).join("\n"),re=e=>e.replaceAll(ie,(e=>oe(e))),oe=e=>{const t=se[e];if(void 0!==t)return t;const n=e.codePointAt(0),r=n.toString(16);return n<=ae?`\\u${r.padStart(4,"0")}`:`\\U${r}`},ie=(()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),se={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},ae=65535,ce=/^[\w./-]+$/,le={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258c",squareRight:"\u2590",squareCenter:"\u25a0",bullet:"\u25cf",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203a",triangleUp:"\u25b2",triangleUpSmall:"\u25b4",triangleDown:"\u25bc",triangleDownSmall:"\u25be",triangleLeftSmall:"\u25c2",triangleRightSmall:"\u25b8",home:"\u2302",heart:"\u2665",musicNote:"\u266a",musicNoteBeamed:"\u266b",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221e",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xbd",oneThird:"\u2153",oneQuarter:"\xbc",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215b",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xbe",threeFifths:"\u2157",threeEighths:"\u215c",fourFifths:"\u2158",fiveSixths:"\u215a",fiveEighths:"\u215d",sevenEighths:"\u215e",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254c",lineDashed5:"\u254d",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257a",lineDashed10:"\u257c",lineDashed11:"\u257e",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250a",lineVerticalDashed3:"\u250b",lineVerticalDashed4:"\u254e",lineVerticalDashed5:"\u254f",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257b",lineVerticalDashed10:"\u257d",lineVerticalDashed11:"\u257f",lineDownLeft:"\u2510",lineDownLeftArc:"\u256e",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250c",lineDownRightArc:"\u256d",lineDownBoldRightBold:"\u250f",lineDownBoldRight:"\u250e",lineDownRightBold:"\u250d",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256f",lineUpBoldLeftBold:"\u251b",lineUpBoldLeft:"\u251a",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255d",lineUpDoubleLeft:"\u255c",lineUpLeftDouble:"\u255b",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255a",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252b",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252a",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251c",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251d",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251f",lineUpBoldDownRight:"\u251e",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255f",lineUpDownRightDouble:"\u255e",lineDownLeftRight:"\u252c",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252f",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252e",lineDownLeftBoldRight:"\u252d",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253b",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253a",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253c",lineUpBoldDownBoldLeftBoldRightBold:"\u254b",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254a",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253d",lineUpDownLeftRightBold:"\u253e",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253f",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256c",lineUpDoubleDownDoubleLeftRight:"\u256b",lineUpDownLeftDoubleRightDouble:"\u256a",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},de={tick:"\u2714",info:"\u2139",warning:"\u26a0",cross:"\u2718",squareSmall:"\u25fb",squareSmallFilled:"\u25fc",circle:"\u25ef",circleFilled:"\u25c9",circleDotted:"\u25cc",circleDouble:"\u25ce",circleCircle:"\u24de",circleCross:"\u24e7",circlePipe:"\u24be",radioOn:"\u25c9",radioOff:"\u25ef",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24e7",checkboxCircleOff:"\u24be",pointer:"\u276f",triangleUpOutline:"\u25b3",triangleLeft:"\u25c0",triangleRight:"\u25b6",lozenge:"\u25c6",lozengeOutline:"\u25c7",hamburger:"\u2630",smiley:"\u32e1",mustache:"\u0df4",star:"\u2605",play:"\u25b6",nodejs:"\u2b22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},ue={...le,...de},pe={...le,tick:"\u221a",info:"i",warning:"\u203c",cross:"\xd7",squareSmall:"\u25a1",squareSmallFilled:"\u25a0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25cb)",circleCross:"(\xd7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xd7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xd7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25c4",triangleRight:"\u25ba",lozenge:"\u2666",lozengeOutline:"\u25ca",hamburger:"\u2261",smiley:"\u263a",mustache:"\u250c\u2500\u2510",star:"\u2736",play:"\u25ba",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},me=function(){const{env:e}=A,{TERM:t,TERM_PROGRAM:n}=e;return"win32"!==A.platform?"linux"!==t:Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===n||"vscode"===n||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}()?ue:pe;Object.entries(de);var fe=r(7066);const he=fe?.WriteStream?.prototype?.hasColors?.()??!1,be=(e,t)=>{if(!he)return e=>e;const n=`\x1b[${e}m`,r=`\x1b[${t}m`;return e=>{const t=e+"";let o=t.indexOf(r);if(-1===o)return n+t+r;let i=n,s=0;for(;-1!==o;)i+=t.slice(s,o)+n,s=o+r.length,o=t.indexOf(r,s);return i+=t.slice(s)+r,i}},ge=(be(0,0),be(1,22)),ye=(be(2,22),be(3,23),be(4,24),be(53,55),be(7,27),be(8,28),be(9,29),be(30,39),be(31,39),be(32,39),be(33,39),be(34,39),be(35,39),be(36,39),be(37,39),be(90,39)),we=(be(40,49),be(41,49),be(42,49),be(43,49),be(44,49),be(45,49),be(46,49),be(47,49),be(100,49),be(91,39)),ve=(be(92,39),be(93,39)),Se=(be(94,39),be(95,39),be(96,39),be(97,39),be(101,49),be(102,49),be(103,49),be(104,49),be(105,49),be(106,49),be(107,49),e=>`${xe(e.getHours(),2)}:${xe(e.getMinutes(),2)}:${xe(e.getSeconds(),2)}.${xe(e.getMilliseconds(),3)}`),xe=(e,t)=>String(e).padStart(t,"0"),Ee=({failed:e,reject:t})=>e?t?me.cross:me.warning:me.tick,Te={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:Ee,duration:Ee},De=e=>e,Ie={command:()=>ge,output:()=>De,ipc:()=>De,error:({reject:e})=>e?we:ve,duration:()=>ye},Oe=(e,t,n)=>{if(void 0===n)return e;const r=n(e,t);return"string"==typeof r?r:void 0},Me=e=>e.endsWith("\n")?e:`${e}\n`,Ne=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:o})=>{const i=Ce({type:e,result:o,verboseInfo:r}),s=((e,t,n)=>{const r=(({verbose:e},t)=>{const n=J(e,t);return ee(n)?n:void 0})(t,n);return e.map((({verboseLine:e,verboseObject:t})=>Oe(e,t,r))).filter((e=>void 0!==e)).map((e=>Me(e))).join("")})($e(t,i),r,n);""!==s&&console.warn(s.slice(0,-1))},Ce=({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:o=!1,...i}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:o,result:t,options:i}),$e=(e,t)=>e.split("\n").map((e=>Ae({...t,message:e}))),Ae=e=>({verboseLine:(({type:e,message:t,timestamp:n,piped:r,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{const a=Se(n),c=Te[e]({failed:i,reject:s,piped:r}),l=Ie[e]({reject:s});return`${ye(`[${a}]`)} ${ye(`[${o}]`)} ${l(c)} ${l(t)}`})(e),verboseObject:e}),Be=e=>{const t="string"==typeof e?e:(0,$.inspect)(e);return ne(t).replaceAll("\t"," ".repeat(je))},je=2,Pe=e=>X({verbose:e})?ke++:void 0;let ke=0n;const Re=()=>A.hrtime.bigint(),Le=e=>Number(A.hrtime.bigint()-e)/1e6,Ue=(e,t,n)=>{const r=Re(),{command:o,escapedCommand:i}=((e,t)=>{const n=[e,...t];return{command:n.join(" "),escapedCommand:n.map((e=>{return t=re(e),ce.test(t)?t:"win32"===A.platform?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`;var t})).join(" ")}})(e,t),s=((e,t,n)=>((e=>{for(const t of e){if(!1===t)throw new TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".');if(!0===t)throw new TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".');if(!te.includes(t)&&!ee(t)){const e=te.map((e=>`'${e}'`)).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}})(e),{verbose:e,escapedCommand:t,commandId:Pe(e),rawOptions:n}))(R(n,"verbose"),i,{...n});return((e,t)=>{X(t)&&Ne({type:"command",verboseMessage:e,verboseInfo:t})})(i,s),{command:o,escapedCommand:i,startTime:r,verboseInfo:s}};var Fe=r(6760),Ge=r(6507),We=r(7235);function _e(e){return e instanceof URL?(0,i.fileURLToPath)(e):e}(0,$.promisify)(u.execFile);const ze=({env:e=A.env,...t}={})=>{e={...e};const n=(0,We.A)({env:e});return t.path=e[n],e[n]=(({cwd:e=A.cwd(),path:t=A.env[(0,We.A)()],preferLocal:n=!0,execPath:r=A.execPath,addExecPath:o=!0}={})=>{const i=Fe.resolve(_e(e)),s=[],a=t.split(Fe.delimiter);return n&&((e,t,n)=>{for(const r of function(e){return{*[Symbol.iterator](){let t,n=Fe.resolve(_e(e));for(;t!==n;)yield n,t=n,n=Fe.resolve(n,"..")}}}(n)){const n=Fe.join(r,"node_modules/.bin");t.includes(n)||e.push(n)}})(s,a,i),o&&((e,t,n,r)=>{const o=Fe.resolve(r,_e(n),"..");t.includes(o)||e.push(o)})(s,a,r,i),""===t||t===Fe.delimiter?`${s.join(Fe.delimiter)}${t}`:[...s,t].join(Fe.delimiter)})(t),e};var Ve=r(8500);class He extends Error{}const Ke=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,qe,{value:!0,writable:!1,enumerable:!1,configurable:!1})},qe=Symbol("isExecaError"),Ye=e=>"[object Error]"===Object.prototype.toString.call(e);class Xe extends Error{}Ke(Xe,Xe.name);class Qe extends Error{}Ke(Qe,Qe.name);var Je=r(8161);const Ze=(e,t)=>({name:`SIGRT${t+1}`,number:et+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),et=34,tt=[{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"}],nt=()=>{const e=(()=>{const e=64-et+1;return Array.from({length:e},Ze)})();return[...tt,...e].map(rt)},rt=({name:e,number:t,description:n,action:r,forced:o=!1,standard:i})=>{const{signals:{[e]:s}}=Je.constants,a=void 0!==s;return{name:e,number:a?s:t,description:n,supported:a,action:r,forced:o,standard:i}},ot=({name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s}],it=(()=>{const e=nt();return Object.fromEntries(e.map(ot))})(),st=(e,t)=>{const n=t.find((({name:t})=>Je.constants.signals[t]===e));return void 0!==n?n:t.find((t=>t.number===e))},at=((()=>{const e=nt(),t=Array.from({length:65},((t,n)=>((e,t)=>{const n=st(e,t);if(void 0===n)return{};const{name:r,description:o,supported:i,action:s,forced:a,standard:c}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:a,standard:c}}})(n,e)));Object.assign({},...t)})(),e=>0===e?e:ct(e,"`subprocess.kill()`'s argument")),ct=(e,t)=>{if(Number.isInteger(e))return lt(e,t);if("string"==typeof e)return ut(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${pt()}`)},lt=(e,t)=>{if(dt.has(e))return dt.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${pt()}`)},dt=new Map(Object.entries(Je.constants.signals).reverse().map((([e,t])=>[t,e]))),ut=(e,t)=>{if(e in Je.constants.signals)return e;if(e.toUpperCase()in Je.constants.signals)throw new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`);throw new TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${pt()}`)},pt=()=>`Available signal names: ${mt()}.\nAvailable signal numbers: ${ft()}.`,mt=()=>Object.keys(Je.constants.signals).sort().map((e=>`'${e}'`)).join(", "),ft=()=>[...new Set(Object.values(Je.constants.signals).sort(((e,t)=>e-t)))].join(", "),ht=e=>it[e].description,bt=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:o,controller:i},s,a)=>{const{signal:c,error:l}=gt(s,a,n);yt(l,r);const d=e(c);return wt({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:d,context:o,controller:i}),d},gt=(e,t,n)=>{const[r=n,o]=Ye(e)?[void 0,e]:[e,t];if("string"!=typeof r&&!Number.isInteger(r))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(void 0!==o&&!Ye(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:at(r),error:o}},yt=(e,t)=>{void 0!==e&&t.reject(e)},wt=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:o,context:i,controller:s})=>{t===r&&o&&vt({kill:e,forceKillAfterDelay:n,context:i,controllerSignal:s.signal})},vt=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(!1!==t)try{await(0,Ve.setTimeout)(t,void 0,{signal:r}),e("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},St=e(import.meta.url)("node:events"),xt=async(e,t)=>{e.aborted||await(0,St.once)(e,"abort",{signal:t})},Et=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:o})=>void 0===t||n?[]:[Tt(e,t,r,o)],Tt=async(e,t,n,{signal:r})=>{throw await xt(t,r),n.terminationReason??="cancel",e.kill(),t.reason},Dt=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{It(e,t,n),Ot(e,t,r)},It=(e,t,n)=>{if(!n)throw new Error(`${$t(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Ot=(e,t,n)=>{if(!n)throw new Error(`${$t(e,t)} cannot be used: the ${Bt(t)} has already exited or disconnected.`)},Mt=(e,t)=>new Error(`${$t("sendMessage",t)} failed when sending an acknowledgment response to the ${Bt(t)}.`,{cause:e}),Nt=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Ct=["could not be cloned","circular structure","call stack size exceeded"],$t=(e,t,n="")=>"cancelSignal"===e?"`cancelSignal`'s `controller.abort()`":`${At(t)}${e}(${n})`,At=e=>e?"":"subprocess.",Bt=e=>e?"parent process":"subprocess",jt=e=>{e.connected&&e.disconnect()},Pt=()=>{const e={},t=new Promise(((t,n)=>{Object.assign(e,{resolve:t,reject:n})}));return Object.assign(t,e)},kt=(e,t="stdin")=>{const n=!0,{options:r,fileDescriptors:o}=Lt.get(e),i=Ut(o,t,n),s=e.stdio[i];if(null===s)throw new TypeError(Wt(i,t,r,n));return s},Rt=(e,t="stdout")=>{const n=!1,{options:r,fileDescriptors:o}=Lt.get(e),i=Ut(o,t,n),s="all"===i?e.all:e.stdio[i];if(null==s)throw new TypeError(Wt(i,t,r,n));return s},Lt=new WeakMap,Ut=(e,t,n)=>{const r=Ft(t,n);return Gt(r,t,n,e),r},Ft=(e,t)=>{const n=z(e);if(void 0!==n)return n;const{validOptions:r,defaultValue:o}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Vt(t)}" must not be "${e}".\nIt must be ${r} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${o}".`)},Gt=(e,t,n,r)=>{const o=r[zt(e)];if(void 0===o)throw new TypeError(`"${Vt(n)}" must not be ${t}. That file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`);if("input"===o.direction&&!n)throw new TypeError(`"${Vt(n)}" must not be ${t}. It must be a readable stream, not writable.`);if("input"!==o.direction&&n)throw new TypeError(`"${Vt(n)}" must not be ${t}. It must be a writable stream, not readable.`)},Wt=(e,t,n,r)=>{if("all"===e&&!n.all)return'The "all" option must be true to use "from: \'all\'".';const{optionName:o,optionValue:i}=_t(e,n);return`The "${o}: ${Ht(i)}" option is incompatible with using "${Vt(r)}: ${Ht(t)}".\nPlease set this option with "pipe" instead.`},_t=(e,{stdin:t,stdout:n,stderr:r,stdio:o})=>{const i=zt(e);return 0===i&&void 0!==t?{optionName:"stdin",optionValue:t}:1===i&&void 0!==n?{optionName:"stdout",optionValue:n}:2===i&&void 0!==r?{optionName:"stderr",optionValue:r}:{optionName:`stdio[${i}]`,optionValue:o[i]}},zt=e=>"all"===e?1:e,Vt=e=>e?"to":"from",Ht=e=>"string"==typeof e?`'${e}'`:"number"==typeof e?`${e}`:"Stream",Kt=(e,t,n)=>{const r=e.getMaxListeners();0!==r&&r!==Number.POSITIVE_INFINITY&&(e.setMaxListeners(r+t),(0,St.addAbortListener)(n,(()=>{e.setMaxListeners(e.getMaxListeners()-t)})))},qt=(e,t)=>{t&&Yt(e)},Yt=e=>{e.refCounted()},Xt=(e,t)=>{t&&Qt(e)},Qt=e=>{e.unrefCounted()},Jt=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},o)=>{if(ln(o)||On(o))return;en.has(e)||en.set(e,[]);const i=en.get(e);if(i.push(o),!(i.length>1))for(;i.length>0;){await hn(e,r,o),await Ve.scheduler.yield();const s=await cn({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});i.shift(),r.emit("message",s),r.emit("message:done")}},Zt=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:o})=>{Nn();const i=en.get(e);for(;i?.length>0;)await(0,St.once)(r,"message:done");e.removeListener("message",o),((e,t)=>{t&&(Yt(e),Yt(e))})(t,n),r.connected=!1,r.emit("disconnect")},en=new WeakMap,tn=(e,t,n)=>{if(nn.has(e))return nn.get(e);const r=new St.EventEmitter;return r.connected=!0,nn.set(e,r),rn({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},nn=new WeakMap,rn=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{const o=Jt.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on("message",o),t.once("disconnect",Zt.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:o})),((e,t)=>{t&&(Qt(e),Qt(e))})(n,r)},on=e=>{const t=nn.get(e);return void 0===t?null!==e.channel:t.connected};let sn=0n;const an=(e,t)=>{if(t?.type===mn&&!t.hasListeners)for(const{id:t}of e)void 0!==t&&un[t].resolve({isDeadlock:!0,hasListeners:!1})},cn=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:o})=>{if(e?.type!==mn||!t.connected)return e;const{id:i,message:s}=e,a={id:i,type:fn,message:gn(t,o)};try{await wn({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},a)}catch(e){o.emit("strict:error",e)}return s},ln=e=>{if(e?.type!==fn)return!1;const{id:t,message:n}=e;return un[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},dn=async(e,t,n)=>{if(e?.type!==mn)return;const r=Pt();un[e.id]=r;const o=new AbortController;try{const{isDeadlock:e,hasListeners:i}=await Promise.race([r,pn(t,n,o)]);e&&(e=>{throw new Error(`${$t("sendMessage",e)} failed: the ${Bt(e)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${$t("getOneMessage",e)},\n\t${$t("sendMessage",e,"message, {strict: true}")},\n]);`)})(n),i||(e=>{throw new Error(`${$t("sendMessage",e)} failed: the ${Bt(e)} is not listening to incoming messages.`)})(n)}finally{o.abort(),delete un[e.id]}},un={},pn=async(e,t,{signal:n})=>{Kt(e,1,n),await(0,St.once)(e,"disconnect",{signal:n}),(e=>{throw new Error(`${$t("sendMessage",e)} failed: the ${Bt(e)} exited without listening to incoming messages.`)})(t)},mn="execa:ipc:request",fn="execa:ipc:response",hn=async(e,t,n)=>{for(;!gn(e,t)&&bn.get(e)?.size>0;){const t=[...bn.get(e)];an(t,n),await Promise.all(t.map((({onMessageSent:e})=>e)))}},bn=new WeakMap,gn=(e,t)=>t.listenerCount("message")>yn(e),yn=e=>Lt.has(e)&&!Y(Lt.get(e).options.buffer,"ipc")?1:0,wn=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},o,{strict:i=!1}={})=>{const s="sendMessage";return Dt({methodName:s,isSubprocess:n,ipc:r,isConnected:e.connected}),vn({anyProcess:e,channel:t,methodName:s,isSubprocess:n,message:o,strict:i})},vn=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:o,strict:i})=>{const s=(({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:o})=>{if(!o)return r;const i=tn(e,t,n),s=gn(e,i);return{id:sn++,type:mn,message:r,hasListeners:s}})({anyProcess:e,channel:t,isSubprocess:r,message:o,strict:i}),a=((e,t,n)=>{bn.has(e)||bn.set(e,new Set);const r=bn.get(e),o={onMessageSent:Pt(),id:n?t.id:void 0};return r.add(o),{outgoingMessages:r,outgoingMessage:o}})(e,s,i);try{await Sn({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:s,message:o})}catch(t){throw jt(e),t}finally{(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()})(a)}},Sn=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:o})=>{const i=xn(e);try{await Promise.all([dn(r,e,n),i(r)])}catch(e){throw(({error:e,methodName:t,isSubprocess:n})=>{if("EPIPE"===e.code)throw new Error(`${$t(t,n)} cannot be used: the ${Bt(n)} is disconnecting.`,{cause:e})})({error:e,methodName:t,isSubprocess:n}),(({error:e,methodName:t,isSubprocess:n,message:r})=>{if((({code:e,message:t})=>Nt.has(e)||Ct.some((e=>t.includes(e))))(e))throw new Error(`${$t(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})})({error:e,methodName:t,isSubprocess:n,message:o}),e}},xn=e=>{if(En.has(e))return En.get(e);const t=(0,$.promisify)(e.send.bind(e));return En.set(e,t),t},En=new WeakMap,Tn=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await Dn({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),Cn.signal),Dn=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{In||(In=!0,r?null!==t?(tn(e,t,n),await Ve.scheduler.yield()):Nn():(()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")})())};let In=!1;const On=e=>e?.type===Mn&&(Cn.abort(e.message),!0),Mn="execa:ipc:cancel",Nn=()=>{Cn.abort(new Error(`\`cancelSignal\` aborted: the ${Bt(!0)} disconnected.`))},Cn=new AbortController,$n=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:o,controller:i})=>n?[An({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:o,controller:i})]:[],An=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:o}})=>{await xt(t,o);const i=Bn(t);throw await((e,t)=>{const n="cancelSignal";return Ot(n,!1,e.connected),Sn({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:Mn,message:t},message:t})})(e,i),vt({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:o}),r.terminationReason??="gracefulCancel",t.reason},Bn=({reason:e})=>{if(!(e instanceof DOMException))return e;const t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},jn=(e,t,n,r)=>0===t||void 0===t?[]:[Pn(e,t,n,r)],Pn=async(e,t,n,{signal:r})=>{throw await(0,Ve.setTimeout)(t,void 0,{signal:r}),n.terminationReason??="timeout",e.kill(),new He},kn=e(import.meta.url)("node:v8"),Rn={advanced:e=>{try{(0,kn.serialize)(e)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},Ln=async(e,t)=>{void 0!==t&&await e.sendMessage(t)},Un=new Set(["utf8","utf16le"]),Fn=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Gn=new Set([...Un,...Fn]),Wn={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},_n=e=>"string"==typeof e?`"${e}"`:String(e);var zn=r(3024);const Vn=()=>{try{return A.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},Hn=(e,t,n)=>{n.cwd=((e=Vn())=>{const t=s(e,'The "cwd" option');return Fe.resolve(t)})(n.cwd);const[r,o,i]=((e,t,{node:n=!1,nodePath:r=A.execPath,nodeOptions:o=A.execArgv.filter((e=>!e.startsWith("--inspect"))),cwd:i,execPath:a,...c})=>{if(void 0!==a)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const l=s(r,'The "nodePath" option'),d=Fe.resolve(i,l),u={...c,nodePath:d,node:n,cwd:i};if(!n)return[e,t,u];if("node"===Fe.basename(e,".exe"))throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[d,[...o,e,...t],{ipc:!0,...u,shell:!1}]})(e,t,n),{command:a,args:c,options:d}=Ge._parse(r,o,i),u=(e=>{const t={...e};for(const n of q)t[n]=R(e,n);return t})(d),p=Kn(u);return(({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)})(p),(({encoding:e})=>{if(Gn.has(e))return;const t=(e=>{if(null===e)return"buffer";if("string"!=typeof e)return;const t=e.toLowerCase();return t in Wn?Wn[t]:Gn.has(t)?t:void 0})(e);if(void 0!==t)throw new TypeError(`Invalid option \`encoding: ${_n(e)}\`.\nPlease rename it to ${_n(t)}.`);const n=[...Gn].map((e=>_n(e))).join(", ");throw new TypeError(`Invalid option \`encoding: ${_n(e)}\`.\nPlease rename it to one of: ${n}.`)})(p),(({ipcInput:e,ipc:t,serialization:n})=>{if(void 0!==e){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Rn[n](e)}})(p),(({cancelSignal:e})=>{if(void 0!==e&&"[object AbortSignal]"!==Object.prototype.toString.call(e))throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)})(p),(({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(void 0===t)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if("json"===r)throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}})(p),p.shell=l(p.shell),p.env=qn(p),p.killSignal=(e=>{const t="option `killSignal`";if(0===e)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return ct(e,t)})(p.killSignal),p.forceKillAfterDelay=(e=>{if(!1===e)return e;if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e})(p.forceKillAfterDelay),p.lines=p.lines.map(((e,t)=>e&&!Fn.has(p.encoding)&&p.buffer[t])),"win32"===A.platform&&"cmd"===Fe.basename(a,".exe")&&c.unshift("/q"),{file:a,commandArguments:c,options:p}},Kn=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:o="utf8",reject:i=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:d=!0,gracefulCancel:u=!1,ipcInput:p,ipc:m=void 0!==p||u,serialization:f="advanced",...h})=>({...h,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:o,reject:i,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:d,gracefulCancel:u,ipcInput:p,ipc:m,serialization:f}),qn=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:o,nodePath:i})=>{const s=t?{...A.env,...e}:e;return n||r?ze({env:s,cwd:o,execPath:i,preferLocal:n,addExecPath:r}):s};function Yn(e){if("string"==typeof e)return Xn(e);if(!ArrayBuffer.isView(e)||1!==e.BYTES_PER_ELEMENT)throw new Error("Input must be a string or a Uint8Array");return Qn(e)}const Xn=e=>e.at(-1)===Jn?e.slice(0,e.at(-2)===er?-2:-1):e,Qn=e=>e.at(-1)===Zn?e.subarray(0,e.at(-2)===tr?-2:-1):e,Jn="\n",Zn=Jn.codePointAt(0),er="\r",tr=er.codePointAt(0);function nr(e,{checkOpen:t=!0}={}){return null!==e&&"object"==typeof e&&(e.writable||e.readable||!t||void 0===e.writable&&void 0===e.readable)&&"function"==typeof e.pipe}function rr(e,{checkOpen:t=!0}={}){return nr(e,{checkOpen:t})&&(e.writable||!t)&&"function"==typeof e.write&&"function"==typeof e.end&&"boolean"==typeof e.writable&&"boolean"==typeof e.writableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function or(e,{checkOpen:t=!0}={}){return nr(e,{checkOpen:t})&&(e.readable||!t)&&"function"==typeof e.read&&"boolean"==typeof e.readable&&"boolean"==typeof e.readableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function ir(e,t){return rr(e,t)&&or(e,t)}const sr=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class ar{#e;#t;#n=!1;#r=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){const e=()=>this.#o();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){const t=()=>this.#i(e);return this.#r?this.#r.then(t,t):t()}async#o(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),e}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#i(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){const t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}}const cr=Symbol();function lr(){return this[cr].next()}function dr(e){return this[cr].return(e)}Object.defineProperty(lr,"name",{value:"next"}),Object.defineProperty(dr,"name",{value:"return"});const ur=Object.create(sr,{next:{enumerable:!0,configurable:!0,writable:!0,value:lr},return:{enumerable:!0,configurable:!0,writable:!0,value:dr}});function pr({preventCancel:e=!1}={}){const t=this.getReader(),n=new ar(t,e),r=Object.create(ur);return r[cr]=n,r}const mr=e=>{if(or(e,{checkOpen:!1})&&void 0!==gr.on)return hr(e);if("function"==typeof e?.[Symbol.asyncIterator])return e;if("[object ReadableStream]"===fr.call(e))return pr.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:fr}=Object.prototype,hr=async function*(e){const t=new AbortController,n={};br(e,t,n);try{for await(const[n]of gr.on(e,"data",{signal:t.signal}))yield n}catch(e){if(void 0!==n.error)throw n.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},br=async(e,t,n)=>{try{await gr.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},gr={},yr=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const l=mr(e),d=t();d.length=0;try{for await(const e of l){const t=n[xr(e)](e,d);vr({convertedChunk:t,state:d,getSize:r,truncateChunk:o,addChunk:i,maxBuffer:c})}return wr({state:d,convertChunk:n,getSize:r,truncateChunk:o,addChunk:i,getFinalChunk:s,maxBuffer:c}),a(d)}catch(e){const t="object"==typeof e&&null!==e?e:new Error(e);throw t.bufferedData=a(d),t}},wr=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:o,maxBuffer:i})=>{const s=o(e);void 0!==s&&vr({convertedChunk:s,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:i})},vr=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:o,maxBuffer:i})=>{const s=n(e),a=t.length+s;if(a<=i)return void Sr(e,t,o,a);const c=r(e,i-t.length);throw void 0!==c&&Sr(c,t,o,i),new Tr},Sr=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},xr=e=>{const t=typeof e;if("string"===t)return"string";if("object"!==t||null===e)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";const n=Er.call(e);return"[object ArrayBuffer]"===n?"arrayBuffer":"[object DataView]"===n?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===Er.call(e.buffer)?"typedArray":"others"},{toString:Er}=Object.prototype;class Tr extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const Dr=(e,t,n)=>{if(t.length!==n)return;const r=new Tr;throw r.maxBufferInfo={fdNumber:"ipc"},r},Ir=([,e])=>e,Or=({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:o,errorCode:i,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:d,isForcefullyTerminated:u,forceKillAfterDelay:p,killSignal:m})=>{const f=Mr(u,p);return t?`Command timed out after ${n} milliseconds${f}`:d?void 0===s?`Command was gracefully canceled with exit code ${c}`:u?`Command was gracefully canceled${f}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${f}`:r?`${((e,t)=>{const{streamName:n,threshold:r,unit:o}=((e,t)=>{if(void 0===e?.maxBufferInfo)return{streamName:"output",threshold:t[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;const o=Y(t,n);return"ipc"===n?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:k(n),threshold:o,unit:r}})(e,t);return`Command's ${n} was larger than ${r} ${o}`})(e,o)}${f}`:void 0!==i?`Command failed with ${i}${f}`:u?`Command was killed with ${m} (${ht(m)})${f}`:void 0!==s?`Command was killed with ${s} (${a})`:void 0!==c?`Command failed with exit code ${c}`:"Command failed"},Mr=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",Nr=e=>"string"==typeof e?e:f(e)?w(e):"",Cr=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:o,options:{cwd:i},startTime:s})=>jr({command:e,escapedCommand:t,cwd:i,durationMs:Le(s),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:o,pipedFrom:[]}),$r=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:o,startTime:i,isSync:s})=>Ar({error:e,command:t,escapedCommand:n,startTime:i,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:o,isSync:s}),Ar=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:d,stdio:u,all:p,ipcOutput:m,options:{timeoutDuration:f,timeout:h=f,forceKillAfterDelay:b,killSignal:g,cwd:y,maxBuffer:w},isSync:v})=>{const{exitCode:S,signal:x,signalDescription:E}=Pr(l,d),{originalMessage:T,shortMessage:D,message:I}=(({stdio:e,all:t,ipcOutput:n,originalError:r,signal:o,signalDescription:i,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:d,isMaxBuffer:u,isForcefullyTerminated:p,forceKillAfterDelay:m,killSignal:f,maxBuffer:h,timeout:b,cwd:g})=>{const y=r?.code,w=Or({originalError:r,timedOut:c,timeout:b,isMaxBuffer:u,maxBuffer:h,errorCode:y,signal:o,signalDescription:i,exitCode:s,isCanceled:l,isGracefullyCanceled:d,isForcefullyTerminated:p,forceKillAfterDelay:m,killSignal:f}),v=((e,t)=>{if(e instanceof He)return;const n=Ye(r=e)&&qe in r?e.originalMessage:String(e?.message??e);var r;const o=ne(((e,t)=>{if(t===Vn())return e;let n;try{n=(0,zn.statSync)(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}`})(n,t));return""===o?void 0:o})(r,g),S=`${w}: ${a}${void 0===v?"":`\n${v}`}`,x=[S,...void 0===t?[e[2],e[1]]:[t],...e.slice(3),n.map((e=>(e=>"string"==typeof e?e:(0,$.inspect)(e))(e))).join("\n")].map((e=>ne(Yn((e=>Array.isArray(e)?e.map((e=>Yn(Nr(e)))).filter(Boolean).join("\n"):Nr(e))(e))))).filter(Boolean).join("\n\n");return{originalMessage:v,shortMessage:S,message:x}})({stdio:u,all:p,ipcOutput:m,originalError:e,signal:x,signalDescription:E,exitCode:S,escapedCommand:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:b,killSignal:g,maxBuffer:w,timeout:h,cwd:y}),O=((e,t,n)=>new(n?Qe:Xe)(t,e instanceof He?{}:{cause:e}))(e,I,v);return Object.assign(O,Br({error:O,command:t,escapedCommand:n,startTime:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:S,signal:x,signalDescription:E,stdio:u,all:p,ipcOutput:m,cwd:y,originalMessage:T,shortMessage:D})),O},Br=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:d,signalDescription:u,stdio:p,all:m,ipcOutput:f,cwd:h,originalMessage:b,shortMessage:g})=>jr({shortMessage:g,originalMessage:b,command:t,escapedCommand:n,cwd:h,durationMs:Le(r),failed:!0,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isTerminated:void 0!==d,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:d,signalDescription:u,code:e.cause?.code,stdout:p[1],stderr:p[2],all:m,stdio:p,ipcOutput:f,pipedFrom:[]}),jr=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e))),Pr=(e,t)=>{const n=null===t?void 0:t;return{exitCode:null===e?void 0:e,signal:n,signalDescription:void 0===n?void 0:ht(t)}},kr=e=>Number.isFinite(e)?e:0;function Rr(e,t){const n="bigint"==typeof e;if(!n&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");const r=e<0?"-":"";e=e<0?-e:e,(t={...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 o=[];const i=(e,n,r,i)=>{if(0!==o.length&&t.colonNotation||!(e=>0===e||0n===e)(e)||t.colonNotation&&"m"===r){if(i??=String(e),t.colonNotation){const e=i.includes(".")?i.split(".")[0].length:i.length,t=o.length>0?2:1;i="0".repeat(Math.max(0,t-e))+i}else i+=t.verbose?" "+((e,t)=>1===t||1n===t?e:`${e}s`)(n,e):r;o.push(i)}},s=function(e){switch(typeof e){case"number":if(Number.isFinite(e))return function(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(kr(1e3*e)%1e3),nanoseconds:Math.trunc(kr(1e6*e)%1e3)}}(e);break;case"bigint":return function(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}(e)}throw new TypeError("Expected a finite number or bigint")}(e),a=BigInt(s.days);if(t.hideYearAndDays?i(24n*BigInt(a)+BigInt(s.hours),"hour","h"):(t.hideYear?i(a,"day","d"):(i(a/365n,"year","y"),i(a%365n,"day","d")),i(Number(s.hours),"hour","h")),i(Number(s.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3){const e=Number(s.seconds),n=Number(s.milliseconds),r=Number(s.microseconds),o=Number(s.nanoseconds);if(i(e,"second","s"),t.formatSubMilliseconds)i(n,"millisecond","ms"),i(r,"microsecond","\xb5s"),i(o,"nanosecond","ns");else{const e=n+r/1e3+o/1e6,s="number"==typeof t.millisecondsDecimalDigits?t.millisecondsDecimalDigits:0,a=e>=1?Math.round(e):Math.ceil(e),c=s?e.toFixed(s):a;i(Number.parseFloat(c),"millisecond","ms",c)}}else{const r=((e,t)=>{const n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)})((n?Number(e%86400000n):e)/1e3%60,"number"==typeof t.secondsDecimalDigits?t.secondsDecimalDigits:1),o=t.keepDecimalsOnWholeSeconds?r:r.replace(/\.0+$/,"");i(Number.parseFloat(o),"second","s",o)}if(0===o.length)return r+"0"+(t.verbose?" milliseconds":"ms");const c=t.colonNotation?":":" ";return"number"==typeof t.unitCount&&(o=o.slice(0,Math.max(t.unitCount,1))),r+o.join(c)}const Lr=(e,t)=>{const n=`(done in ${Rr(e.durationMs)})`;Ne({type:"duration",verboseMessage:n,verboseInfo:t,result:e})},Ur=(e,t,{reject:n})=>{if(((e,t)=>{X(t)&&(((e,t)=>{e.failed&&Ne({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})})(e,t),Lr(e,t))})(e,t),e.failed&&n)throw e;return e},Fr=(e,t)=>Yr(e)?"asyncGenerator":Xr(e)?"generator":Jr(e)?"fileUrl":Zr(e)?"filePath":io(e)?"webStream":nr(e,{checkOpen:!1})?"native":f(e)?"uint8Array":ao(e)?"asyncIterable":co(e)?"iterable":so(e)?_r({transform:e},t):Qr(e)?Gr(e,t):"native",Gr=(e,t)=>ir(e.transform,{checkOpen:!1})?Wr(e,t):so(e.transform)?_r(e,t):Hr(e,t),Wr=(e,t)=>(zr(e,t,"Duplex stream"),"duplex"),_r=(e,t)=>(zr(e,t,"web TransformStream"),"webTransform"),zr=({final:e,binary:t,objectMode:n},r,o)=>{Vr(e,`${r}.final`,o),Vr(t,`${r}.binary`,o),Kr(n,`${r}.objectMode`)},Vr=(e,t,n)=>{if(void 0!==e)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Hr=({transform:e,final:t,binary:n,objectMode:r},o)=>{if(void 0!==e&&!qr(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(ir(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(so(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(void 0!==t&&!qr(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return Kr(n,`${o}.binary`),Kr(r,`${o}.objectMode`),Yr(e)||Yr(t)?"asyncGenerator":"generator"},Kr=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw new TypeError(`The \`${t}\` option must use a boolean.`)},qr=e=>Yr(e)||Xr(e),Yr=e=>"[object AsyncGeneratorFunction]"===Object.prototype.toString.call(e),Xr=e=>"[object GeneratorFunction]"===Object.prototype.toString.call(e),Qr=e=>o(e)&&(void 0!==e.transform||void 0!==e.final),Jr=e=>"[object URL]"===Object.prototype.toString.call(e),Zr=e=>o(e)&&Object.keys(e).length>0&&Object.keys(e).every((e=>eo.has(e)))&&to(e.file),eo=new Set(["file","append"]),to=e=>"string"==typeof e,no=new Set(["ipc","ignore","inherit","overlapped","pipe"]),ro=e=>"[object ReadableStream]"===Object.prototype.toString.call(e),oo=e=>"[object WritableStream]"===Object.prototype.toString.call(e),io=e=>ro(e)||oo(e),so=e=>ro(e?.readable)&&oo(e?.writable),ao=e=>lo(e)&&"function"==typeof e[Symbol.asyncIterator],co=e=>lo(e)&&"function"==typeof e[Symbol.iterator],lo=e=>"object"==typeof e&&null!==e,uo=new Set(["generator","asyncGenerator","duplex","webTransform"]),po=new Set(["fileUrl","filePath","fileNumber"]),mo=new Set(["fileUrl","filePath"]),fo=new Set([...mo,"webStream","nodeStream"]),ho=new Set(["webTransform","duplex"]),bo={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"},go=(e,t,n,r)=>"output"===r?yo(e,t,n):wo(e,t,n),yo=(e,t,n)=>{const r=0!==t&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},wo=(e,t,n)=>{const r=0===t?!0===e:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},vo=(e,t,n,{encoding:r})=>{const o=e.filter((({type:e})=>uo.has(e))),i=Array.from({length:o.length});for(const[e,s]of Object.entries(o))i[e]=So({stdioItem:s,index:Number(e),newTransforms:i,optionName:t,direction:n,encoding:r});return Do(i,n)},So=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:o,direction:i,encoding:s})=>"duplex"===t?xo({stdioItem:e,optionName:o}):"webTransform"===t?Eo({stdioItem:e,index:n,newTransforms:r,direction:i}):To({stdioItem:e,index:n,newTransforms:r,direction:i,encoding:s}),xo=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:o=r}},optionName:i})=>{if(o&&!r)throw new TypeError(`The \`${i}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&r)throw new TypeError(`The \`${i}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},Eo=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:a}=o(t)?t:{transform:t},{writableObjectMode:c,readableObjectMode:l}=go(a,n,r,i);return{...e,value:{transform:s,writableObjectMode:c,readableObjectMode:l}}},To=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:a,final:c,binary:l=!1,preserveNewlines:d=!1,objectMode:u}=o(t)?t:{transform:t},p=l||Fn.has(s),{writableObjectMode:m,readableObjectMode:f}=go(u,n,r,i);return{...e,value:{transform:a,final:c,binary:p,preserveNewlines:d,writableObjectMode:m,readableObjectMode:f}}},Do=(e,t)=>"input"===t?e.reverse():e,Io=["input","output","output"],Oo=()=>{},Mo=()=>"input",No={generator:Oo,asyncGenerator:Oo,fileUrl:Oo,filePath:Oo,iterable:Mo,asyncIterable:Mo,uint8Array:Mo,webStream:e=>oo(e)?"output":"input",nodeStream:e=>or(e,{checkOpen:!1})?rr(e,{checkOpen:!1})?void 0:"input":"output",webTransform:Oo,duplex:Oo,native(e){const t=Co(e);return void 0!==t?t:nr(e,{checkOpen:!1})?No.nodeStream(e):void 0}},Co=e=>[0,A.stdin].includes(e)?"input":[1,2,A.stdout,A.stderr].includes(e)?"output":void 0,$o=e=>P.some((t=>void 0!==e[t])),Ao=(e,t)=>Array.isArray(e)?e.map((e=>Ao(e,t))):null==e?t>=P.length?"ignore":"pipe":e,Bo=e=>"pipe"===e||Array.isArray(e)&&e.every((e=>"pipe"===e)),jo=({value:e,optionName:t,fdNumber:n,direction:r})=>{const o=Po(e,n);if(void 0!==o){if("output"===r)return{type:"fileNumber",value:o,optionName:t};if(fe.isatty(o))throw new TypeError(`The \`${t}: ${Ht(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:h((0,zn.readFileSync)(o)),optionName:t}}},Po=(e,t)=>{if("inherit"===e)return t;if("number"==typeof e)return e;const n=j.indexOf(e);return-1!==n?n:void 0},ko=(e,t,n)=>{const r=j[e];if(void 0===r)throw new TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},Ro=({input:e,inputFile:t},n)=>0===n?[...Lo(e),...Fo(t)]:[],Lo=e=>void 0===e?[]:[{type:Uo(e),value:e,optionName:"input"}],Uo=e=>{if(or(e,{checkOpen:!1}))return"nodeStream";if("string"==typeof e)return"string";if(f(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Fo=e=>void 0===e?[]:[{...Go(e),optionName:"inputFile"}],Go=e=>{if(Jr(e))return{type:"fileUrl",value:e};if(to(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},Wo=({otherStdioItems:e,type:t,value:n,optionName:r,direction:o})=>{const i=e.filter((e=>_o(e,n)));if(0===i.length)return;const s=i.find((e=>e.direction!==o));return zo(s,r,t),"output"===o?i[0].stream:void 0},_o=({type:e,value:t},n)=>"filePath"===e?t.file===n.file:"fileUrl"===e?t.href===n.href:t===n,zo=(e,t,n)=>{if(void 0!==e)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${bo[n]} that is the same.`)},Vo=(e,t,n,r)=>{const o=(({stdio:e,ipc:t,buffer:n,...r},o,i)=>{const s=((e,t)=>{if(void 0===e)return P.map((e=>t[e]));if($o(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${P.map((e=>`\`${e}\``)).join(", ")}`);if("string"==typeof e)return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const n=Math.max(e.length,P.length);return Array.from({length:n},((t,n)=>e[n]))})(e,r).map(((e,t)=>Ao(e,t)));return i?((e,t,n)=>e.map(((e,r)=>t[r]||0===r||Q(n,r)||!Bo(e)?e:"ignore")))(s,n,o):((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e)(s,t)})(t,n,r),i=o.map(((e,n)=>Ho({stdioOption:e,fdNumber:n,options:t,isSync:r}))),s=ei({initialFileDescriptors:i,addProperties:e,options:t,isSync:r});return t.stdio=s.map((({stdioItems:e})=>oi(e))),s},Ho=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{const o=k(t),{stdioItems:i,isStdioArray:s}=Ko({stdioOption:e,fdNumber:t,options:n,optionName:o}),a=((e,t,n)=>{const r=e.map((e=>(({type:e,value:t},n)=>Io[n]??No[e](t))(e,t)));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??"output"})(i,t,o),c=i.map((e=>(({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:o,isSync:i})=>n&&"native"===t?i?(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:o})=>{const i=jo({value:t,optionName:n,fdNumber:r,direction:o});if(void 0!==i)return i;if(nr(t,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e})({stdioItem:e,fdNumber:r,direction:o}):(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>"inherit"===t?{type:"nodeStream",value:ko(r,t,n),optionName:n}:"number"==typeof t?{type:"nodeStream",value:ko(t,t,n),optionName:n}:nr(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:n}:e)({stdioItem:e,fdNumber:r}):e)({stdioItem:e,isStdioArray:s,fdNumber:t,direction:a,isSync:r}))),l=((e,t,n,r)=>[...e.filter((({type:e})=>!uo.has(e))),...vo(e,t,n,r)])(c,o,a,n),d=((e,t)=>{const n=e.findLast((({type:e})=>uo.has(e)));return void 0!==n&&("input"===t?n.value.writableObjectMode:n.value.readableObjectMode)})(l,a);return Zo(l,d),{direction:a,objectMode:d,stdioItems:l}},Ko=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{const o=(e=>e.filter(((t,n)=>e.every(((e,r)=>t.value!==e.value||n>=r||"generator"===t.type||"asyncGenerator"===t.type)))))([...(Array.isArray(e)?e:[e]).map((e=>qo(e,r))),...Ro(n,t)]),i=o.length>1;return Yo(o,i,r),Qo(o),{stdioItems:o,isStdioArray:i}},qo=(e,t)=>({type:Fr(e,t),value:e,optionName:t}),Yo=(e,t,n)=>{if(0===e.length)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(t)for(const{value:t,optionName:n}of e)if(Xo.has(t))throw new Error(`The \`${n}\` option must not include \`${t}\`.`)},Xo=new Set(["ignore","ipc"]),Qo=e=>{for(const t of e)Jo(t)},Jo=({type:e,value:t,optionName:n})=>{if((e=>Jr(e)&&"file:"!==e.protocol)(t))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.\nFor example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(((e,t)=>"native"===e&&"string"==typeof t&&!no.has(t))(e,t))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},Zo=(e,t)=>{if(!t)return;const n=e.find((({type:e})=>po.has(e)));if(void 0!==n)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},ei=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{const o=[];try{for(const i of e)o.push(ti({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:n,isSync:r}));return o}catch(e){throw ri(o),e}},ti=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:o,options:i,isSync:s})=>{const a=n.map((t=>ni({stdioItem:t,addProperties:o,direction:e,options:i,fileDescriptors:r,isSync:s})));return{direction:e,objectMode:t,stdioItems:a}},ni=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:o,isSync:i})=>{const s=(({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:o,isSync:i})=>{const s=((e,t)=>e.flatMap((({direction:e,stdioItems:n})=>n.filter((e=>e.type===t)).map((t=>({...t,direction:e}))))))(o,e);if(0!==s.length){if(!i)return fo.has(e)?Wo({otherStdioItems:s,type:e,value:t,optionName:n,direction:r}):void(ho.has(e)&&(({otherStdioItems:e,type:t,value:n,optionName:r})=>{const o=e.find((({value:{transform:e}})=>e===n.transform));zo(o,r,t)})({otherStdioItems:s,type:e,value:t,optionName:n}));(({otherStdioItems:e,type:t,value:n,optionName:r,direction:o})=>{mo.has(t)&&Wo({otherStdioItems:e,type:t,value:n,optionName:r,direction:o})})({otherStdioItems:s,type:e,value:t,optionName:n,direction:r})}})({stdioItem:e,direction:n,fileDescriptors:o,isSync:i});return void 0!==s?{...e,stream:s}:{...e,...t[n][e.type](e,r)}},ri=e=>{for(const{stdioItems:t}of e)for(const{stream:e}of t)void 0===e||B(e)||e.destroy()},oi=e=>{if(e.length>1)return e.some((({value:e})=>"overlapped"===e))?"overlapped":"pipe";const[{type:t,value:n}]=e;return"native"===t?n:"pipe"},ii=({type:e,optionName:t})=>{si(t,bo[e])},si=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},ai={generator(){},asyncGenerator:ii,webStream:ii,nodeStream:ii,webTransform:ii,duplex:ii,asyncIterable:ii,native:({optionName:e,value:t})=>("ipc"!==t&&"overlapped"!==t||si(e,`"${t}"`),{})},ci={input:{...ai,fileUrl:({value:e})=>({contents:[h((0,zn.readFileSync)(e))]}),filePath:({value:{file:e}})=>({contents:[h((0,zn.readFileSync)(e))]}),fileNumber:ii,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...ai,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:ii,string:ii,uint8Array:ii}},li=(e,{stripFinalNewline:t},n)=>di(t,n)&&void 0!==e&&!Array.isArray(e)?Yn(e):e,di=(e,t)=>"all"===t?e[1]||e[2]:e[t];var ui=r(7075);const pi=(e,t,n,r)=>e||n?void 0:hi(t,r),mi=(e,t,n)=>n?e.flatMap((e=>fi(e,t))):fi(e,t),fi=(e,t)=>{const{transform:n,final:r}=hi(t,{});return[...n(e),...r()]},hi=(e,t)=>(t.previousChunks="",{transform:bi.bind(void 0,t,e),final:yi.bind(void 0,t)}),bi=function*(e,t,n){if("string"!=typeof n)return void(yield n);let{previousChunks:r}=e,o=-1;for(let i=0;i<n.length;i+=1)if("\n"===n[i]){const s=gi(n,i,t,e);let a=n.slice(o+1,i+1-s);r.length>0&&(a=Si(r,a),r=""),yield a,o=i}o!==n.length-1&&(r=Si(r,n.slice(o+1))),e.previousChunks=r},gi=(e,t,n,r)=>n?0:(r.isWindowsNewline=0!==t&&"\r"===e[t-1],r.isWindowsNewline?2:1),yi=function*({previousChunks:e}){e.length>0&&(yield e)},wi=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:vi.bind(void 0,r)},vi=function*({isWindowsNewline:e=!1},t){const{unixNewline:n,windowsNewline:r,LF:o,concatBytes:i}="string"==typeof t?xi:Ei;if(t.at(-1)===o)return void(yield t);const s=e?r:n;yield i(t,s)},Si=(e,t)=>`${e}${t}`,xi={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:Si},Ei={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{const n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}};var Ti=r(4573);const Di=(e,t)=>e?void 0:Ii.bind(void 0,t),Ii=function*(e,t){if("string"!=typeof t&&!f(t)&&!Ti.Buffer.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Oi=(e,t)=>e?Mi.bind(void 0,t):Ni.bind(void 0,t),Mi=function*(e,t){Ci(e,t),yield t},Ni=function*(e,t){if(Ci(e,t),"string"!=typeof t&&!f(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Ci=(e,t)=>{if(null==t)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.\nInstead, \`yield\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`)},$i=(e,t,n)=>{if(n)return;if(e)return{transform:Ai.bind(void 0,new TextEncoder)};const r=new p.StringDecoder(t);return{transform:Bi.bind(void 0,r),final:ji.bind(void 0,r)}},Ai=function*(e,t){Ti.Buffer.isBuffer(t)?yield h(t):"string"==typeof t?yield e.encode(t):yield t},Bi=function*(e,t){yield f(t)?e.write(t):t},ji=function*(e){const t=e.end();""!==t&&(yield t)},Pi=(0,$.callbackify)((async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(const e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}})),ki=async function*(e,t,n){if(n===t.length)return void(yield e);const{transform:r=Fi}=t[n];for await(const o of r(e))yield*ki(o,t,n+1)},Ri=async function*(e){for(const[t,{final:n}]of Object.entries(e))yield*Li(n,Number(t),e)},Li=async function*(e,t,n){if(void 0!==e)for await(const r of e())yield*ki(r,n,t+1)},Ui=(0,$.callbackify)((async({currentIterable:e},t)=>{if(void 0===e){if(t)throw t}else await(t?e.throw(t):e.return())})),Fi=function*(e){yield e},Gi=(e,t,n,r)=>{try{for(const r of e(...t))n.push(r);r()}catch(e){r(e)}},Wi=(e,t)=>[...t.flatMap((t=>[..._i(t,e,0)])),...zi(e)],_i=function*(e,t,n){if(n===t.length)return void(yield e);const{transform:r=Hi}=t[n];for(const o of r(e))yield*_i(o,t,n+1)},zi=function*(e){for(const[t,{final:n}]of Object.entries(e))yield*Vi(n,Number(t),e)},Vi=function*(e,t,n){if(void 0!==e)for(const r of e())yield*_i(r,n,t+1)},Hi=function*(e){yield e},Ki=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:o},optionName:i},{encoding:s})=>{const a={},c=Yi(e,s,i),l=Yr(t),d=Yr(n),u=l?Pi.bind(void 0,ki,a):Gi.bind(void 0,_i),p=l||d?Pi.bind(void 0,Ri,a):Gi.bind(void 0,zi),m=l||d?Ui.bind(void 0,a):void 0;return{stream:new ui.Transform({writableObjectMode:r,writableHighWaterMark:(0,ui.getDefaultHighWaterMark)(r),readableObjectMode:o,readableHighWaterMark:(0,ui.getDefaultHighWaterMark)(o),transform(e,t,n){u([e,c,0],this,n)},flush(e){p([c],this,e)},destroy:m})}},qi=(e,t,n,r)=>{const o=t.filter((({type:e})=>"generator"===e)),i=r?o.reverse():o;for(const{value:t,optionName:r}of i){const o=Yi(t,n,r);e=Wi(o,e)}return e},Yi=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:o,preserveNewlines:i},s,a)=>{const c={};return[{transform:Di(r,a)},$i(n,s,r),pi(n,i,r,c),{transform:e,final:t},{transform:Oi(o,a)},wi({binary:n,preserveNewlines:i,readableObjectMode:o,state:c})].filter(Boolean)},Xi=(e,t,n)=>{const{stdioItems:r}=e[t],o=r.filter((({contents:e})=>void 0!==e));if(0===o.length)return;if(0!==t){const[{type:e,optionName:t}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${bo[e]} with synchronous methods.`)}const i=o.map((({contents:e})=>e)).map((e=>Qi(e,r)));n.input=v(i)},Qi=(e,t)=>{const n=qi(e,t,"utf8",!0);return Ji(n),v(n)},Ji=e=>{const t=e.find((e=>"string"!=typeof e&&!f(e)));if(void 0!==t)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},Zi=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>"all"!==r&&Q(n,r)&&!Fn.has(t)&&es(r)&&(e.some((({type:e,value:t})=>"native"===e&&ts.has(t)))||e.every((({type:e})=>uo.has(e)))),es=e=>1===e||2===e,ts=new Set(["pipe","overlapped"]),ns=e=>e._readableState.pipes.length>0,rs=(e,t,n)=>{const r=Be(e);Ne({type:"output",verboseMessage:r,fdNumber:t,verboseInfo:n})},os=(e,t,n,r)=>{try{return qi(e,t,n,!1)}catch(t){return r.error=t,e}},is=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if("buffer"===n)return{serializedResult:v(e)};const s=((e,t)=>((e,t)=>{if("utf8"===t&&e.every((e=>"string"==typeof e)))return e;const n=new p.StringDecoder(t),r=e.map((e=>"string"==typeof e?g(e):e)).map((e=>n.write(e))),o=n.end();return""===o?r:[...r,o]})(e,t).join(""))(e,n);return r[i]?{serializedResult:s,finalResult:mi(s,!o[i],t)}:{serializedResult:s}},ss=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:o,stdioItems:i,objectMode:s})=>{if(!Zi({stdioItems:i,encoding:o,verboseInfo:r,fdNumber:t}))return;const a=mi(e,!1,s);try{((e,t,n)=>{for(const r of e)rs(r,t,n)})(a,t,r)}catch(e){n.error??=e}},as=(e,t,n)=>{for(const{path:r,append:o}of t.filter((({type:e})=>po.has(e)))){const t="string"==typeof r?r:r.toString();o||n.has(t)?(0,zn.appendFileSync)(r,e):(n.add(t),(0,zn.writeFileSync)(r,e))}},cs=async e=>{try{return await(0,St.once)(e,"exit")}catch{return cs(e)}},ls=async e=>{const[t,n]=await e;if(!ds(t,n)&&us(t,n))throw new He;return[t,n]},ds=(e,t)=>void 0===e&&void 0===t,us=(e,t)=>0!==e||null!==t,ps=(e,t,n)=>void 0!==e?e:us(t,n)?new He:void 0,ms=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,fs=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&hs("ipcInput"),e&&hs("ipc: true"),n&&hs("detached: true"),r&&hs("cancelSignal")},hs=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},bs=({file:e,commandArguments:t,options:n,command:r,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:a})=>{const c=gs({file:e,commandArguments:t,options:n,command:r,escapedCommand:o,fileDescriptors:s,startTime:a});if(c.failed)return c;const{resultError:l,exitCode:d,signal:u,timedOut:p,isMaxBuffer:m}=(({error:e,status:t,signal:n,output:r},{maxBuffer:o})=>{const i=ps(e,t,n),s="ETIMEDOUT"===i?.code,a=((e,t,n)=>"ENOBUFS"===e?.code&&null!==t&&t.some((e=>null!==e&&e.length>Ir(n))))(i,r,o);return{resultError:i,exitCode:t,signal:n,timedOut:s,isMaxBuffer:a}})(c,n),{output:b,error:g=l}=(({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:o})=>{if(null===t)return{output:Array.from({length:3})};const i={},s=new Set([]);return{output:t.map(((t,a)=>(({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:o,isMaxBuffer:i,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:d,maxBuffer:u})=>{if(null===e)return;const p=((e,t,n)=>{if(!t)return e;const r=Ir(n);return e.length>r?e.slice(0,r):e})(e,i,u),m=h(p),{stdioItems:f,objectMode:b}=t[n],g=os([m],f,c,r),{serializedResult:y,finalResult:w=y}=is({chunks:g,objectMode:b,encoding:c,lines:l,stripFinalNewline:d,fdNumber:n});ss({serializedResult:y,fdNumber:n,state:r,verboseInfo:s,encoding:c,stdioItems:f,objectMode:b});const v=a[n]?w:void 0;try{return void 0===r.error&&as(y,f,o),v}catch(e){return r.error=e,v}})({result:t,fileDescriptors:e,fdNumber:a,state:i,outputFiles:s,isMaxBuffer:r,verboseInfo:o},n))),...i}})({fileDescriptors:s,syncResult:c,options:n,isMaxBuffer:m,verboseInfo:i}),y=b.map(((e,t)=>li(e,n,t))),w=li((([,e,t],n)=>{if(n.all)return void 0===e?t:void 0===t?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,li(t,n,"all")]:Array.isArray(t)?[li(e,n,"all"),...t]:f(e)&&f(t)?x([e,t]):`${e}${t}`})(b,n),n,"all");return ws({error:g,exitCode:d,signal:u,timedOut:p,isMaxBuffer:m,stdio:y,all:w,options:n,command:r,escapedCommand:o,startTime:a})},gs=({file:e,commandArguments:t,options:n,command:r,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{((e,t)=>{for(const n of(e=>new Set(Object.entries(e).filter((([,{direction:e}])=>"input"===e)).map((([e])=>Number(e)))))(e))Xi(e,n,t)})(i,n);const r=ys(n);return(0,u.spawnSync)(e,t,r)}catch(e){return $r({error:e,command:r,escapedCommand:o,fileDescriptors:i,options:n,startTime:s,isSync:!0})}},ys=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:"buffer",maxBuffer:Ir(t)}),ws=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:o,stdio:i,all:s,options:a,command:c,escapedCommand:l,startTime:d})=>void 0===e?Cr({command:c,escapedCommand:l,stdio:i,all:s,ipcOutput:[],options:a,startTime:d}):Ar({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:i,all:s,ipcOutput:[],options:a,startTime:d,isSync:!0}),vs=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:o=!0,filter:i}={})=>(Dt({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:on(e)}),Ss({anyProcess:e,channel:t,isSubprocess:n,filter:i,reference:o})),Ss=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:o})=>{qt(t,o);const i=tn(e,t,n),s=new AbortController;try{return await Promise.race([xs(i,r,s),Es(i,n,s),Ts(i,n,s)])}catch(t){throw jt(e),t}finally{s.abort(),Xt(t,o)}},xs=async(e,t,{signal:n})=>{if(void 0===t){const[t]=await(0,St.once)(e,"message",{signal:n});return t}for await(const[r]of(0,St.on)(e,"message",{signal:n}))if(t(r))return r},Es=async(e,t,{signal:n})=>{await(0,St.once)(e,"disconnect",{signal:n}),(e=>{throw new Error(`${$t("getOneMessage",e)} could not complete: the ${Bt(e)} exited or disconnected.`)})(t)},Ts=async(e,t,{signal:n})=>{const[r]=await(0,St.once)(e,"strict:error",{signal:n});throw Mt(r,t)},Ds=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:o=!0}={})=>Is({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:o}),Is=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:o,reference:i})=>{Dt({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:on(e)}),qt(t,i);const s=tn(e,t,n),a=new AbortController,c={};return Os(e,s,a),Ms({ipcEmitter:s,isSubprocess:n,controller:a,state:c}),Ns({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:n,shouldAwait:o,controller:a,state:c,reference:i})},Os=async(e,t,n)=>{try{await(0,St.once)(t,"disconnect",{signal:n.signal}),n.abort()}catch{}},Ms=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{const[o]=await(0,St.once)(e,"strict:error",{signal:n.signal});r.error=Mt(o,t),n.abort()}catch{}},Ns=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:o,controller:i,state:s,reference:a}){try{for await(const[e]of(0,St.on)(n,"message",{signal:i.signal}))Cs(s),yield e}catch{Cs(s)}finally{i.abort(),Xt(t,a),r||jt(e),o&&await e}},Cs=({error:e})=>{if(e)throw e},$s=(e,t,n)=>({sendMessage:wn.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:vs.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:Ds.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),As=()=>{const e=new ui.PassThrough;return e.end(),e},Bs=()=>new ui.Readable({read(){}}),js=()=>new ui.Writable({write(){}}),Ps=()=>new ui.Duplex({read(){},write(){}}),ks=async(e,t,n)=>Ur(e,t,n),Rs=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${bo[e]}.`)},Ls={fileNumber:Rs,generator:Ki,asyncGenerator:Ki,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){const r=t||n;return{stream:ui.Duplex.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Us={input:{...Ls,fileUrl:({value:e})=>({stream:(0,zn.createReadStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,zn.createReadStream)(e)}),webStream:({value:e})=>({stream:ui.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:ui.Readable.from(e)}),asyncIterable:({value:e})=>({stream:ui.Readable.from(e)}),string:({value:e})=>({stream:ui.Readable.from(e)}),uint8Array:({value:e})=>({stream:ui.Readable.from(Ti.Buffer.from(e))})},output:{...Ls,fileUrl:({value:e})=>({stream:(0,zn.createWriteStream)(e)}),filePath:({value:{file:e,append:t}})=>({stream:(0,zn.createWriteStream)(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:ui.Writable.fromWeb(e)}),iterable:Rs,asyncIterable:Rs,string:Rs,uint8Array:Rs}},Fs=e(import.meta.url)("node:stream/promises");function Gs(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const t of e)Ks(t);const t=e.some((({readableObjectMode:e})=>e)),n=Ws(e,t),r=new _s({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(const t of e)r.add(t);return r}const Ws=(e,t)=>{if(0===e.length)return(0,ui.getDefaultHighWaterMark)(t);const n=e.filter((({readableObjectMode:e})=>e===t)).map((({readableHighWaterMark:e})=>e));return Math.max(...n)};class _s extends ui.PassThrough{#s=new Set([]);#a=new Set([]);#c=new Set([]);#l;#d=Symbol("unpipe");#u=new WeakMap;add(e){if(Ks(e),this.#s.has(e))return;this.#s.add(e),this.#l??=zs(this,this.#s,this.#d);const t=qs({passThroughStream:this,stream:e,streams:this.#s,ended:this.#a,aborted:this.#c,onFinished:this.#l,unpipeEvent:this.#d});this.#u.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Ks(e),!this.#s.has(e))return!1;const t=this.#u.get(e);return void 0!==t&&(this.#u.delete(e),e.unpipe(this),await t,!0)}}const zs=async(e,t,n)=>{oa(e,ia);const r=new AbortController;try{await Promise.race([Vs(e,r),Hs(e,t,n,r)])}finally{r.abort(),oa(e,-ia)}},Vs=async(e,{signal:t})=>{try{await(0,Fs.finished)(e,{signal:t,cleanup:!0})}catch(t){throw Zs(e,t),t}},Hs=async(e,t,n,{signal:r})=>{for await(const[o]of(0,St.on)(e,"unpipe",{signal:r}))t.has(o)&&o.emit(n)},Ks=e=>{if("function"!=typeof e?.pipe)throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},qs=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:o,onFinished:i,unpipeEvent:s})=>{oa(e,sa);const a=new AbortController;try{await Promise.race([Ys(i,t,a),Xs({passThroughStream:e,stream:t,streams:n,ended:r,aborted:o,controller:a}),Qs({stream:t,streams:n,ended:r,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),oa(e,-sa)}n.size>0&&n.size===r.size+o.size&&(0===r.size&&o.size>0?ta(e):Js(e))},Ys=async(e,t,{signal:n})=>{try{await e,n.aborted||ta(t)}catch(e){n.aborted||Zs(t,e)}},Xs=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:o,controller:{signal:i}})=>{try{await(0,Fs.finished)(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(i.aborted||!n.has(t))return;ea(r)?o.add(t):na(e,r)}},Qs=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:o,controller:{signal:i}})=>{if(await(0,St.once)(e,o,{signal:i}),!e.readable)return(0,St.once)(i,"abort",{signal:i});t.delete(e),n.delete(e),r.delete(e)},Js=e=>{e.writable&&e.end()},Zs=(e,t)=>{ea(t)?ta(e):na(e,t)},ea=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,ta=e=>{(e.readable||e.writable)&&e.destroy()},na=(e,t)=>{e.destroyed||(e.once("error",ra),e.destroy(t))},ra=()=>{},oa=(e,t)=>{const n=e.getMaxListeners();0!==n&&n!==Number.POSITIVE_INFINITY&&e.setMaxListeners(n+t)},ia=2,sa=1,aa=(e,t)=>{e.pipe(t),ca(e,t),da(e,t)},ca=async(e,t)=>{if(!B(e)&&!B(t)){try{await(0,Fs.finished)(e,{cleanup:!0,readable:!0,writable:!1})}catch{}la(t)}},la=e=>{e.writable&&e.end()},da=async(e,t)=>{if(!B(e)&&!B(t)){try{await(0,Fs.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}ua(e)}},ua=e=>{e.readable&&e.destroy()},pa=(e,t,n,r)=>{"output"===n?aa(e.stdio[r],t):aa(t,e.stdio[r]);const o=ma[r];void 0!==o&&(e[o]=t),e.stdio[r]=t},ma=["stdin","stdout","stderr"],fa=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:o,controller:i})=>{if(void 0===t)return;ha(t,i);const[s,a]="output"===n?[t,e.stdio[r]]:[e.stdio[r],t],c=o.get(s)??[];o.set(s,[...c,a])},ha=(e,{signal:t})=>{B(e)&&Kt(e,ba,t)},ba=2;var ga=r(7017);const ya=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(wa,e)(n,...r),pipeOptions:e};if("string"==typeof n||n instanceof URL||c(n)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[o,i,s]=d(n,...r);return{destination:t(wa)(o,i,s),pipeOptions:s}}if(Lt.has(n)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},wa=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),va=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>$r({error:e,command:Sa,escapedCommand:Sa,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Sa="source.pipe(destination)",xa=async e=>{const[{status:t,reason:n,value:r=n},{status:o,reason:i,value:s=i}]=await e;if(s.pipedFrom.includes(r)||s.pipedFrom.push(r),"rejected"===o)throw s;if("rejected"===t)throw r;return s},Ea=new WeakMap,Ta=(e,t)=>void 0===e?[]:[Da(e,t)],Da=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:o,startTime:i})=>{await(0,$.aborted)(e,t),await n.remove(t);const s=new Error("Pipe canceled by `unpipeSignal` option.");throw va({error:s,fileDescriptors:r,sourceOptions:o,startTime:i})},Ia=(e,...t)=>{if(o(t[0]))return Ia.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});const{destination:n,...r}=(({source:e,sourcePromise:t,boundOptions:n,createNested:r},...o)=>{const i=Re(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:d}=((e,t,n)=>{try{const{destination:r,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=ya(e,t,...n);return{destination:r,destinationStream:kt(r,i),from:o,unpipeSignal:s}}catch(e){return{destinationError:e}}})(n,r,o),{sourceStream:u,sourceError:p}=((e,t)=>{try{return{sourceStream:Rt(e,t)}}catch(e){return{sourceError:e}}})(e,l),{options:m,fileDescriptors:f}=Lt.get(e);return{sourcePromise:t,sourceStream:u,sourceOptions:m,sourceError:p,destination:s,destinationStream:a,destinationError:c,unpipeSignal:d,fileDescriptors:f,startTime:i}})(e,...t),i=Oa({...r,destination:n});return i.pipe=Ia.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},Oa=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:o,destinationStream:i,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{const d=Ma(e,o);(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:o,sourceOptions:i,startTime:s})=>{const a=(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>void 0!==t&&void 0!==r?r:void 0!==r?(ua(e),r):void 0!==t?(la(n),t):void 0)({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(void 0!==a)throw va({error:a,fileDescriptors:o,sourceOptions:i,startTime:s})})({sourceStream:t,sourceError:r,destinationStream:i,destinationError:s,fileDescriptors:c,sourceOptions:n,startTime:l});const u=new AbortController;try{const e=((e,t,n)=>{const r=Ea.has(t)?((e,t)=>{const n=Ea.get(t);return n.add(e),n})(e,t):((e,t)=>{const n=Gs([e]);return aa(n,t),Ea.set(t,n),n})(e,t);return Kt(e,2,n.signal),Kt(t,1,n.signal),(async e=>{try{await(0,Fs.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Ea.delete(e)})(t),r})(t,i,u);return await Promise.race([xa(d),...Ta(a,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{u.abort()}},Ma=(e,t)=>Promise.allSettled([e,t]),Na=e=>e,Ca=()=>{},$a=({contents:e})=>e,Aa=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Ba=e=>e.length,ja={init:()=>({contents:[]}),convertChunk:{string:Na,buffer:Na,arrayBuffer:Na,dataView:Na,typedArray:Na,others:Na},getSize:()=>1,truncateChunk:Ca,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:Ca,finalize:$a},Pa=new TextEncoder,ka=e=>new Uint8Array(e),Ra=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),La=e=>Ua**Math.ceil(Math.log(e)/Math.log(Ua)),Ua=2,Fa=()=>"resize"in ArrayBuffer.prototype,Ga={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>Pa.encode(e),buffer:ka,arrayBuffer:ka,dataView:Ra,typedArray:Ra,others:Aa},getSize:Ba,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:n},r)=>{const o=Fa()?((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;const n=new ArrayBuffer(t,{maxByteLength:La(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n})(t,r):((e,t)=>{if(t<=e.byteLength)return e;const n=new ArrayBuffer(La(t));return new Uint8Array(n).set(new Uint8Array(e),0),n})(t,r);return new Uint8Array(o).set(e,n),o},getFinalChunk:Ca,finalize:({contents:e,length:t})=>Fa()?e:e.slice(0,t)},Wa=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),_a={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:Na,buffer:Wa,arrayBuffer:Wa,dataView:Wa,typedArray:Wa,others:Aa},getSize:Ba,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{const t=e.decode();return""===t?void 0:t},finalize:$a},za=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:o,preserveNewlines:i})=>{const s=new AbortController;return Va(t,s),qa({stream:e,controller:s,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},Va=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Ha=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:o,allMixed:i})=>{const s=new AbortController;Ka(t,s,e);const a=e.readableObjectMode&&!i;return qa({stream:e,controller:s,binary:"buffer"===r,shouldEncode:!a,encoding:r,shouldSplit:!a&&n,preserveNewlines:!o})},Ka=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},qa=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s})=>{const a=(0,St.on)(e,"data",{signal:t.signal,highWaterMark:Xa,highWatermark:Xa});return Qa({onStdoutChunk:a,controller:t,binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s})},Ya=(0,ui.getDefaultHighWaterMark)(!0),Xa=Ya,Qa=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s}){const a=Ja({binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(const[t]of e)yield*_i(t,a,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*zi(a)}},Ja=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:o})=>[$i(e,n,!t),pi(e,o,!r,{})].filter(Boolean),Za=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:d})=>{const u=ec({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:a,verboseInfo:l,streamInfo:d});if(!o)return void await Promise.all([tc(e),u]);const p=di(c,n),m=Ha({stream:e,onStreamEnd:t,lines:s,encoding:r,stripFinalNewline:p,allMixed:a}),[f]=await Promise.all([nc({stream:e,iterable:m,fdNumber:n,encoding:r,maxBuffer:i,lines:s}),u]);return f},ec=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!Zi({stdioItems:s[n]?.stdioItems,encoding:r,verboseInfo:i,fdNumber:n}))return;const a=Ha({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:o});await(async(e,t,n,r)=>{for await(const o of e)ns(t)||rs(o,n,r)})(a,e,n,i)},tc=async e=>{await(0,Ve.setImmediate)(),null===e.readableFlowing&&e.resume()},nc=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:o,maxBuffer:i,lines:s})=>{try{return t||s?await async function(e,t){return yr(e,ja,t)}(n,{maxBuffer:i}):"buffer"===o?new Uint8Array(await async function(e,t){return yr(e,Ga,t)}(n,{maxBuffer:i})):await async function(e,t){return yr(e,_a,t)}(n,{maxBuffer:i})}catch(n){return oc((({error:e,stream:t,readableObjectMode:n,lines:r,encoding:o,fdNumber:i})=>{if(!(e instanceof Tr))throw e;if("all"===i)return e;const s=((e,t,n)=>e?"objects":t?"lines":"buffer"===n?"bytes":"characters")(n,r,o);throw e.maxBufferInfo={fdNumber:i,unit:s},t.destroy(),e})({error:n,stream:e,readableObjectMode:t,lines:s,encoding:o,fdNumber:r}))}},rc=async e=>{try{return await e}catch(e){return oc(e)}},oc=({bufferedData:e})=>{return t=e,"[object ArrayBuffer]"===m.call(t)?new Uint8Array(e):e;var t},ic=async(e,t,n,{isSameDirection:r,stopOnExit:o=!1}={})=>{const i=sc(e,n),s=new AbortController;try{await Promise.race([...o?[n.exitPromise]:[],(0,Fs.finished)(e,{cleanup:!0,signal:s.signal})])}catch(e){i.stdinCleanedUp||lc(e,t,n,r)}finally{s.abort()}},sc=(e,{originalStreams:[t],subprocess:n})=>{const r={stdinCleanedUp:!1};return e===t&&ac(e,n,r),r},ac=(e,t,n)=>{const{_destroy:r}=e;e._destroy=(...o)=>{cc(t,n),r.call(e,...o)}},cc=({exitCode:e,signalCode:t},n)=>{null===e&&null===t||(n.stdinCleanedUp=!0)},lc=(e,t,n,r)=>{if(!dc(e,t,n,r))throw e},dc=(e,t,n,r=!0)=>n.propagating?mc(e)||pc(e):(n.propagating=!0,uc(n,t)===r?mc(e):pc(e)),uc=({fileDescriptors:e},t)=>"all"!==t&&"input"===e[t].direction,pc=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,mc=e=>"EPIPE"===e?.code,fc=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!e)return;const d=ic(e,t,l);if(uc(l,t))return void await d;const[u]=await Promise.all([Za({stream:e,onStreamEnd:d,fdNumber:t,encoding:n,buffer:r,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),d]);return u},hc=({stdout:e,stderr:t,all:n},[,r,o])=>{const i=r||o;return i?r?o?{stream:n,buffer:i}:{stream:e,buffer:i}:{stream:t,buffer:i}:{stream:n,buffer:i}},bc=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,gc=(e,t)=>{const n=Be(e);Ne({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:t})},yc=async(e,t)=>(await Promise.allSettled([e]),t),wc=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:o,timeoutDuration:i,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:d,ipcInput:u},context:p,verboseInfo:m,fileDescriptors:f,originalStreams:h,onInternalError:b,controller:g})=>{const y=(async(e,t)=>{const[n,r]=await(async e=>{const[t,n]=await Promise.allSettled([(0,St.once)(e,"spawn"),(0,St.once)(e,"exit")]);return"rejected"===t.status?[]:"rejected"===n.status?cs(e):n.value})(e);return t.isForcefullyTerminated??=!1,[n,r]})(e,p),w={originalStreams:h,fileDescriptors:f,subprocess:e,exitPromise:y,propagating:!1},v=(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>e.stdio.map(((e,c)=>fc({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:o[c],allMixed:!1,stripFinalNewline:i,verboseInfo:s,streamInfo:a}))))({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:o,stripFinalNewline:l,verboseInfo:m,streamInfo:w}),S=(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>fc({...hc(e,n),fdNumber:"all",encoding:t,maxBuffer:r[1]+r[2],lines:o[1]||o[2],allMixed:bc(e),stripFinalNewline:i,verboseInfo:s,streamInfo:a}))({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:o,stripFinalNewline:l,verboseInfo:m,streamInfo:w}),x=[],E=(async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:o,verboseInfo:i})=>{if(!r)return o;const s=(e=>Q(e,"ipc"))(i),a=Y(t,"ipc"),c=Y(n,"ipc");for await(const t of Is({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))a&&(Dr(0,o,c),o.push(t)),s&&gc(t,i);return o})({subprocess:e,buffer:n,maxBuffer:r,ipc:d,ipcOutput:x,verboseInfo:m}),T=vc(h,e,w),D=Sc(f,w);try{return await Promise.race([Promise.all([{},ls(y),Promise.all(v),S,E,Ln(e,u),...T,...D]),b,xc(e,g),...jn(e,i,p,g),...Et({subprocess:e,cancelSignal:s,gracefulCancel:a,context:p,controller:g}),...$n({subprocess:e,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:p,controller:g})])}catch(e){return p.terminationReason??="other",Promise.all([{error:e},y,Promise.all(v.map((e=>rc(e)))),rc(S),yc(E,x),Promise.allSettled(T),Promise.allSettled(D)])}},vc=(e,t,n)=>e.map(((e,r)=>e===t.stdio[r]?void 0:ic(e,r,n))),Sc=(e,t)=>e.flatMap((({stdioItems:e},n)=>e.filter((({value:e,stream:t=e})=>nr(t,{checkOpen:!1})&&!B(t))).map((({type:e,value:r,stream:o=r})=>ic(o,n,t,{isSameDirection:uo.has(e),stopOnExit:"native"===e}))))),xc=async(e,{signal:t})=>{const[n]=await(0,St.once)(e,"error",{signal:t});throw n},Ec=(e,t,n)=>{const r=e[n];r.has(t)||r.set(t,[]);const o=r.get(t),i=Pt();return o.push(i),{resolve:i.resolve.bind(i),promises:o}},Tc=async({resolve:e,promises:t},n)=>{e();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},Dc=async e=>{if(void 0!==e)try{await Ic(e)}catch{}},Ic=async e=>{await(0,Fs.finished)(e,{cleanup:!0,readable:!1,writable:!0})},Oc=async e=>{await(0,Fs.finished)(e,{cleanup:!0,readable:!0,writable:!1})},Mc=async(e,t)=>{if(await e,t)throw t},Nc=(e,t,n)=>{n&&!pc(n)?e.destroy(n):t&&e.destroy()},Cc=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:o=!0,preserveNewlines:i=!0}={})=>{const s=o||Fn.has(n),{subprocessStdout:a,waitReadableDestroy:c}=$c(e,r,t),{readableEncoding:l,readableObjectMode:d,readableHighWaterMark:u}=Ac(a,s),{read:p,onStdoutDataDone:m}=Bc({subprocessStdout:a,subprocess:e,binary:s,encoding:n,preserveNewlines:i}),f=new ui.Readable({read:p,destroy:(0,$.callbackify)(kc.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:u,objectMode:d,encoding:l});return Pc({subprocessStdout:a,onStdoutDataDone:m,readable:f,subprocess:e}),f},$c=(e,t,n)=>{const r=Rt(e,t);return{subprocessStdout:r,waitReadableDestroy:Ec(n,r,"readableDestroy")}},Ac=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Ya},Bc=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:o})=>{const i=Pt(),s=za({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:o});return{read(){jc(this,s,i)},onStdoutDataDone:i}},jc=async(e,t,n)=>{try{const{value:r,done:o}=await t.next();o?n.resolve():e.push(r)}catch{}},Pc=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:o})=>{try{await Oc(e),await r,await Dc(o),await t,n.readable&&n.push(null)}catch(e){await Dc(o),Rc(n,e)}},kc=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Tc(n,t)&&(Rc(e,r),await Mc(t,r))},Rc=(e,t)=>{Nc(e,e.readable,t)},Lc=({subprocess:e,concurrentStreams:t},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:o,waitWritableDestroy:i}=Uc(e,n,t),s=new ui.Writable({...Fc(r,e,o),destroy:(0,$.callbackify)(zc.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return _c(r,s),s},Uc=(e,t,n)=>{const r=kt(e,t);return{subprocessStdin:r,waitWritableFinal:Ec(n,r,"writableFinal"),waitWritableDestroy:Ec(n,r,"writableDestroy")}},Fc=(e,t,n)=>({write:Gc.bind(void 0,e),final:(0,$.callbackify)(Wc.bind(void 0,e,t,n))}),Gc=(e,t,n,r)=>{e.write(t,n)?r():e.once("drain",r)},Wc=async(e,t,n)=>{await Tc(n,t)&&(e.writable&&e.end(),await t)},_c=async(e,t,n)=>{try{await Ic(e),t.writable&&t.end()}catch(e){await(async e=>{if(void 0!==e)try{await Oc(e)}catch{}})(n),Vc(t,e)}},zc=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},o)=>{await Tc(n,t),await Tc(r,t)&&(Vc(e,o),await Mc(t,o))},Vc=(e,t)=>{Nc(e,e.writable,t)},Hc=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||Fn.has(n),{subprocessStdout:c,waitReadableDestroy:l}=$c(e,r,t),{subprocessStdin:d,waitWritableFinal:u,waitWritableDestroy:p}=Uc(e,o,t),{readableEncoding:m,readableObjectMode:f,readableHighWaterMark:h}=Ac(c,a),{read:b,onStdoutDataDone:g}=Bc({subprocessStdout:c,subprocess:e,binary:a,encoding:n,preserveNewlines:s}),y=new ui.Duplex({read:b,...Fc(d,e,u),destroy:(0,$.callbackify)(Kc.bind(void 0,{subprocessStdout:c,subprocessStdin:d,subprocess:e,waitReadableDestroy:l,waitWritableFinal:u,waitWritableDestroy:p})),readableHighWaterMark:h,writableHighWaterMark:d.writableHighWaterMark,readableObjectMode:f,writableObjectMode:d.writableObjectMode,encoding:m});return Pc({subprocessStdout:c,onStdoutDataDone:g,readable:y,subprocess:e,subprocessStdin:d}),_c(d,y,c),y},Kc=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([kc({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},s),zc({subprocessStdin:t,subprocess:n,waitWritableFinal:o,waitWritableDestroy:i},s)])},qc=(e,t,{from:n,binary:r=!1,preserveNewlines:o=!1}={})=>{const i=r||Fn.has(t),s=Rt(e,n),a=za({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return Yc(a,s,e)},Yc=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},Xc=(e,{encoding:t})=>{const n={readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap};e.readable=Cc.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=Lc.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=Hc.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=qc.bind(void 0,e,t),e[Symbol.asyncIterator]=qc.bind(void 0,e,t,{})},Qc=(async()=>{})().constructor.prototype,Jc=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(Qc,e)])),Zc=(e,t,n)=>{const{command:r,escapedCommand:o,startTime:i,verboseInfo:s}=Ue(e,t,n),{file:a,commandArguments:c,options:l}=Hn(e,t,n),d=el(l),u=((e,t)=>Vo(Us,e,t,!1))(d,s);return{file:a,commandArguments:c,command:r,escapedCommand:o,startTime:i,verboseInfo:s,options:d,fileDescriptors:u}},el=({timeout:e,signal:t,...n})=>{if(void 0!==t)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:e}},tl=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=(0,u.spawn)(e,t,n)}catch(e){return(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:o,startTime:i,verboseInfo:s})=>{ri(r);const a=new u.ChildProcess;((e,t)=>{const n=As(),r=As(),o=As(),i=Array.from({length:t.length-3},As),s=As(),a=[n,r,o,...i];Object.assign(e,{stdin:n,stdout:r,stderr:o,all:s,stdio:a})})(a,r),Object.assign(a,{readable:Bs,writable:js,duplex:Ps});const c=$r({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:o,startTime:i,isSync:!1});return{subprocess:a,promise:ks(c,s,o)}})({error:e,command:i,escapedCommand:s,fileDescriptors:a,options:n,startTime:r,verboseInfo:o})}const l=new AbortController;(0,St.setMaxListeners)(Number.POSITIVE_INFINITY,l.signal);const d=[...c.stdio];((e,t,n)=>{const r=new Map;for(const[o,{stdioItems:i,direction:s}]of Object.entries(t)){for(const{stream:t}of i.filter((({type:e})=>uo.has(e))))pa(e,t,s,o);for(const{stream:t}of i.filter((({type:e})=>!uo.has(e))))fa({subprocess:e,stream:t,direction:s,fdNumber:o,pipeGroups:r,controller:n})}for(const[e,t]of r.entries()){const n=1===t.length?t[0]:Gs(t);aa(n,e)}})(c,a,l),((e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;const o=(0,ga.cf)((()=>{e.kill()}));(0,St.addAbortListener)(r,(()=>{o()}))})(c,n,l);const p={},m=Pt();return c.kill=bt.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:m,context:p,controller:l}),c.all=(({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Gs([e,t].filter(Boolean)):void 0)(c,n),Xc(c,n),((e,{ipc:t})=>{Object.assign(e,$s(e,!1,t))})(c,n),{subprocess:c,promise:nl({subprocess:c,options:n,startTime:r,verboseInfo:o,fileDescriptors:a,originalStreams:d,command:i,escapedCommand:s,context:p,onInternalError:m,controller:l})}},nl=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:o,originalStreams:i,command:s,escapedCommand:a,context:c,onInternalError:l,controller:d})=>{const[u,[p,m],f,h,b]=await wc({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:o,originalStreams:i,onInternalError:l,controller:d});d.abort(),l.resolve();const g=f.map(((e,n)=>li(e,t,n))),y=li(h,t,"all"),w=rl({errorInfo:u,exitCode:p,signal:m,stdio:g,all:y,ipcOutput:b,context:c,options:t,command:s,escapedCommand:a,startTime:n});return Ur(w,r,t)},rl=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:o,ipcOutput:i,context:s,options:a,command:c,escapedCommand:l,startTime:d})=>"error"in e?Ar({error:e.error,command:c,escapedCommand:l,timedOut:"timeout"===s.terminationReason,isCanceled:"cancel"===s.terminationReason||"gracefulCancel"===s.terminationReason,isGracefullyCanceled:"gracefulCancel"===s.terminationReason,isMaxBuffer:e.error instanceof Tr,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:o,ipcOutput:i,options:a,startTime:d,isSync:!1}):Cr({command:c,escapedCommand:l,stdio:r,all:o,ipcOutput:i,options:a,startTime:d}),ol=(e,t)=>{const n=Object.fromEntries(Object.entries(t).map((([t,n])=>[t,il(t,e[t],n)])));return{...e,...n}},il=(e,t,n)=>sl.has(e)&&o(t)&&o(n)?{...t,...n}:n,sl=new Set(["env",...q]),al=(e,t,n,r)=>{const o=(e,t,r)=>al(e,t,n,r),i=(...i)=>cl({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:o},...i);return void 0!==r&&r(i,o,t),i},cl=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...a)=>{if(o(s))return i(e,ol(n,s),r);const{file:c,commandArguments:l,options:d,isSync:u}=ll({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:n});return u?((e,t,n)=>{const{file:r,commandArguments:o,command:i,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:d}=((e,t,n)=>{const{command:r,escapedCommand:o,startTime:i,verboseInfo:s}=Ue(e,t,n),a=ms(n),{file:c,commandArguments:l,options:d}=Hn(e,t,a);fs(d);const u=((e,t)=>Vo(ci,e,t,!0))(d,s);return{file:c,commandArguments:l,command:r,escapedCommand:o,startTime:i,verboseInfo:s,options:d,fileDescriptors:u}})(e,t,n),u=bs({file:r,commandArguments:o,options:l,command:i,escapedCommand:s,verboseInfo:c,fileDescriptors:d,startTime:a});return Ur(u,c,l)})(c,l,d):((e,t,n,r)=>{const{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:d,fileDescriptors:u}=Zc(e,t,n),{subprocess:p,promise:m}=tl({file:o,commandArguments:i,options:d,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:u});return p.pipe=Ia.bind(void 0,{source:p,sourcePromise:m,boundOptions:{},createNested:r}),((e,t)=>{for(const[n,r]of Jc){const o=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:o})}})(p,m),Lt.set(p,{options:d,fileDescriptors:u}),p})(c,l,d,i)},ll=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:o})=>{const i=(s=t,Array.isArray(s)&&Array.isArray(s.raw)?((e,t)=>{let n=[];for(const[r,o]of e.entries())n=T({templates:e,expressions:t,tokens:n,index:r,template:o});if(0===n.length)throw new TypeError("Template script must not be empty");const[r,...o]=n;return[r,o,{}]})(t,n):[t,...n]);var s;const[a,c,l]=d(...i),u=ol(ol(r,o),l),{file:p=a,commandArguments:m=c,options:f=u,isSync:h=!1}=e({file:a,commandArguments:c,options:u});return{file:p,commandArguments:m,options:f,isSync:h}},dl=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);const[n,...r]=ul(e);return{file:n,commandArguments:r}},ul=e=>{if("string"!=typeof e)throw new TypeError(`The command must be a string: ${String(e)}.`);const t=e.trim();if(""===t)return[];const n=[];for(const e of t.split(pl)){const t=n.at(-1);t&&t.endsWith("\\")?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},pl=/ +/g,ml=({options:e})=>({...fl(e),isSync:!0}),fl=e=>({options:{...hl(e),...e}}),hl=({input:e,inputFile:t,stdio:n})=>void 0===e&&void 0===t&&void 0===n?{stdin:"inherit"}:{},bl=al((()=>({}))),gl=al((()=>({isSync:!0}))),{sendMessage:yl,getOneMessage:wl,getEachMessage:vl,getCancelSignal:Sl}=(al((({file:e,commandArguments:t})=>dl(e,t))),al((({file:e,commandArguments:t})=>({...dl(e,t),isSync:!0}))),al((({options:e})=>{if(!1===e.node)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}})),al((({options:e})=>fl(e)),{},{preferLocal:!0},((e,t,n)=>{e.sync=t(ml,n),e.s=e.sync})),(()=>{const e=A,t=!0,n=void 0!==A.channel;return{...$s(e,t,n),getCancelSignal:Tn.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}})())},7235:(e,t,n)=>{function r(e={}){const{env:t=process.env,platform:n=process.platform}=e;return"win32"!==n?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"}n.d(t,{A:()=>r})},7017:(e,t,n)=>{n.d(t,{cf:()=>u});const r=[];r.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&r.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&r.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const o=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,i=Symbol.for("signal-exit emitter"),s=globalThis,a=Object.defineProperty.bind(Object);class c{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(s[i])return s[i];a(s,i,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const n=this.listeners[e],r=n.indexOf(t);-1!==r&&(0===r&&1===n.length?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(const o of this.listeners[e])r=!0===o(t,n)||r;return"exit"===e&&(r=this.emit("afterExit",t,n)||r),r}}class l{}const d=globalThis.process,{onExit:u,load:p,unload:m}=(f=o(d)?new class extends l{#p="win32"===d.platform?"SIGINT":"SIGHUP";#m=new c;#f;#h;#b;#g={};#y=!1;constructor(e){super(),this.#f=e,this.#g={};for(const t of r)this.#g[t]=()=>{const n=this.#f.listeners(t);let{count:r}=this.#m;const o=e;if("object"==typeof o.__signal_exit_emitter__&&"number"==typeof o.__signal_exit_emitter__.count&&(r+=o.__signal_exit_emitter__.count),n.length===r){this.unload();const n=this.#m.emit("exit",null,t),r="SIGHUP"===t?this.#p:t;n||e.kill(e.pid,r)}};this.#b=e.reallyExit,this.#h=e.emit}onExit(e,t){if(!o(this.#f))return()=>{};!1===this.#y&&this.load();const n=t?.alwaysLast?"afterExit":"exit";return this.#m.on(n,e),()=>{this.#m.removeListener(n,e),0===this.#m.listeners.exit.length&&0===this.#m.listeners.afterExit.length&&this.unload()}}load(){if(!this.#y){this.#y=!0,this.#m.count+=1;for(const e of r)try{const t=this.#g[e];t&&this.#f.on(e,t)}catch(e){}this.#f.emit=(e,...t)=>this.#w(e,...t),this.#f.reallyExit=e=>this.#v(e)}}unload(){this.#y&&(this.#y=!1,r.forEach((e=>{const t=this.#g[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#f.removeListener(e,t)}catch(e){}})),this.#f.emit=this.#h,this.#f.reallyExit=this.#b,this.#m.count-=1)}#v(e){return o(this.#f)?(this.#f.exitCode=e||0,this.#m.emit("exit",this.#f.exitCode,null),this.#b.call(this.#f,this.#f.exitCode)):0}#w(e,...t){const n=this.#h;if("exit"===e&&o(this.#f)){"number"==typeof t[0]&&(this.#f.exitCode=t[0]);const r=n.call(this.#f,e,...t);return this.#m.emit("exit",this.#f.exitCode,null),r}return n.call(this.#f,e,...t)}}(d):new class extends l{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>f.onExit(e,t),load:()=>f.load(),unload:()=>f.unload()});var f},3938:(e,t,n)=>{n.r(t),n.d(t,{builder:()=>a,command:()=>o,description:()=>i});var r=n(2283);const o="git",i="",s=process.cwd();function a(e){e.command("hooks","Set .githooks as git.hooksPath",{},(()=>{(function(){try{return function(){try{return Boolean((0,r.Kc)("git",["--version"],{cwd:s}).stdout)}catch{throw new Error("git is not installed")}}()&&function(){try{return"true"===(0,r.Kc)("git",["rev-parse","--is-inside-work-tree"],{cwd:s}).stdout}catch{throw new Error("not a git repository")}}()}catch(e){return console.error("Fail:",e.message),!1}})()&&(0,r.Ho)("git",["config","core.hooksPath",".githooks"],{cwd:s}).then((()=>{console.log("Done: set .githooks")})).catch((()=>{console.error("Fail:","setting hooks failed"),process.exitCode=1}))})),e.demandCommand(1,"Typing `hooks`")}}};import t from"../runtime.mjs";import*as n from"./git.mjs";t.C(n);var r=t(t.s=3938),o=r.builder,i=r.command,s=r.description;export{o as builder,i as command,s as description};
|