@nice-move/cli 0.11.14 → 0.11.15
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/145.mjs +1 -1
- package/dist/190.mjs +1 -0
- package/dist/216.mjs +1 -1
- package/dist/441.mjs +1 -1
- package/dist/564.mjs +1 -0
- package/dist/744.mjs +1 -0
- package/dist/782.mjs +1 -1
- package/dist/799.mjs +1 -0
- package/dist/849.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/cmd/git.mjs +1 -1
- package/dist/cmd/lint.mjs +1 -1
- package/package.json +6 -6
- package/dist/151.mjs +0 -1
- package/dist/176.mjs +0 -1
- package/dist/762.mjs +0 -1
- package/dist/992.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,n)=>{const r=n(5317),o=n(4705),i=n(2369);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},2369: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}},4705:(e,t,n)=>{const r=n(6928),o=n(6694),i=n(1192),s=n(3179),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function d(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}e.exports=function(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null);const r={command:e,args:t=t?t.slice(0):[],options:n=Object.assign({},n),file:void 0,original:{command:e,args:t}};return n.shell?r:d(r)}},1192:e=>{const t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e=e.replace(t,"^$1")},e.exports.argument=function(e,n){return e=(e=`"${e=(e=(e=`${e}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(t,"^$1"),n&&(e=e.replace(t,"^$1")),e}},3179:(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())}},6694:(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;n(9896);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)}))}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),l=parseInt("001",8),d=a|c;return n&l||n&c&&o===s||n&a&&r===i||n&d&&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")},9507:(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:()=>nd,Kc:()=>rd});var i=r(3136);const s=(e,t)=>{const n=a(e);if("string"!=typeof n)throw new TypeError(`${t} must be a string or a file URL: ${n}.`);return n},a=e=>e instanceof URL?(0,i.fileURLToPath)(e):e,c=(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 l=r(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,t)=>{if("utf8"===t&&e.every((e=>"string"==typeof e)))return e;const n=new d.StringDecoder(t),r=e.map((e=>"string"==typeof e?h(e):e)).map((e=>n.write(e))),o=n.end();return""===o?r:[...r,o]},w=e=>1===e.length&&p(e[0])?e[0]:S(v(e)),v=e=>e.map((e=>"string"==typeof e?h(e):e)),S=e=>{const t=new Uint8Array(x(e));let n=0;for(const r of e)t.set(r,n),n+=r.length;return t},x=e=>{let t=0;for(const n of e)t+=n.length;return t},E=({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}=T(o,e.raw[r]),c=O(n,i,s);if(r===t.length)return c;const l=t[r],d=Array.isArray(l)?l.map((e=>M(e))):[M(l)];return O(c,d,a)},T=(e,t)=>{if(0===t.length)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const o=D.has(t[0]);for(let o=0,i=0;o<e.length;o+=1,i+=1){const s=t[i];if(D.has(s))r!==o&&n.push(e.slice(r,o)),r=o+1;else if("\\"===s){const e=t[i+1];"u"===e&&"{"===t[i+2]?i=t.indexOf("}",i+3):i+=I[e]??1}}const i=r===e.length;return i||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:o,trailingWhitespaces:i}},D=new Set([" ","\t","\r","\n"]),I={x:3,u:5},O=(e,t,n)=>n||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],M=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 N(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`)},N=({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 C=r(7975),$=r(1708);const B=e=>A.includes(e),A=[$.stdin,$.stdout,$.stderr],j=["stdin","stdout","stderr"],P=e=>j[e]??`stdio[${e}]`,R=(e,t)=>{const n=Array.from({length:k(e)+1}),r=L(e[t],n,t);return V(r,t)},k=({stdio:e})=>Array.isArray(e)?Math.max(e.length,j.length):j.length,L=(e,t,n)=>o(e)?U(e,t,n):t.fill(e),U=(e,t,n)=>{for(const r of Object.keys(e).sort(F))for(const o of W(r,n,t))t[o]=e[r];return t},F=(e,t)=>G(e)<G(t)?1:-1,G=e=>"stdout"===e||"stderr"===e?0:"all"===e?2:1,W=(e,t,n)=>{if("ipc"===e)return[n.length-1];const r=_(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]},_=e=>{if("all"===e)return e;if(j.includes(e))return j.indexOf(e);const t=z.exec(e);return null!==t?Number(t[1]):void 0},z=/^fd(\d+)$/,V=(e,t)=>e.map((e=>void 0===e?H[t]:e)),H={lines:!1,buffer:!0,maxBuffer:1e8,verbose:(0,C.debuglog)("execa").enabled?"full":"none",stripFinalNewline:!0},K=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],q=(e,t)=>"ipc"===t?e.at(-1):e[t],Y=({verbose:e},t)=>"none"!==Q(e,t),X=({verbose:e},t)=>!["none","short"].includes(Q(e,t)),Q=(e,t)=>void 0===t?J(e):q(e,t),J=e=>e.find((e=>Z(e)))??ee.findLast((t=>e.includes(t))),Z=e=>"function"==typeof e,ee=["none","short","full"];var te=r(3024);const ne=e=>(0,C.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=/\p{Separator}|\p{Other}/gu,se={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},ae=65535,ce=e=>le.test(e)?e:"win32"===$.platform?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,le=/^[\w./-]+$/;const de={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"},ue={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"},pe={...de,...ue},me={...de,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"},fe="win32"!==$.platform?"linux"!==$.env.TERM:Boolean($.env.WT_SESSION)||Boolean($.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===$.env.ConEmuTask||"Terminus-Sublime"===$.env.TERM_PROGRAM||"vscode"===$.env.TERM_PROGRAM||"xterm-256color"===$.env.TERM||"alacritty"===$.env.TERM||"JetBrains-JediTerm"===$.env.TERMINAL_EMULATOR,he=fe?pe:me;Object.entries(ue);var be=r(7066);const ge=be?.WriteStream?.prototype?.hasColors?.()??!1,ye=(e,t)=>{if(!ge)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}},we=(ye(0,0),ye(1,22)),ve=(ye(2,22),ye(3,23),ye(4,24),ye(53,55),ye(7,27),ye(8,28),ye(9,29),ye(30,39),ye(31,39),ye(32,39),ye(33,39),ye(34,39),ye(35,39),ye(36,39),ye(37,39),ye(90,39)),Se=(ye(40,49),ye(41,49),ye(42,49),ye(43,49),ye(44,49),ye(45,49),ye(46,49),ye(47,49),ye(100,49),ye(91,39)),xe=(ye(92,39),ye(93,39)),Ee=(ye(94,39),ye(95,39),ye(96,39),ye(97,39),ye(101,49),ye(102,49),ye(103,49),ye(104,49),ye(105,49),ye(106,49),ye(107,49),e=>`${Te(e.getHours(),2)}:${Te(e.getMinutes(),2)}:${Te(e.getSeconds(),2)}.${Te(e.getMilliseconds(),3)}`),Te=(e,t)=>String(e).padStart(t,"0"),De=({failed:e,reject:t})=>e?t?he.cross:he.warning:he.tick,Ie={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:De,duration:De},Oe=e=>e,Me={command:()=>we,output:()=>Oe,ipc:()=>Oe,error:({reject:e})=>e?Se:xe,duration:()=>ve},Ne=(e,t,n)=>{const r=(({verbose:e},t)=>{const n=Q(e,t);return Z(n)?n:void 0})(t,n);return e.map((({verboseLine:e,verboseObject:t})=>Ce(e,t,r))).filter((e=>void 0!==e)).map((e=>$e(e))).join("")},Ce=(e,t,n)=>{if(void 0===n)return e;const r=n(e,t);return"string"==typeof r?r:void 0},$e=e=>e.endsWith("\n")?e:`${e}\n`,Be=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:o})=>{const i=Ae({type:e,result:o,verboseInfo:r}),s=je(t,i),a=Ne(s,r,n);(0,te.writeFileSync)(Re,a)},Ae=({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}),je=(e,t)=>e.split("\n").map((e=>Pe({...t,message:e}))),Pe=e=>({verboseLine:(({type:e,message:t,timestamp:n,piped:r,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{const a=Ee(n),c=Ie[e]({failed:i,reject:s,piped:r}),l=Me[e]({reject:s});return`${ve(`[${a}]`)} ${ve(`[${o}]`)} ${l(c)} ${l(t)}`})(e),verboseObject:e}),Re=2,ke=e=>{const t="string"==typeof e?e:(0,C.inspect)(e);return ne(t).replaceAll("\t"," ".repeat(Le))},Le=2,Ue=e=>Y({verbose:e})?Fe++:void 0;let Fe=0n;const Ge=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(!ee.includes(t)&&!Z(t)){const e=ee.map((e=>`'${e}'`)).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},We=()=>$.hrtime.bigint(),_e=e=>Number($.hrtime.bigint()-e)/1e6,ze=(e,t,n)=>{const r=We(),{command:o,escapedCommand:i}=((e,t)=>{const n=[e,...t];return{command:n.join(" "),escapedCommand:n.map((e=>ce(re(e)))).join(" ")}})(e,t),s=((e,t,n)=>(Ge(e),{verbose:e,escapedCommand:t,commandId:Ue(e),rawOptions:n}))(R(n,"verbose"),i,{...n});return((e,t)=>{Y(t)&&Be({type:"command",verboseMessage:e,verboseInfo:t})})(i,s),{command:o,escapedCommand:i,startTime:r,verboseInfo:s}};var Ve=r(6760),He=r(526),Ke=r(5190),qe=r(8500);class Ye extends Error{}const Xe=(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"),Je=e=>"[object Error]"===Object.prototype.toString.call(e);class Ze extends Error{}Xe(Ze,Ze.name);class et extends Error{}Xe(et,et.name);var tt=r(8161);const nt=(e,t)=>({name:`SIGRT${t+1}`,number:rt+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),rt=34,ot=64,it=[{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"}],st=()=>{const e=(()=>{const e=ot-rt+1;return Array.from({length:e},nt)})();return[...it,...e].map(at)},at=({name:e,number:t,description:n,action:r,forced:o=!1,standard:i})=>{const{signals:{[e]:s}}=tt.constants,a=void 0!==s;return{name:e,number:a?s:t,description:n,supported:a,action:r,forced:o,standard:i}},ct=({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}],lt=(()=>{const e=st();return Object.fromEntries(e.map(ct))})(),dt=(e,t)=>{const n=ut(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}}},ut=(e,t)=>{const n=t.find((({name:t})=>tt.constants.signals[t]===e));return void 0!==n?n:t.find((t=>t.number===e))},pt=((()=>{const e=st(),t=ot+1,n=Array.from({length:t},((t,n)=>dt(n,e)));Object.assign({},...n)})(),e=>0===e?e:mt(e,"`subprocess.kill()`'s argument")),mt=(e,t)=>{if(Number.isInteger(e))return ft(e,t);if("string"==typeof e)return bt(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${gt()}`)},ft=(e,t)=>{if(ht.has(e))return ht.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${gt()}`)},ht=new Map(Object.entries(tt.constants.signals).reverse().map((([e,t])=>[t,e]))),bt=(e,t)=>{if(e in tt.constants.signals)return e;if(e.toUpperCase()in tt.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${gt()}`)},gt=()=>`Available signal names: ${yt()}.\nAvailable signal numbers: ${wt()}.`,yt=()=>Object.keys(tt.constants.signals).sort().map((e=>`'${e}'`)).join(", "),wt=()=>[...new Set(Object.values(tt.constants.signals).sort(((e,t)=>e-t)))].join(", "),vt=e=>lt[e].description,St=5e3,xt=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:o,controller:i},s,a)=>{const{signal:c,error:l}=Et(s,a,n);Tt(l,r);const d=e(c);return Dt({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:d,context:o,controller:i}),d},Et=(e,t,n)=>{const[r=n,o]=Je(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&&!Je(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:pt(r),error:o}},Tt=(e,t)=>{void 0!==e&&t.reject(e)},Dt=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:o,context:i,controller:s})=>{t===r&&o&&It({kill:e,forceKillAfterDelay:n,context:i,controllerSignal:s.signal})},It=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(!1!==t)try{await(0,qe.setTimeout)(t,void 0,{signal:r}),e("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},Ot=e(import.meta.url)("node:events"),Mt=async(e,t)=>{e.aborted||await(0,Ot.once)(e,"abort",{signal:t})},Nt=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:o})=>void 0===t||n?[]:[Ct(e,t,r,o)],Ct=async(e,t,n,{signal:r})=>{throw await Mt(t,r),n.terminationReason??="cancel",e.kill(),t.reason},$t=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{Bt(e,t,n),At(e,t,r)},Bt=(e,t,n)=>{if(!n)throw new Error(`${Lt(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},At=(e,t,n)=>{if(!n)throw new Error(`${Lt(e,t)} cannot be used: the ${Ft(t)} has already exited or disconnected.`)},jt=(e,t)=>new Error(`${Lt("sendMessage",t)} failed when sending an acknowledgment response to the ${Ft(t)}.`,{cause:e}),Pt=({code:e,message:t})=>Rt.has(e)||kt.some((e=>t.includes(e))),Rt=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),kt=["could not be cloned","circular structure","call stack size exceeded"],Lt=(e,t,n="")=>"cancelSignal"===e?"`cancelSignal`'s `controller.abort()`":`${Ut(t)}${e}(${n})`,Ut=e=>e?"":"subprocess.",Ft=e=>e?"parent process":"subprocess",Gt=e=>{e.connected&&e.disconnect()},Wt=()=>{const e={},t=new Promise(((t,n)=>{Object.assign(e,{resolve:t,reject:n})}));return Object.assign(t,e)},_t=(e,t="stdin")=>{const n=!0,{options:r,fileDescriptors:o}=Vt.get(e),i=Ht(o,t,n),s=e.stdio[i];if(null===s)throw new TypeError(Yt(i,t,r,n));return s},zt=(e,t="stdout")=>{const n=!1,{options:r,fileDescriptors:o}=Vt.get(e),i=Ht(o,t,n),s="all"===i?e.all:e.stdio[i];if(null==s)throw new TypeError(Yt(i,t,r,n));return s},Vt=new WeakMap,Ht=(e,t,n)=>{const r=Kt(t,n);return qt(r,t,n,e),r},Kt=(e,t)=>{const n=_(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(`"${Jt(t)}" must not be "${e}".\nIt must be ${r} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${o}".`)},qt=(e,t,n,r)=>{const o=r[Qt(e)];if(void 0===o)throw new TypeError(`"${Jt(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(`"${Jt(n)}" must not be ${t}. It must be a readable stream, not writable.`);if("input"!==o.direction&&n)throw new TypeError(`"${Jt(n)}" must not be ${t}. It must be a writable stream, not readable.`)},Yt=(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}=Xt(e,n);return`The "${o}: ${Zt(i)}" option is incompatible with using "${Jt(r)}: ${Zt(t)}".\nPlease set this option with "pipe" instead.`},Xt=(e,{stdin:t,stdout:n,stderr:r,stdio:o})=>{const i=Qt(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]}},Qt=e=>"all"===e?1:e,Jt=e=>e?"to":"from",Zt=e=>"string"==typeof e?`'${e}'`:"number"==typeof e?`${e}`:"Stream",en=(e,t,n)=>{const r=e.getMaxListeners();0!==r&&r!==Number.POSITIVE_INFINITY&&(e.setMaxListeners(r+t),(0,Ot.addAbortListener)(n,(()=>{e.setMaxListeners(e.getMaxListeners()-t)})))},tn=(e,t)=>{t&&nn(e)},nn=e=>{e.refCounted()},rn=(e,t)=>{t&&on(e)},on=e=>{e.unrefCounted()},sn=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},o)=>{if(bn(o)||jn(o))return;cn.has(e)||cn.set(e,[]);const i=cn.get(e);if(i.push(o),!(i.length>1))for(;i.length>0;){await xn(e,r,o),await qe.scheduler.yield();const s=await hn({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});i.shift(),r.emit("message",s),r.emit("message:done")}},an=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:o})=>{Rn();const i=cn.get(e);for(;i?.length>0;)await(0,Ot.once)(r,"message:done");e.removeListener("message",o),((e,t)=>{t&&(nn(e),nn(e))})(t,n),r.connected=!1,r.emit("disconnect")},cn=new WeakMap,ln=(e,t,n)=>{if(dn.has(e))return dn.get(e);const r=new Ot.EventEmitter;return r.connected=!0,dn.set(e,r),un({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},dn=new WeakMap,un=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{const o=sn.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on("message",o),t.once("disconnect",an.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:o})),((e,t)=>{t&&(on(e),on(e))})(n,r)},pn=e=>{const t=dn.get(e);return void 0===t?null!==e.channel:t.connected};let mn=0n;const fn=(e,t)=>{if(t?.type===vn&&!t.hasListeners)for(const{id:t}of e)void 0!==t&&yn[t].resolve({isDeadlock:!0,hasListeners:!1})},hn=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:o})=>{if(e?.type!==vn||!t.connected)return e;const{id:i,message:s}=e,a={id:i,type:Sn,message:Tn(t,o)};try{await In({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},a)}catch(e){o.emit("strict:error",e)}return s},bn=e=>{if(e?.type!==Sn)return!1;const{id:t,message:n}=e;return yn[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},gn=async(e,t,n)=>{if(e?.type!==vn)return;const r=Wt();yn[e.id]=r;const o=new AbortController;try{const{isDeadlock:e,hasListeners:i}=await Promise.race([r,wn(t,n,o)]);e&&(e=>{throw new Error(`${Lt("sendMessage",e)} failed: the ${Ft(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${Lt("getOneMessage",e)},\n\t${Lt("sendMessage",e,"message, {strict: true}")},\n]);`)})(n),i||(e=>{throw new Error(`${Lt("sendMessage",e)} failed: the ${Ft(e)} is not listening to incoming messages.`)})(n)}finally{o.abort(),delete yn[e.id]}},yn={},wn=async(e,t,{signal:n})=>{en(e,1,n),await(0,Ot.once)(e,"disconnect",{signal:n}),(e=>{throw new Error(`${Lt("sendMessage",e)} failed: the ${Ft(e)} exited without listening to incoming messages.`)})(t)},vn="execa:ipc:request",Sn="execa:ipc:response",xn=async(e,t,n)=>{for(;!Tn(e,t)&&En.get(e)?.size>0;){const t=[...En.get(e)];fn(t,n),await Promise.all(t.map((({onMessageSent:e})=>e)))}},En=new WeakMap,Tn=(e,t)=>t.listenerCount("message")>Dn(e),Dn=e=>Vt.has(e)&&!q(Vt.get(e).options.buffer,"ipc")?1:0,In=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},o,{strict:i=!1}={})=>{const s="sendMessage";return $t({methodName:s,isSubprocess:n,ipc:r,isConnected:e.connected}),On({anyProcess:e,channel:t,methodName:s,isSubprocess:n,message:o,strict:i})},On=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=ln(e,t,n),s=Tn(e,i);return{id:mn++,type:vn,message:r,hasListeners:s}})({anyProcess:e,channel:t,isSubprocess:r,message:o,strict:i}),a=((e,t,n)=>{En.has(e)||En.set(e,new Set);const r=En.get(e),o={onMessageSent:Wt(),id:n?t.id:void 0};return r.add(o),{outgoingMessages:r,outgoingMessage:o}})(e,s,i);try{await Mn({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:s,message:o})}catch(t){throw Gt(e),t}finally{(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()})(a)}},Mn=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:o})=>{const i=Nn(e);try{await Promise.all([gn(r,e,n),i(r)])}catch(e){throw(({error:e,methodName:t,isSubprocess:n})=>{if("EPIPE"===e.code)throw new Error(`${Lt(t,n)} cannot be used: the ${Ft(n)} is disconnecting.`,{cause:e})})({error:e,methodName:t,isSubprocess:n}),(({error:e,methodName:t,isSubprocess:n,message:r})=>{if(Pt(e))throw new Error(`${Lt(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}},Nn=e=>{if(Cn.has(e))return Cn.get(e);const t=(0,C.promisify)(e.send.bind(e));return Cn.set(e,t),t},Cn=new WeakMap,$n=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await Bn({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),kn.signal),Bn=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{An||(An=!0,r?null!==t?(ln(e,t,n),await qe.scheduler.yield()):Rn():(()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")})())};let An=!1;const jn=e=>e?.type===Pn&&(kn.abort(e.message),!0),Pn="execa:ipc:cancel",Rn=()=>{kn.abort(new Error(`\`cancelSignal\` aborted: the ${Ft(!0)} disconnected.`))},kn=new AbortController,Ln=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:o,controller:i})=>n?[Un({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:o,controller:i})]:[],Un=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:o}})=>{await Mt(t,o);const i=Fn(t);throw await((e,t)=>{const n="cancelSignal";return At(n,!1,e.connected),Mn({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:Pn,message:t},message:t})})(e,i),It({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:o}),r.terminationReason??="gracefulCancel",t.reason},Fn=({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},Gn=(e,t,n,r)=>0===t||void 0===t?[]:[Wn(e,t,n,r)],Wn=async(e,t,n,{signal:r})=>{throw await(0,qe.setTimeout)(t,void 0,{signal:r}),n.terminationReason??="timeout",e.kill(),new Ye},_n=e(import.meta.url)("node:v8"),zn={advanced:e=>{try{(0,_n.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})}}},Vn=async(e,t)=>{void 0!==t&&await e.sendMessage(t)},Hn=new Set(["utf8","utf16le"]),Kn=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),qn=new Set([...Hn,...Kn]),Yn=e=>{if(null===e)return"buffer";if("string"!=typeof e)return;const t=e.toLowerCase();return t in Xn?Xn[t]:qn.has(t)?t:void 0},Xn={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Qn=e=>"string"==typeof e?`"${e}"`:String(e),Jn=()=>{try{return $.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},Zn=(e,t,n)=>{n.cwd=((e=Jn())=>{const t=s(e,'The "cwd" option');return(0,Ve.resolve)(t)})(n.cwd);const[r,o,i]=((e,t,{node:n=!1,nodePath:r=$.execPath,nodeOptions:o=$.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=(0,Ve.resolve)(i,l),u={...c,nodePath:d,node:n,cwd:i};if(!n)return[e,t,u];if("node"===(0,Ve.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:c,args:l,options:d}=He._parse(r,o,i),u=(e=>{const t={...e};for(const n of K)t[n]=R(e,n);return t})(d),p=er(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(qn.has(e))return;const t=Yn(e);if(void 0!==t)throw new TypeError(`Invalid option \`encoding: ${Qn(e)}\`.\nPlease rename it to ${Qn(t)}.`);const n=[...qn].map((e=>Qn(e))).join(", ");throw new TypeError(`Invalid option \`encoding: ${Qn(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`.");zn[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=a(p.shell),p.env=tr(p),p.killSignal=(e=>{const t="option `killSignal`";if(0===e)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return mt(e,t)})(p.killSignal),p.forceKillAfterDelay=(e=>{if(!1===e)return e;if(!0===e)return St;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&&!Kn.has(p.encoding)&&p.buffer[t])),"win32"===$.platform&&"cmd"===(0,Ve.basename)(c,".exe")&&l.unshift("/q"),{file:c,commandArguments:l,options:p}},er=({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}),tr=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:o,nodePath:i})=>{const s=t?{...$.env,...e}:e;return n||r?(0,Ke.V)({env:s,cwd:o,execPath:i,preferLocal:n,addExecPath:r}):s};function nr(e){if("string"==typeof e)return rr(e);if(!ArrayBuffer.isView(e)||1!==e.BYTES_PER_ELEMENT)throw new Error("Input must be a string or a Uint8Array");return or(e)}const rr=e=>e.at(-1)===ir?e.slice(0,e.at(-2)===ar?-2:-1):e,or=e=>e.at(-1)===sr?e.subarray(0,e.at(-2)===cr?-2:-1):e,ir="\n",sr=ir.codePointAt(0),ar="\r",cr=ar.codePointAt(0);function lr(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 dr(e,{checkOpen:t=!0}={}){return lr(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 ur(e,{checkOpen:t=!0}={}){return lr(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 pr(e,t){return dr(e,t)&&ur(e,t)}const mr=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class fr{#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 hr=Symbol();function br(){return this[hr].next()}function gr(e){return this[hr].return(e)}Object.defineProperty(br,"name",{value:"next"}),Object.defineProperty(gr,"name",{value:"return"});const yr=Object.create(mr,{next:{enumerable:!0,configurable:!0,writable:!0,value:br},return:{enumerable:!0,configurable:!0,writable:!0,value:gr}});function wr({preventCancel:e=!1}={}){const t=this.getReader(),n=new fr(t,e),r=Object.create(yr);return r[hr]=n,r}const vr=e=>{if(ur(e,{checkOpen:!1})&&void 0!==Tr.on)return xr(e);if("function"==typeof e?.[Symbol.asyncIterator])return e;if("[object ReadableStream]"===Sr.call(e))return wr.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Sr}=Object.prototype,xr=async function*(e){const t=new AbortController,n={};Er(e,t,n);try{for await(const[n]of Tr.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()}},Er=async(e,t,n)=>{try{await Tr.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},Tr={},Dr=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const l=vr(e),d=t();d.length=0;try{for await(const e of l){const t=n[Nr(e)](e,d);Or({convertedChunk:t,state:d,getSize:r,truncateChunk:o,addChunk:i,maxBuffer:c})}return Ir({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}},Ir=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:o,maxBuffer:i})=>{const s=o(e);void 0!==s&&Or({convertedChunk:s,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:i})},Or=({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 Mr(e,t,o,a);const c=r(e,i-t.length);throw void 0!==c&&Mr(c,t,o,i),new $r},Mr=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},Nr=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=Cr.call(e);return"[object ArrayBuffer]"===n?"arrayBuffer":"[object DataView]"===n?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===Cr.call(e.buffer)?"typedArray":"others"},{toString:Cr}=Object.prototype;class $r extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const Br=(e,t,n)=>e?"objects":t?"lines":"buffer"===n?"bytes":"characters",Ar=(e,t,n)=>{if(t.length!==n)return;const r=new $r;throw r.maxBufferInfo={fdNumber:"ipc"},r},jr=(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=q(t,n);return"ipc"===n?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:P(n),threshold:o,unit:r}},Pr=([,e])=>e,Rr=({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=kr(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}=jr(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} (${vt(m)})${f}`:void 0!==s?`Command was killed with ${s} (${a})`:void 0!==c?`Command failed with exit code ${c}`:"Command failed"},kr=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",Lr=(e,t)=>{if(e instanceof Ye)return;const n=Je(r=e)&&Qe in r?e.originalMessage:String(e?.message??e);var r;const o=ne(((e,t)=>{if(t===Jn())return e;let n;try{n=(0,te.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},Ur=e=>"string"==typeof e?e:(0,C.inspect)(e),Fr=e=>Array.isArray(e)?e.map((e=>nr(Gr(e)))).filter(Boolean).join("\n"):Gr(e),Gr=e=>"string"==typeof e?e:p(e)?g(e):"",Wr=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:o,options:{cwd:i},startTime:s})=>Hr({command:e,escapedCommand:t,cwd:i,durationMs:_e(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})=>zr({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}),zr=({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}=Kr(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=Rr({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=Lr(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=>Ur(e))).join("\n")].map((e=>ne(nr(Fr(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?et:Ze)(t,e instanceof Ye?{}:{cause:e}))(e,I,v);return Object.assign(O,Vr({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},Vr=({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})=>Hr({shortMessage:g,originalMessage:b,command:t,escapedCommand:n,cwd:h,durationMs:_e(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:[]}),Hr=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e))),Kr=(e,t)=>{const n=null===t?void 0:t;return{exitCode:null===e?void 0:e,signal:n,signalDescription:void 0===n?void 0:vt(t)}},qr=e=>Number.isFinite(e)?e:0;function Yr(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(qr(1e3*e)%1e3),nanoseconds:Math.trunc(qr(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")}function Xr(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=Yr(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),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 Qr=(e,t)=>{Y(t)&&(((e,t)=>{e.failed&&Be({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})})(e,t),Jr(e,t))},Jr=(e,t)=>{const n=`(done in ${Xr(e.durationMs)})`;Be({type:"duration",verboseMessage:n,verboseInfo:t,result:e})},Zr=(e,t,{reject:n})=>{if(Qr(e,t),e.failed&&n)throw e;return e},eo=(e,t)=>lo(e)?"asyncGenerator":uo(e)?"generator":mo(e)?"fileUrl":fo(e)?"filePath":wo(e)?"webStream":lr(e,{checkOpen:!1})?"native":p(e)?"uint8Array":So(e)?"asyncIterable":xo(e)?"iterable":vo(e)?ro({transform:e},t):po(e)?to(e,t):"native",to=(e,t)=>pr(e.transform,{checkOpen:!1})?no(e,t):vo(e.transform)?ro(e,t):so(e,t),no=(e,t)=>(oo(e,t,"Duplex stream"),"duplex"),ro=(e,t)=>(oo(e,t,"web TransformStream"),"webTransform"),oo=({final:e,binary:t,objectMode:n},r,o)=>{io(e,`${r}.final`,o),io(t,`${r}.binary`,o),ao(n,`${r}.objectMode`)},io=(e,t,n)=>{if(void 0!==e)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},so=({transform:e,final:t,binary:n,objectMode:r},o)=>{if(void 0!==e&&!co(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(pr(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(vo(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(void 0!==t&&!co(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return ao(n,`${o}.binary`),ao(r,`${o}.objectMode`),lo(e)||lo(t)?"asyncGenerator":"generator"},ao=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw new TypeError(`The \`${t}\` option must use a boolean.`)},co=e=>lo(e)||uo(e),lo=e=>"[object AsyncGeneratorFunction]"===Object.prototype.toString.call(e),uo=e=>"[object GeneratorFunction]"===Object.prototype.toString.call(e),po=e=>o(e)&&(void 0!==e.transform||void 0!==e.final),mo=e=>"[object URL]"===Object.prototype.toString.call(e),fo=e=>o(e)&&1===Object.keys(e).length&&ho(e.file),ho=e=>"string"==typeof e,bo=new Set(["ipc","ignore","inherit","overlapped","pipe"]),go=e=>"[object ReadableStream]"===Object.prototype.toString.call(e),yo=e=>"[object WritableStream]"===Object.prototype.toString.call(e),wo=e=>go(e)||yo(e),vo=e=>go(e?.readable)&&yo(e?.writable),So=e=>Eo(e)&&"function"==typeof e[Symbol.asyncIterator],xo=e=>Eo(e)&&"function"==typeof e[Symbol.iterator],Eo=e=>"object"==typeof e&&null!==e,To=new Set(["generator","asyncGenerator","duplex","webTransform"]),Do=new Set(["fileUrl","filePath","fileNumber"]),Io=new Set(["fileUrl","filePath"]),Oo=new Set([...Io,"webStream","nodeStream"]),Mo=new Set(["webTransform","duplex"]),No={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"},Co=(e,t,n,r)=>"output"===r?$o(e,t,n):Bo(e,t,n),$o=(e,t,n)=>{const r=0!==t&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},Bo=(e,t,n)=>{const r=0===t?!0===e:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},Ao=(e,t,n,{encoding:r})=>{const o=e.filter((({type:e})=>To.has(e))),i=Array.from({length:o.length});for(const[e,s]of Object.entries(o))i[e]=jo({stdioItem:s,index:Number(e),newTransforms:i,optionName:t,direction:n,encoding:r});return Lo(i,n)},jo=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:o,direction:i,encoding:s})=>"duplex"===t?Po({stdioItem:e,optionName:o}):"webTransform"===t?Ro({stdioItem:e,index:n,newTransforms:r,direction:i}):ko({stdioItem:e,index:n,newTransforms:r,direction:i,encoding:s}),Po=({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}}},Ro=({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}=Co(a,n,r,i);return{...e,value:{transform:s,writableObjectMode:c,readableObjectMode:l}}},ko=({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||Kn.has(s),{writableObjectMode:m,readableObjectMode:f}=Co(u,n,r,i);return{...e,value:{transform:a,final:c,binary:p,preserveNewlines:d,writableObjectMode:m,readableObjectMode:f}}},Lo=(e,t)=>"input"===t?e.reverse():e,Uo=({type:e,value:t},n)=>Fo[n]??_o[e](t),Fo=["input","output","output"],Go=()=>{},Wo=()=>"input",_o={generator:Go,asyncGenerator:Go,fileUrl:Go,filePath:Go,iterable:Wo,asyncIterable:Wo,uint8Array:Wo,webStream:e=>yo(e)?"output":"input",nodeStream:e=>ur(e,{checkOpen:!1})?dr(e,{checkOpen:!1})?void 0:"input":"output",webTransform:Go,duplex:Go,native(e){const t=zo(e);return void 0!==t?t:lr(e,{checkOpen:!1})?_o.nodeStream(e):void 0}},zo=e=>[0,$.stdin].includes(e)?"input":[1,2,$.stdout,$.stderr].includes(e)?"output":void 0,Vo="output",Ho=(e,t)=>{if(void 0===e)return j.map((e=>t[e]));if(Ko(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${j.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,j.length);return Array.from({length:n},((t,n)=>e[n]))},Ko=e=>j.some((t=>void 0!==e[t])),qo=(e,t)=>Array.isArray(e)?e.map((e=>qo(e,t))):null==e?t>=j.length?"ignore":"pipe":e,Yo=(e,t,n)=>e.map(((e,r)=>t[r]||0===r||X(n,r)||!Xo(e)?e:"ignore")),Xo=e=>"pipe"===e||Array.isArray(e)&&e.every((e=>"pipe"===e)),Qo=({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(lr(t,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},Jo=({value:e,optionName:t,fdNumber:n,direction:r})=>{const o=Zo(e,n);if(void 0!==o){if("output"===r)return{type:"fileNumber",value:o,optionName:t};if(be.isatty(o))throw new TypeError(`The \`${t}: ${Zt(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:m((0,te.readFileSync)(o)),optionName:t}}},Zo=(e,t)=>{if("inherit"===e)return t;if("number"==typeof e)return e;const n=A.indexOf(e);return-1!==n?n:void 0},ei=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>"inherit"===t?{type:"nodeStream",value:ti(r,t,n),optionName:n}:"number"==typeof t?{type:"nodeStream",value:ti(t,t,n),optionName:n}:lr(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:n}:e,ti=(e,t,n)=>{const r=A[e];if(void 0===r)throw new TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},ni=({input:e,inputFile:t},n)=>0===n?[...ri(e),...ii(t)]:[],ri=e=>void 0===e?[]:[{type:oi(e),value:e,optionName:"input"}],oi=e=>{if(ur(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.")},ii=e=>void 0===e?[]:[{...si(e),optionName:"inputFile"}],si=e=>{if(mo(e))return{type:"fileUrl",value:e};if(ho(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},ai=(e,t)=>e.flatMap((({direction:e,stdioItems:n})=>n.filter((e=>e.type===t)).map((t=>({...t,direction:e}))))),ci=({otherStdioItems:e,type:t,value:n,optionName:r,direction:o})=>{Io.has(t)&&li({otherStdioItems:e,type:t,value:n,optionName:r,direction:o})},li=({otherStdioItems:e,type:t,value:n,optionName:r,direction:o})=>{const i=e.filter((e=>di(e,n)));if(0===i.length)return;const s=i.find((e=>e.direction!==o));return pi(s,r,t),"output"===o?i[0].stream:void 0},di=({type:e,value:t},n)=>"filePath"===e?t.file===n.file:"fileUrl"===e?t.href===n.href:t===n,ui=({otherStdioItems:e,type:t,value:n,optionName:r})=>{const o=e.find((({value:{transform:e}})=>e===n.transform));pi(o,r,t)},pi=(e,t,n)=>{if(void 0!==e)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${No[n]} that is the same.`)},mi=(e,t,n,r)=>{const o=(({stdio:e,ipc:t,buffer:n,...r},o,i)=>{const s=Ho(e,r).map(((e,t)=>qo(e,t)));return i?Yo(s,n,o):((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e)(s,t)})(t,n,r),i=o.map(((e,n)=>fi({stdioOption:e,fdNumber:n,options:t,isSync:r}))),s=xi({initialFileDescriptors:i,addProperties:e,options:t,isSync:r});return t.stdio=s.map((({stdioItems:e})=>Ii(e))),s},fi=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{const o=P(t),{stdioItems:i,isStdioArray:s}=hi({stdioOption:e,fdNumber:t,options:n,optionName:o}),a=((e,t,n)=>{const r=e.map((e=>Uo(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)??Vo})(i,t,o),c=i.map((e=>(({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:o,isSync:i})=>n&&"native"===t?i?Qo({stdioItem:e,fdNumber:r,direction:o}):ei({stdioItem:e,fdNumber:r}):e)({stdioItem:e,isStdioArray:s,fdNumber:t,direction:a,isSync:r}))),l=((e,t,n,r)=>[...e.filter((({type:e})=>!To.has(e))),...Ao(e,t,n,r)])(c,o,a,n),d=((e,t)=>{const n=e.findLast((({type:e})=>To.has(e)));return void 0!==n&&("input"===t?n.value.writableObjectMode:n.value.readableObjectMode)})(l,a);return Si(l,d),{direction:a,objectMode:d,stdioItems:l}},hi=({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=>bi(e,r))),...ni(n,t)]),i=o.length>1;return gi(o,i,r),wi(o),{stdioItems:o,isStdioArray:i}},bi=(e,t)=>({type:eo(e,t),value:e,optionName:t}),gi=(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(yi.has(t))throw new Error(`The \`${n}\` option must not include \`${t}\`.`)},yi=new Set(["ignore","ipc"]),wi=e=>{for(const t of e)vi(t)},vi=({type:e,value:t,optionName:n})=>{if((e=>mo(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&&!bo.has(t))(e,t))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},Si=(e,t)=>{if(!t)return;const n=e.find((({type:e})=>Do.has(e)));if(void 0!==n)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},xi=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{const o=[];try{for(const i of e)o.push(Ei({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:n,isSync:r}));return o}catch(e){throw Di(o),e}},Ei=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:o,options:i,isSync:s})=>{const a=n.map((t=>Ti({stdioItem:t,addProperties:o,direction:e,options:i,fileDescriptors:r,isSync:s})));return{direction:e,objectMode:t,stdioItems:a}},Ti=({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=ai(o,e);if(0!==s.length){if(!i)return Oo.has(e)?li({otherStdioItems:s,type:e,value:t,optionName:n,direction:r}):void(Mo.has(e)&&ui({otherStdioItems:s,type:e,value:t,optionName:n}));ci({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)}},Di=e=>{for(const{stdioItems:t}of e)for(const{stream:e}of t)void 0===e||B(e)||e.destroy()},Ii=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"},Oi=({type:e,optionName:t})=>{Mi(t,No[e])},Mi=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Ni={generator(){},asyncGenerator:Oi,webStream:Oi,nodeStream:Oi,webTransform:Oi,duplex:Oi,asyncIterable:Oi,native:({optionName:e,value:t})=>("ipc"!==t&&"overlapped"!==t||Mi(e,`"${t}"`),{})},Ci={input:{...Ni,fileUrl:({value:e})=>({contents:[m((0,te.readFileSync)(e))]}),filePath:({value:{file:e}})=>({contents:[m((0,te.readFileSync)(e))]}),fileNumber:Oi,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Ni,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e}})=>({path:e}),fileNumber:({value:e})=>({path:e}),iterable:Oi,string:Oi,uint8Array:Oi}},$i=(e,{stripFinalNewline:t},n)=>Bi(t,n)&&void 0!==e&&!Array.isArray(e)?nr(e):e,Bi=(e,t)=>"all"===t?e[1]||e[2]:e[t];var Ai=r(7075);const ji=(e,t,n,r)=>e||n?void 0:ki(t,r),Pi=(e,t,n)=>n?e.flatMap((e=>Ri(e,t))):Ri(e,t),Ri=(e,t)=>{const{transform:n,final:r}=ki(t,{});return[...n(e),...r()]},ki=(e,t)=>(t.previousChunks="",{transform:Li.bind(void 0,t,e),final:Fi.bind(void 0,t)}),Li=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=Ui(n,i,t,e);let a=n.slice(o+1,i+1-s);r.length>0&&(a=_i(r,a),r=""),yield a,o=i}o!==n.length-1&&(r=_i(r,n.slice(o+1))),e.previousChunks=r},Ui=(e,t,n,r)=>n?0:(r.isWindowsNewline=0!==t&&"\r"===e[t-1],r.isWindowsNewline?2:1),Fi=function*({previousChunks:e}){e.length>0&&(yield e)},Gi=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:Wi.bind(void 0,r)},Wi=function*({isWindowsNewline:e=!1},t){const{unixNewline:n,windowsNewline:r,LF:o,concatBytes:i}="string"==typeof t?zi:Vi;if(t.at(-1)===o)return void(yield t);const s=e?r:n;yield i(t,s)},_i=(e,t)=>`${e}${t}`,zi={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:_i},Vi={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 Hi=r(4573);const Ki=(e,t)=>e?void 0:qi.bind(void 0,t),qi=function*(e,t){if("string"!=typeof t&&!p(t)&&!Hi.Buffer.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Yi=(e,t)=>e?Xi.bind(void 0,t):Qi.bind(void 0,t),Xi=function*(e,t){Ji(e,t),yield t},Qi=function*(e,t){if(Ji(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},Ji=(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; }`)},Zi=(e,t,n)=>{if(n)return;if(e)return{transform:es.bind(void 0,new TextEncoder)};const r=new d.StringDecoder(t);return{transform:ts.bind(void 0,r),final:ns.bind(void 0,r)}},es=function*(e,t){Hi.Buffer.isBuffer(t)?yield m(t):"string"==typeof t?yield e.encode(t):yield t},ts=function*(e,t){yield p(t)?e.write(t):t},ns=function*(e){const t=e.end();""!==t&&(yield t)},rs=(0,C.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}})),os=async function*(e,t,n){if(n===t.length)return void(yield e);const{transform:r=cs}=t[n];for await(const o of r(e))yield*os(o,t,n+1)},is=async function*(e){for(const[t,{final:n}]of Object.entries(e))yield*ss(n,Number(t),e)},ss=async function*(e,t,n){if(void 0!==e)for await(const r of e())yield*os(r,n,t+1)},as=(0,C.callbackify)((async({currentIterable:e},t)=>{if(void 0===e){if(t)throw t}else await(t?e.throw(t):e.return())})),cs=function*(e){yield e},ls=(e,t,n,r)=>{try{for(const r of e(...t))n.push(r);r()}catch(e){r(e)}},ds=(e,t)=>[...t.flatMap((t=>[...us(t,e,0)])),...ps(e)],us=function*(e,t,n){if(n===t.length)return void(yield e);const{transform:r=fs}=t[n];for(const o of r(e))yield*us(o,t,n+1)},ps=function*(e){for(const[t,{final:n}]of Object.entries(e))yield*ms(n,Number(t),e)},ms=function*(e,t,n){if(void 0!==e)for(const r of e())yield*us(r,n,t+1)},fs=function*(e){yield e},hs=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:o},optionName:i},{encoding:s})=>{const a={},c=gs(e,s,i),l=lo(t),d=lo(n),u=l?rs.bind(void 0,os,a):ls.bind(void 0,us),p=l||d?rs.bind(void 0,is,a):ls.bind(void 0,ps),m=l||d?as.bind(void 0,a):void 0;return{stream:new Ai.Transform({writableObjectMode:r,writableHighWaterMark:(0,Ai.getDefaultHighWaterMark)(r),readableObjectMode:o,readableHighWaterMark:(0,Ai.getDefaultHighWaterMark)(o),transform(e,t,n){u([e,c,0],this,n)},flush(e){p([c],this,e)},destroy:m})}},bs=(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=gs(t,n,r);e=ds(o,e)}return e},gs=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:o,preserveNewlines:i},s,a)=>{const c={};return[{transform:Ki(r,a)},Zi(n,s,r),ji(n,i,r,c),{transform:e,final:t},{transform:Yi(o,a)},Gi({binary:n,preserveNewlines:i,readableObjectMode:o,state:c})].filter(Boolean)},ys=e=>new Set(Object.entries(e).filter((([,{direction:e}])=>"input"===e)).map((([e])=>Number(e)))),ws=(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 ${No[e]} with synchronous methods.`)}const i=o.map((({contents:e})=>e)).map((e=>vs(e,r)));n.input=w(i)},vs=(e,t)=>{const n=bs(e,t,"utf8",!0);return Ss(n),w(n)},Ss=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}.`)},xs=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>"all"!==r&&X(n,r)&&!Kn.has(t)&&Es(r)&&(e.some((({type:e,value:t})=>"native"===e&&Ts.has(t)))||e.every((({type:e})=>To.has(e)))),Es=e=>1===e||2===e,Ts=new Set(["pipe","overlapped"]),Ds=e=>e._readableState.pipes.length>0,Is=(e,t,n)=>{const r=ke(e);Be({type:"output",verboseMessage:r,fdNumber:t,verboseInfo:n})},Os=({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=Pr(n);return e.length>r?e.slice(0,r):e})(e,i,u),f=m(p),{stdioItems:h,objectMode:b}=t[n],g=Ms([f],h,c,r),{serializedResult:y,finalResult:w=y}=Ns({chunks:g,objectMode:b,encoding:c,lines:l,stripFinalNewline:d,fdNumber:n});Cs({serializedResult:y,fdNumber:n,state:r,verboseInfo:s,encoding:c,stdioItems:h,objectMode:b});const v=a[n]?w:void 0;try{return void 0===r.error&&$s(y,h,o),v}catch(e){return r.error=e,v}},Ms=(e,t,n,r)=>{try{return bs(e,t,n,!1)}catch(t){return r.error=t,e}},Ns=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if("buffer"===n)return{serializedResult:w(e)};const s=((e,t)=>y(e,t).join(""))(e,n);return r[i]?{serializedResult:s,finalResult:Pi(s,!o[i],t)}:{serializedResult:s}},Cs=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:o,stdioItems:i,objectMode:s})=>{if(!xs({stdioItems:i,encoding:o,verboseInfo:r,fdNumber:t}))return;const a=Pi(e,!1,s);try{((e,t,n)=>{for(const r of e)Is(r,t,n)})(a,t,r)}catch(e){n.error??=e}},$s=(e,t,n)=>{for(const{path:r}of t.filter((({type:e})=>Do.has(e)))){const t="string"==typeof r?r:r.toString();n.has(t)?(0,te.appendFileSync)(r,e):(n.add(t),(0,te.writeFileSync)(r,e))}},Bs=async e=>{const[t,n]=await Promise.allSettled([(0,Ot.once)(e,"spawn"),(0,Ot.once)(e,"exit")]);return"rejected"===t.status?[]:"rejected"===n.status?As(e):n.value},As=async e=>{try{return await(0,Ot.once)(e,"exit")}catch{return As(e)}},js=async e=>{const[t,n]=await e;if(!Ps(t,n)&&Rs(t,n))throw new Ye;return[t,n]},Ps=(e,t)=>void 0===e&&void 0===t,Rs=(e,t)=>0!==e||null!==t,ks=({error:e,status:t,signal:n,output:r},{maxBuffer:o})=>{const i=Ls(e,t,n),s="ETIMEDOUT"===i?.code,a=((e,t,n)=>"ENOBUFS"===e?.code&&null!==t&&t.some((e=>null!==e&&e.length>Pr(n))))(i,r,o);return{resultError:i,exitCode:t,signal:n,timedOut:s,isMaxBuffer:a}},Ls=(e,t,n)=>void 0!==e?e:Rs(t,n)?new Ye:void 0,Us=(e,t,n)=>{const{command:r,escapedCommand:o,startTime:i,verboseInfo:s}=ze(e,t,n),a=Fs(n),{file:c,commandArguments:l,options:d}=Zn(e,t,a);Gs(d);const u=((e,t)=>mi(Ci,e,t,!0))(d,s);return{file:c,commandArguments:l,command:r,escapedCommand:o,startTime:i,verboseInfo:s,options:d,fileDescriptors:u}},Fs=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,Gs=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Ws("ipcInput"),e&&Ws("ipc: true"),n&&Ws("detached: true"),r&&Ws("cancelSignal")},Ws=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},_s=({file:e,commandArguments:t,options:n,command:r,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:a})=>{const c=zs({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:m,isMaxBuffer:f}=ks(c,n),{output:h,error:b=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)=>Os({result:t,fileDescriptors:e,fdNumber:a,state:i,outputFiles:s,isMaxBuffer:r,verboseInfo:o},n))),...i}})({fileDescriptors:s,syncResult:c,options:n,isMaxBuffer:f,verboseInfo:i}),g=h.map(((e,t)=>$i(e,n,t))),y=$i((([,e,t],n)=>{if(n.all)return void 0===e?t:void 0===t?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,$i(t,n,"all")]:Array.isArray(t)?[$i(e,n,"all"),...t]:p(e)&&p(t)?S([e,t]):`${e}${t}`})(h,n),n,"all");return Hs({error:b,exitCode:d,signal:u,timedOut:m,isMaxBuffer:f,stdio:g,all:y,options:n,command:r,escapedCommand:o,startTime:a})},zs=({file:e,commandArguments:t,options:n,command:r,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{((e,t)=>{for(const n of ys(e))ws(e,n,t)})(i,n);const r=Vs(n);return(0,l.spawnSync)(e,t,r)}catch(e){return _r({error:e,command:r,escapedCommand:o,fileDescriptors:i,options:n,startTime:s,isSync:!0})}},Vs=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:"buffer",maxBuffer:Pr(t)}),Hs=({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?Wr({command:c,escapedCommand:l,stdio:i,all:s,ipcOutput:[],options:a,startTime:d}):zr({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}),Ks=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:o=!0,filter:i}={})=>($t({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:pn(e)}),qs({anyProcess:e,channel:t,isSubprocess:n,filter:i,reference:o})),qs=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:o})=>{tn(t,o);const i=ln(e,t,n),s=new AbortController;try{return await Promise.race([Ys(i,r,s),Xs(i,n,s),Qs(i,n,s)])}catch(t){throw Gt(e),t}finally{s.abort(),rn(t,o)}},Ys=async(e,t,{signal:n})=>{if(void 0===t){const[t]=await(0,Ot.once)(e,"message",{signal:n});return t}for await(const[r]of(0,Ot.on)(e,"message",{signal:n}))if(t(r))return r},Xs=async(e,t,{signal:n})=>{await(0,Ot.once)(e,"disconnect",{signal:n}),(e=>{throw new Error(`${Lt("getOneMessage",e)} could not complete: the ${Ft(e)} exited or disconnected.`)})(t)},Qs=async(e,t,{signal:n})=>{const[r]=await(0,Ot.once)(e,"strict:error",{signal:n});throw jt(r,t)},Js=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:o=!0}={})=>Zs({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:o}),Zs=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:o,reference:i})=>{$t({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:pn(e)}),tn(t,i);const s=ln(e,t,n),a=new AbortController,c={};return ea(e,s,a),ta({ipcEmitter:s,isSubprocess:n,controller:a,state:c}),na({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:n,shouldAwait:o,controller:a,state:c,reference:i})},ea=async(e,t,n)=>{try{await(0,Ot.once)(t,"disconnect",{signal:n.signal}),n.abort()}catch{}},ta=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{const[o]=await(0,Ot.once)(e,"strict:error",{signal:n.signal});r.error=jt(o,t),n.abort()}catch{}},na=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,Ot.on)(n,"message",{signal:i.signal}))ra(s),yield e}catch{ra(s)}finally{i.abort(),rn(t,a),r||Gt(e),o&&await e}},ra=({error:e})=>{if(e)throw e},oa=(e,t,n)=>({sendMessage:In.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:Ks.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:Js.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),ia=(e,t)=>{const n=sa(),r=sa(),o=sa(),i=Array.from({length:t.length-3},sa),s=sa(),a=[n,r,o,...i];Object.assign(e,{stdin:n,stdout:r,stderr:o,all:s,stdio:a})},sa=()=>{const e=new Ai.PassThrough;return e.end(),e},aa=()=>new Ai.Readable({read(){}}),ca=()=>new Ai.Writable({write(){}}),la=()=>new Ai.Duplex({read(){},write(){}}),da=async(e,t,n)=>Zr(e,t,n),ua=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${No[e]}.`)},pa={fileNumber:ua,generator:hs,asyncGenerator:hs,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){const r=t||n;return{stream:Ai.Duplex.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},ma={input:{...pa,fileUrl:({value:e})=>({stream:(0,te.createReadStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,te.createReadStream)(e)}),webStream:({value:e})=>({stream:Ai.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:Ai.Readable.from(e)}),asyncIterable:({value:e})=>({stream:Ai.Readable.from(e)}),string:({value:e})=>({stream:Ai.Readable.from(e)}),uint8Array:({value:e})=>({stream:Ai.Readable.from(Hi.Buffer.from(e))})},output:{...pa,fileUrl:({value:e})=>({stream:(0,te.createWriteStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,te.createWriteStream)(e)}),webStream:({value:e})=>({stream:Ai.Writable.fromWeb(e)}),iterable:ua,asyncIterable:ua,string:ua,uint8Array:ua}},fa=e(import.meta.url)("node:stream/promises");function ha(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const t of e)Sa(t);const t=e.some((({readableObjectMode:e})=>e)),n=ba(e,t),r=new ga({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(const t of e)r.add(t);return r}const ba=(e,t)=>{if(0===e.length)return(0,Ai.getDefaultHighWaterMark)(t);const n=e.filter((({readableObjectMode:e})=>e===t)).map((({readableHighWaterMark:e})=>e));return Math.max(...n)};class ga extends Ai.PassThrough{#s=new Set([]);#a=new Set([]);#c=new Set([]);#l;#d=Symbol("unpipe");#u=new WeakMap;add(e){if(Sa(e),this.#s.has(e))return;this.#s.add(e),this.#l??=ya(this,this.#s,this.#d);const t=xa({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(Sa(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 ya=async(e,t,n)=>{Ba(e,Aa);const r=new AbortController;try{await Promise.race([wa(e,r),va(e,t,n,r)])}finally{r.abort(),Ba(e,-Aa)}},wa=async(e,{signal:t})=>{try{await(0,fa.finished)(e,{signal:t,cleanup:!0})}catch(t){throw Oa(e,t),t}},va=async(e,t,n,{signal:r})=>{for await(const[o]of(0,Ot.on)(e,"unpipe",{signal:r}))t.has(o)&&o.emit(n)},Sa=e=>{if("function"!=typeof e?.pipe)throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},xa=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:o,onFinished:i,unpipeEvent:s})=>{Ba(e,ja);const a=new AbortController;try{await Promise.race([Ea(i,t,a),Ta({passThroughStream:e,stream:t,streams:n,ended:r,aborted:o,controller:a}),Da({stream:t,streams:n,ended:r,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),Ba(e,-ja)}n.size>0&&n.size===r.size+o.size&&(0===r.size&&o.size>0?Na(e):Ia(e))},Ea=async(e,t,{signal:n})=>{try{await e,n.aborted||Na(t)}catch(e){n.aborted||Oa(t,e)}},Ta=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:o,controller:{signal:i}})=>{try{await(0,fa.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;Ma(r)?o.add(t):Ca(e,r)}},Da=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:o,controller:{signal:i}})=>{if(await(0,Ot.once)(e,o,{signal:i}),!e.readable)return(0,Ot.once)(i,"abort",{signal:i});t.delete(e),n.delete(e),r.delete(e)},Ia=e=>{e.writable&&e.end()},Oa=(e,t)=>{Ma(t)?Na(e):Ca(e,t)},Ma=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,Na=e=>{(e.readable||e.writable)&&e.destroy()},Ca=(e,t)=>{e.destroyed||(e.once("error",$a),e.destroy(t))},$a=()=>{},Ba=(e,t)=>{const n=e.getMaxListeners();0!==n&&n!==Number.POSITIVE_INFINITY&&e.setMaxListeners(n+t)},Aa=2,ja=1,Pa=(e,t)=>{e.pipe(t),Ra(e,t),La(e,t)},Ra=async(e,t)=>{if(!B(e)&&!B(t)){try{await(0,fa.finished)(e,{cleanup:!0,readable:!0,writable:!1})}catch{}ka(t)}},ka=e=>{e.writable&&e.end()},La=async(e,t)=>{if(!B(e)&&!B(t)){try{await(0,fa.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Ua(e)}},Ua=e=>{e.readable&&e.destroy()},Fa=(e,t,n,r)=>{"output"===n?Pa(e.stdio[r],t):Pa(t,e.stdio[r]);const o=Ga[r];void 0!==o&&(e[o]=t),e.stdio[r]=t},Ga=["stdin","stdout","stderr"],Wa=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:o,controller:i})=>{if(void 0===t)return;_a(t,i);const[s,a]="output"===n?[t,e.stdio[r]]:[e.stdio[r],t],c=o.get(s)??[];o.set(s,[...c,a])},_a=(e,{signal:t})=>{B(e)&&en(e,za,t)},za=2;var Va=r(7017);const Ha=(e,t,n)=>{try{const{destination:r,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=Ka(e,t,...n);return{destination:r,destinationStream:_t(r,i),from:o,unpipeSignal:s}}catch(e){return{destinationError:e}}},Ka=(e,t,n,...r)=>{if(Array.isArray(n)){return{destination:t(qa,e)(n,...r),pipeOptions:e}}if("string"==typeof n||n 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(n,...r);return{destination:t(qa)(o,i,s),pipeOptions:s}}if(Vt.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}`)},qa=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),Ya=(e,t)=>{try{return{sourceStream:zt(e,t)}}catch(e){return{sourceError:e}}},Xa=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>void 0!==t&&void 0!==r?r:void 0!==r?(Ua(e),r):void 0!==t?(ka(n),t):void 0,Qa=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>_r({error:e,command:Ja,escapedCommand:Ja,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Ja="source.pipe(destination)",Za=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},ec=(e,t)=>{const n=ha([e]);return Pa(n,t),rc.set(t,n),n},tc=(e,t)=>{const n=rc.get(t);return n.add(e),n},nc=async e=>{try{await(0,fa.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}rc.delete(e)},rc=new WeakMap,oc=2,ic=1,sc=(e,t)=>void 0===e?[]:[ac(e,t)],ac=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:o,startTime:i})=>{await(0,C.aborted)(e,t),await n.remove(t);const s=new Error("Pipe canceled by `unpipeSignal` option.");throw Qa({error:s,fileDescriptors:r,sourceOptions:o,startTime:i})},cc=(e,...t)=>{if(o(t[0]))return cc.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});const{destination:n,...r}=(({source:e,sourcePromise:t,boundOptions:n,createNested:r},...o)=>{const i=We(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:d}=Ha(n,r,o),{sourceStream:u,sourceError:p}=Ya(e,l),{options:m,fileDescriptors:f}=Vt.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=lc({...r,destination:n});return i.pipe=cc.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},lc=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:o,destinationStream:i,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{const d=dc(e,o);(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:o,sourceOptions:i,startTime:s})=>{const a=Xa({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(void 0!==a)throw Qa({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=rc.has(t)?tc(e,t):ec(e,t);return en(e,oc,n.signal),en(t,ic,n.signal),nc(t),r})(t,i,u);return await Promise.race([Za(d),...sc(a,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{u.abort()}},dc=(e,t)=>Promise.allSettled([e,t]),uc=e=>e,pc=()=>{},mc=({contents:e})=>e,fc=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},hc=e=>e.length;const bc={init:()=>({contents:[]}),convertChunk:{string:uc,buffer:uc,arrayBuffer:uc,dataView:uc,typedArray:uc,others:uc},getSize:()=>1,truncateChunk:pc,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:pc,finalize:mc};const gc=new TextEncoder,yc=e=>new Uint8Array(e),wc=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),vc=(e,t)=>{if(t<=e.byteLength)return e;const n=new ArrayBuffer(xc(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Sc=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;const n=new ArrayBuffer(t,{maxByteLength:xc(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},xc=e=>Ec**Math.ceil(Math.log(e)/Math.log(Ec)),Ec=2,Tc=()=>"resize"in ArrayBuffer.prototype,Dc={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>gc.encode(e),buffer:yc,arrayBuffer:yc,dataView:wc,typedArray:wc,others:fc},getSize:hc,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:n},r)=>{const o=Tc()?Sc(t,r):vc(t,r);return new Uint8Array(o).set(e,n),o},getFinalChunk:pc,finalize:({contents:e,length:t})=>Tc()?e:e.slice(0,t)};const Ic=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Oc={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:uc,buffer:Ic,arrayBuffer:Ic,dataView:Ic,typedArray:Ic,others:fc},getSize:hc,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:mc},Mc=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:o,preserveNewlines:i})=>{const s=new AbortController;return Nc(t,s),Bc({stream:e,controller:s,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},Nc=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Cc=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:o,allMixed:i})=>{const s=new AbortController;$c(t,s,e);const a=e.readableObjectMode&&!i;return Bc({stream:e,controller:s,binary:"buffer"===r,shouldEncode:!a,encoding:r,shouldSplit:!a&&n,preserveNewlines:!o})},$c=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Bc=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s})=>{const a=(0,Ot.on)(e,"data",{signal:t.signal,highWaterMark:jc,highWatermark:jc});return Pc({onStdoutChunk:a,controller:t,binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s})},Ac=(0,Ai.getDefaultHighWaterMark)(!0),jc=Ac,Pc=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s}){const a=Rc({binary:n,shouldEncode:r,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(const[t]of e)yield*us(t,a,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*ps(a)}},Rc=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:o})=>[Zi(e,n,!t),ji(e,o,!r,{})].filter(Boolean),kc=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=Lc({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:a,verboseInfo:l,streamInfo:d});if(!o)return void await Promise.all([Uc(e),u]);const p=Bi(c,n),m=Cc({stream:e,onStreamEnd:t,lines:s,encoding:r,stripFinalNewline:p,allMixed:a}),[f]=await Promise.all([Fc({stream:e,iterable:m,fdNumber:n,encoding:r,maxBuffer:i,lines:s}),u]);return f},Lc=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!xs({stdioItems:s[n]?.stdioItems,encoding:r,verboseInfo:i,fdNumber:n}))return;const a=Cc({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:o});await(async(e,t,n,r)=>{for await(const o of e)Ds(t)||Is(o,n,r)})(a,e,n,i)},Uc=async e=>{await(0,qe.setImmediate)(),null===e.readableFlowing&&e.resume()},Fc=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 Dr(e,bc,t)}(n,{maxBuffer:i}):"buffer"===o?new Uint8Array(await async function(e,t){return Dr(e,Dc,t)}(n,{maxBuffer:i})):await async function(e,t){return Dr(e,Oc,t)}(n,{maxBuffer:i})}catch(n){return Wc((({error:e,stream:t,readableObjectMode:n,lines:r,encoding:o,fdNumber:i})=>{if(!(e instanceof $r))throw e;if("all"===i)return e;const s=Br(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}))}},Gc=async e=>{try{return await e}catch(e){return Wc(e)}},Wc=({bufferedData:e})=>{return t=e,"[object ArrayBuffer]"===u.call(t)?new Uint8Array(e):e;var t},_c=async(e,t,n,{isSameDirection:r,stopOnExit:o=!1}={})=>{const i=zc(e,n),s=new AbortController;try{await Promise.race([...o?[n.exitPromise]:[],(0,fa.finished)(e,{cleanup:!0,signal:s.signal})])}catch(e){i.stdinCleanedUp||Kc(e,t,n,r)}finally{s.abort()}},zc=(e,{originalStreams:[t],subprocess:n})=>{const r={stdinCleanedUp:!1};return e===t&&Vc(e,n,r),r},Vc=(e,t,n)=>{const{_destroy:r}=e;e._destroy=(...o)=>{Hc(t,n),r.call(e,...o)}},Hc=({exitCode:e,signalCode:t},n)=>{null===e&&null===t||(n.stdinCleanedUp=!0)},Kc=(e,t,n,r)=>{if(!qc(e,t,n,r))throw e},qc=(e,t,n,r=!0)=>n.propagating?Qc(e)||Xc(e):(n.propagating=!0,Yc(n,t)===r?Qc(e):Xc(e)),Yc=({fileDescriptors:e},t)=>"all"!==t&&"input"===e[t].direction,Xc=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,Qc=e=>"EPIPE"===e?.code,Jc=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=_c(e,t,l);if(Yc(l,t))return void await d;const[u]=await Promise.all([kc({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},Zc=({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}},el=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,tl=(e,t)=>{const n=ke(e);Be({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:t})},nl=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:o,verboseInfo:i})=>{if(!r)return o;const s=(e=>X(e,"ipc"))(i),a=q(t,"ipc"),c=q(n,"ipc");for await(const t of Zs({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))a&&(Ar(0,o,c),o.push(t)),s&&tl(t,i);return o},rl=async(e,t)=>(await Promise.allSettled([e]),t),ol=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 Bs(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)=>Jc({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})=>Jc({...Zc(e,n),fdNumber:"all",encoding:t,maxBuffer:r[1]+r[2],lines:o[1]||o[2],allMixed:el(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=nl({subprocess:e,buffer:n,maxBuffer:r,ipc:d,ipcOutput:x,verboseInfo:m}),T=il(h,e,w),D=sl(f,w);try{return await Promise.race([Promise.all([{},js(y),Promise.all(v),S,E,Vn(e,u),...T,...D]),b,al(e,g),...Gn(e,i,p,g),...Nt({subprocess:e,cancelSignal:s,gracefulCancel:a,context:p,controller:g}),...Ln({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=>Gc(e)))),Gc(S),rl(E,x),Promise.allSettled(T),Promise.allSettled(D)])}},il=(e,t,n)=>e.map(((e,r)=>e===t.stdio[r]?void 0:_c(e,r,n))),sl=(e,t)=>e.flatMap((({stdioItems:e},n)=>e.filter((({value:e,stream:t=e})=>lr(t,{checkOpen:!1})&&!B(t))).map((({type:e,value:r,stream:o=r})=>_c(o,n,t,{isSameDirection:To.has(e),stopOnExit:"native"===e}))))),al=async(e,{signal:t})=>{const[n]=await(0,Ot.once)(e,"error",{signal:t});throw n},cl=(e,t,n)=>{const r=e[n];r.has(t)||r.set(t,[]);const o=r.get(t),i=Wt();o.push(i);return{resolve:i.resolve.bind(i),promises:o}},ll=async({resolve:e,promises:t},n)=>{e();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},dl=async e=>{if(void 0!==e)try{await ul(e)}catch{}},ul=async e=>{await(0,fa.finished)(e,{cleanup:!0,readable:!1,writable:!0})},pl=async e=>{await(0,fa.finished)(e,{cleanup:!0,readable:!0,writable:!1})},ml=async(e,t)=>{if(await e,t)throw t},fl=(e,t,n)=>{n&&!Xc(n)?e.destroy(n):t&&e.destroy()},hl=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:o=!0,preserveNewlines:i=!0}={})=>{const s=o||Kn.has(n),{subprocessStdout:a,waitReadableDestroy:c}=bl(e,r,t),{readableEncoding:l,readableObjectMode:d,readableHighWaterMark:u}=gl(a,s),{read:p,onStdoutDataDone:m}=yl({subprocessStdout:a,subprocess:e,binary:s,encoding:n,preserveNewlines:i}),f=new Ai.Readable({read:p,destroy:(0,C.callbackify)(Sl.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:u,objectMode:d,encoding:l});return vl({subprocessStdout:a,onStdoutDataDone:m,readable:f,subprocess:e}),f},bl=(e,t,n)=>{const r=zt(e,t);return{subprocessStdout:r,waitReadableDestroy:cl(n,r,"readableDestroy")}},gl=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Ac},yl=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:o})=>{const i=Wt(),s=Mc({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:o});return{read(){wl(this,s,i)},onStdoutDataDone:i}},wl=async(e,t,n)=>{try{const{value:r,done:o}=await t.next();o?n.resolve():e.push(r)}catch{}},vl=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:o})=>{try{await pl(e),await r,await dl(o),await t,n.readable&&n.push(null)}catch(e){await dl(o),xl(n,e)}},Sl=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await ll(n,t)&&(xl(e,r),await ml(t,r))},xl=(e,t)=>{fl(e,e.readable,t)},El=({subprocess:e,concurrentStreams:t},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:o,waitWritableDestroy:i}=Tl(e,n,t),s=new Ai.Writable({...Dl(r,e,o),destroy:(0,C.callbackify)(Nl.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Ml(r,s),s},Tl=(e,t,n)=>{const r=_t(e,t);return{subprocessStdin:r,waitWritableFinal:cl(n,r,"writableFinal"),waitWritableDestroy:cl(n,r,"writableDestroy")}},Dl=(e,t,n)=>({write:Il.bind(void 0,e),final:(0,C.callbackify)(Ol.bind(void 0,e,t,n))}),Il=(e,t,n,r)=>{e.write(t,n)?r():e.once("drain",r)},Ol=async(e,t,n)=>{await ll(n,t)&&(e.writable&&e.end(),await t)},Ml=async(e,t,n)=>{try{await ul(e),t.writable&&t.end()}catch(e){await(async e=>{if(void 0!==e)try{await pl(e)}catch{}})(n),Cl(t,e)}},Nl=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},o)=>{await ll(n,t),await ll(r,t)&&(Cl(e,o),await ml(t,o))},Cl=(e,t)=>{fl(e,e.writable,t)},$l=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||Kn.has(n),{subprocessStdout:c,waitReadableDestroy:l}=bl(e,r,t),{subprocessStdin:d,waitWritableFinal:u,waitWritableDestroy:p}=Tl(e,o,t),{readableEncoding:m,readableObjectMode:f,readableHighWaterMark:h}=gl(c,a),{read:b,onStdoutDataDone:g}=yl({subprocessStdout:c,subprocess:e,binary:a,encoding:n,preserveNewlines:s}),y=new Ai.Duplex({read:b,...Dl(d,e,u),destroy:(0,C.callbackify)(Bl.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 vl({subprocessStdout:c,onStdoutDataDone:g,readable:y,subprocess:e,subprocessStdin:d}),Ml(d,y,c),y},Bl=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([Sl({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},s),Nl({subprocessStdin:t,subprocess:n,waitWritableFinal:o,waitWritableDestroy:i},s)])},Al=(e,t,{from:n,binary:r=!1,preserveNewlines:o=!1}={})=>{const i=r||Kn.has(t),s=zt(e,n),a=Mc({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return jl(a,s,e)},jl=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},Pl=(e,{encoding:t})=>{const n={readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap};e.readable=hl.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=El.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=$l.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=Al.bind(void 0,e,t),e[Symbol.asyncIterator]=Al.bind(void 0,e,t,{})},Rl=(async()=>{})().constructor.prototype,kl=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(Rl,e)])),Ll=(e,t,n,r)=>{const{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:d,fileDescriptors:u}=Ul(e,t,n),{subprocess:p,promise:m}=Gl({file:o,commandArguments:i,options:d,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:u});return p.pipe=cc.bind(void 0,{source:p,sourcePromise:m,boundOptions:{},createNested:r}),((e,t)=>{for(const[n,r]of kl){const o=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:o})}})(p,m),Vt.set(p,{options:d,fileDescriptors:u}),p},Ul=(e,t,n)=>{const{command:r,escapedCommand:o,startTime:i,verboseInfo:s}=ze(e,t,n),{file:a,commandArguments:c,options:l}=Zn(e,t,n),d=Fl(l),u=((e,t)=>mi(ma,e,t,!1))(d,s);return{file:a,commandArguments:c,command:r,escapedCommand:o,startTime:i,verboseInfo:s,options:d,fileDescriptors:u}},Fl=({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}},Gl=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=(0,l.spawn)(e,t,n)}catch(e){return(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:o,startTime:i,verboseInfo:s})=>{Di(r);const a=new l.ChildProcess;ia(a,r),Object.assign(a,{readable:aa,writable:ca,duplex:la});const c=_r({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:o,startTime:i,isSync:!1});return{subprocess:a,promise:da(c,s,o)}})({error:e,command:i,escapedCommand:s,fileDescriptors:a,options:n,startTime:r,verboseInfo:o})}const d=new AbortController;(0,Ot.setMaxListeners)(Number.POSITIVE_INFINITY,d.signal);const u=[...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})=>To.has(e))))Fa(e,t,s,o);for(const{stream:t}of i.filter((({type:e})=>!To.has(e))))Wa({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]:ha(t);Pa(n,e)}})(c,a,d),((e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;const o=(0,Va.cf)((()=>{e.kill()}));(0,Ot.addAbortListener)(r,(()=>{o()}))})(c,n,d);const p={},m=Wt();c.kill=xt.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:m,context:p,controller:d}),c.all=(({stdout:e,stderr:t},{all:n})=>n&&(e||t)?ha([e,t].filter(Boolean)):void 0)(c,n),Pl(c,n),((e,{ipc:t})=>{Object.assign(e,oa(e,!1,t))})(c,n);return{subprocess:c,promise:Wl({subprocess:c,options:n,startTime:r,verboseInfo:o,fileDescriptors:a,originalStreams:u,command:i,escapedCommand:s,context:p,onInternalError:m,controller:d})}},Wl=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 ol({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)=>$i(e,t,n))),y=$i(h,t,"all"),w=_l({errorInfo:u,exitCode:p,signal:m,stdio:g,all:y,ipcOutput:b,context:c,options:t,command:s,escapedCommand:a,startTime:n});return Zr(w,r,t)},_l=({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?zr({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 $r,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:o,ipcOutput:i,options:a,startTime:d,isSync:!1}):Wr({command:c,escapedCommand:l,stdio:r,all:o,ipcOutput:i,options:a,startTime:d}),zl=(e,t)=>{const n=Object.fromEntries(Object.entries(t).map((([t,n])=>[t,Vl(t,e[t],n)])));return{...e,...n}},Vl=(e,t,n)=>Hl.has(e)&&o(t)&&o(n)?{...t,...n}:n,Hl=new Set(["env",...K]),Kl=(e,t,n,r)=>{const o=(e,t,r)=>Kl(e,t,n,r),i=(...i)=>ql({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:o},...i);return void 0!==r&&r(i,o,t),i},ql=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...a)=>{if(o(s))return i(e,zl(n,s),r);const{file:c,commandArguments:l,options:d,isSync:u}=Yl({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}=Us(e,t,n),u=_s({file:r,commandArguments:o,options:l,command:i,escapedCommand:s,verboseInfo:c,fileDescriptors:d,startTime:a});return Zr(u,c,l)})(c,l,d):Ll(c,l,d,i)},Yl=({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=E({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,l,d]=c(...i),u=zl(zl(r,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}},Xl=(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]=Ql(e);return{file:n,commandArguments:r}},Ql=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(Jl)){const t=n.at(-1);t&&t.endsWith("\\")?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Jl=/ +/g,Zl=({options:e})=>({...ed(e),isSync:!0}),ed=e=>({options:{...td(e),...e}}),td=({input:e,inputFile:t,stdio:n})=>void 0===e&&void 0===t&&void 0===n?{stdin:"inherit"}:{},nd=Kl((()=>({}))),rd=Kl((()=>({isSync:!0}))),{sendMessage:od,getOneMessage:sd,getEachMessage:ad,getCancelSignal:cd}=(Kl((({file:e,commandArguments:t})=>Xl(e,t))),Kl((({file:e,commandArguments:t})=>({...Xl(e,t),isSync:!0}))),Kl((({options:e})=>{if(!1===e.node)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}})),Kl((({options:e})=>ed(e)),{},{preferLocal:!0},((e,t,n)=>{e.sync=t(Zl,n),e.s=e.sync})),(()=>{const e=$,t=!0,n=void 0!==$.channel;return{...oa(e,t,n),getCancelSignal:$n.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}})())},5190:(e,t,n)=>{n.d(t,{V:()=>l});var r=n(1708),o=n(6760),i=n(3136);function s(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"}const a=(e,t)=>{let n;for(;n!==t;)e.push(o.join(t,"node_modules/.bin")),n=t,t=o.resolve(t,"..")},c=(e,t,n)=>{const r=t instanceof URL?(0,i.fileURLToPath)(t):t;e.push(o.resolve(n,r,".."))},l=({env:e=r.env,...t}={})=>{const n=s({env:e={...e}});return t.path=e[n],e[n]=(({cwd:e=r.cwd(),path:t=r.env[s()],preferLocal:n=!0,execPath:l=r.execPath,addExecPath:d=!0}={})=>{const u=e instanceof URL?(0,i.fileURLToPath)(e):e,p=o.resolve(u),m=[];return n&&a(m,p),d&&c(m,l,p),[...m,t].join(o.delimiter)})(t),e}},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:()=>c,command:()=>o,description:()=>i});var r=n(9507);const o="git",i="",s=process.cwd();function a(){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}}function c(e){e.command("hooks","Set .githooks as git.hooksPath",{},(()=>{a()&&(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;r=3938,t(t.s=r);
|
|
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")},8905:(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:()=>pl,Kc:()=>ml});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=>B.includes(e),B=[C.stdin,C.stdout,C.stderr],A=["stdin","stdout","stderr"],j=e=>A[e]??`stdio[${e}]`,P=(e,t)=>{const r=Array.from({length:R(e)+1}),n=k(e[t],r,t);return z(n,t)},R=({stdio:e})=>Array.isArray(e)?Math.max(e.length,A.length):A.length,k=(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(A.includes(e))return A.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)(Be,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}),Be=2,Ae=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})?Re++:void 0;let Re=0n;const ke=()=>C.hrtime.bigint(),Le=e=>Number(C.hrtime.bigint()-e)/1e6,Ue=(e,t,r)=>{const n=ke(),{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(5190),_e=n(8500);class ze extends Error{}const Ve=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,He,{value:!0,writable:!1,enumerable:!1,configurable:!1})},He=Symbol("isExecaError"),Ke=e=>"[object Error]"===Object.prototype.toString.call(e);class qe extends Error{}Ve(qe,qe.name);class Ye extends Error{}Ve(Ye,Ye.name);var Xe=n(8161);const Qe=(e,t)=>({name:`SIGRT${t+1}`,number:Je+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Je=34,Ze=[{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"}],et=()=>{const e=(()=>{const e=64-Je+1;return Array.from({length:e},Qe)})();return[...Ze,...e].map(tt)},tt=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{const{signals:{[e]:s}}=Xe.constants,a=void 0!==s;return{name:e,number:a?s:t,description:r,supported:a,action:n,forced:o,standard:i}},rt=({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}],nt=(()=>{const e=et();return Object.fromEntries(e.map(rt))})(),ot=(e,t)=>{const r=t.find((({name:t})=>Xe.constants.signals[t]===e));return void 0!==r?r:t.find((t=>t.number===e))},it=((()=>{const e=et(),t=Array.from({length:65},((t,r)=>((e,t)=>{const r=ot(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:st(e,"`subprocess.kill()`'s argument")),st=(e,t)=>{if(Number.isInteger(e))return at(e,t);if("string"==typeof e)return lt(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${dt()}`)},at=(e,t)=>{if(ct.has(e))return ct.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${dt()}`)},ct=new Map(Object.entries(Xe.constants.signals).reverse().map((([e,t])=>[t,e]))),lt=(e,t)=>{if(e in Xe.constants.signals)return e;if(e.toUpperCase()in Xe.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${dt()}`)},dt=()=>`Available signal names: ${ut()}.\nAvailable signal numbers: ${pt()}.`,ut=()=>Object.keys(Xe.constants.signals).sort().map((e=>`'${e}'`)).join(", "),pt=()=>[...new Set(Object.values(Xe.constants.signals).sort(((e,t)=>e-t)))].join(", "),mt=e=>nt[e].description,ft=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:o,controller:i},s,a)=>{const{signal:c,error:l}=ht(s,a,r);bt(l,n);const d=e(c);return gt({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:d,context:o,controller:i}),d},ht=(e,t,r)=>{const[n=r,o]=Ke(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&&!Ke(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:it(n),error:o}},bt=(e,t)=>{void 0!==e&&t.reject(e)},gt=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:o,context:i,controller:s})=>{t===n&&o&&yt({kill:e,forceKillAfterDelay:r,context:i,controllerSignal:s.signal})},yt=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(!1!==t)try{await(0,_e.setTimeout)(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}},wt=e(import.meta.url)("node:events"),vt=async(e,t)=>{e.aborted||await(0,wt.once)(e,"abort",{signal:t})},St=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:o})=>void 0===t||r?[]:[xt(e,t,n,o)],xt=async(e,t,r,{signal:n})=>{throw await vt(t,n),r.terminationReason??="cancel",e.kill(),t.reason},Et=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{Tt(e,t,r),Dt(e,t,n)},Tt=(e,t,r)=>{if(!r)throw new Error(`${Nt(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Dt=(e,t,r)=>{if(!r)throw new Error(`${Nt(e,t)} cannot be used: the ${$t(t)} has already exited or disconnected.`)},It=(e,t)=>new Error(`${Nt("sendMessage",t)} failed when sending an acknowledgment response to the ${$t(t)}.`,{cause:e}),Ot=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Mt=["could not be cloned","circular structure","call stack size exceeded"],Nt=(e,t,r="")=>"cancelSignal"===e?"`cancelSignal`'s `controller.abort()`":`${Ct(t)}${e}(${r})`,Ct=e=>e?"":"subprocess.",$t=e=>e?"parent process":"subprocess",Bt=e=>{e.connected&&e.disconnect()},At=()=>{const e={},t=new Promise(((t,r)=>{Object.assign(e,{resolve:t,reject:r})}));return Object.assign(t,e)},jt=(e,t="stdin")=>{const r=!0,{options:n,fileDescriptors:o}=Rt.get(e),i=kt(o,t,r),s=e.stdio[i];if(null===s)throw new TypeError(Ft(i,t,n,r));return s},Pt=(e,t="stdout")=>{const r=!1,{options:n,fileDescriptors:o}=Rt.get(e),i=kt(o,t,r),s="all"===i?e.all:e.stdio[i];if(null==s)throw new TypeError(Ft(i,t,n,r));return s},Rt=new WeakMap,kt=(e,t,r)=>{const n=Lt(t,r);return Ut(n,t,r,e),n},Lt=(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(`"${_t(t)}" must not be "${e}".\nIt must be ${n} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${o}".`)},Ut=(e,t,r,n)=>{const o=n[Wt(e)];if(void 0===o)throw new TypeError(`"${_t(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(`"${_t(r)}" must not be ${t}. It must be a readable stream, not writable.`);if("input"!==o.direction&&r)throw new TypeError(`"${_t(r)}" must not be ${t}. It must be a writable stream, not readable.`)},Ft=(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}=Gt(e,r);return`The "${o}: ${zt(i)}" option is incompatible with using "${_t(n)}: ${zt(t)}".\nPlease set this option with "pipe" instead.`},Gt=(e,{stdin:t,stdout:r,stderr:n,stdio:o})=>{const i=Wt(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]}},Wt=e=>"all"===e?1:e,_t=e=>e?"to":"from",zt=e=>"string"==typeof e?`'${e}'`:"number"==typeof e?`${e}`:"Stream",Vt=(e,t,r)=>{const n=e.getMaxListeners();0!==n&&n!==Number.POSITIVE_INFINITY&&(e.setMaxListeners(n+t),(0,wt.addAbortListener)(r,(()=>{e.setMaxListeners(e.getMaxListeners()-t)})))},Ht=(e,t)=>{t&&Kt(e)},Kt=e=>{e.refCounted()},qt=(e,t)=>{t&&Yt(e)},Yt=e=>{e.unrefCounted()},Xt=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},o)=>{if(sr(o)||Tr(o))return;Jt.has(e)||Jt.set(e,[]);const i=Jt.get(e);if(i.push(o),!(i.length>1))for(;i.length>0;){await pr(e,n,o),await _e.scheduler.yield();const s=await ir({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});i.shift(),n.emit("message",s),n.emit("message:done")}},Qt=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{Ir();const i=Jt.get(e);for(;i?.length>0;)await(0,wt.once)(n,"message:done");e.removeListener("message",o),((e,t)=>{t&&(Kt(e),Kt(e))})(t,r),n.connected=!1,n.emit("disconnect")},Jt=new WeakMap,Zt=(e,t,r)=>{if(er.has(e))return er.get(e);const n=new wt.EventEmitter;return n.connected=!0,er.set(e,n),tr({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},er=new WeakMap,tr=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{const o=Xt.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",o),t.once("disconnect",Qt.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:o})),((e,t)=>{t&&(Yt(e),Yt(e))})(r,n)},rr=e=>{const t=er.get(e);return void 0===t?null!==e.channel:t.connected};let nr=0n;const or=(e,t)=>{if(t?.type===dr&&!t.hasListeners)for(const{id:t}of e)void 0!==t&&cr[t].resolve({isDeadlock:!0,hasListeners:!1})},ir=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(e?.type!==dr||!t.connected)return e;const{id:i,message:s}=e,a={id:i,type:ur,message:fr(t,o)};try{await br({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},a)}catch(e){o.emit("strict:error",e)}return s},sr=e=>{if(e?.type!==ur)return!1;const{id:t,message:r}=e;return cr[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},ar=async(e,t,r)=>{if(e?.type!==dr)return;const n=At();cr[e.id]=n;const o=new AbortController;try{const{isDeadlock:e,hasListeners:i}=await Promise.race([n,lr(t,r,o)]);e&&(e=>{throw new Error(`${Nt("sendMessage",e)} failed: the ${$t(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${Nt("getOneMessage",e)},\n\t${Nt("sendMessage",e,"message, {strict: true}")},\n]);`)})(r),i||(e=>{throw new Error(`${Nt("sendMessage",e)} failed: the ${$t(e)} is not listening to incoming messages.`)})(r)}finally{o.abort(),delete cr[e.id]}},cr={},lr=async(e,t,{signal:r})=>{Vt(e,1,r),await(0,wt.once)(e,"disconnect",{signal:r}),(e=>{throw new Error(`${Nt("sendMessage",e)} failed: the ${$t(e)} exited without listening to incoming messages.`)})(t)},dr="execa:ipc:request",ur="execa:ipc:response",pr=async(e,t,r)=>{for(;!fr(e,t)&&mr.get(e)?.size>0;){const t=[...mr.get(e)];or(t,r),await Promise.all(t.map((({onMessageSent:e})=>e)))}},mr=new WeakMap,fr=(e,t)=>t.listenerCount("message")>hr(e),hr=e=>Rt.has(e)&&!K(Rt.get(e).options.buffer,"ipc")?1:0,br=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o,{strict:i=!1}={})=>{const s="sendMessage";return Et({methodName:s,isSubprocess:r,ipc:n,isConnected:e.connected}),gr({anyProcess:e,channel:t,methodName:s,isSubprocess:r,message:o,strict:i})},gr=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=Zt(e,t,r),s=fr(e,i);return{id:nr++,type:dr,message:n,hasListeners:s}})({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:i}),a=((e,t,r)=>{mr.has(e)||mr.set(e,new Set);const n=mr.get(e),o={onMessageSent:At(),id:r?t.id:void 0};return n.add(o),{outgoingMessages:n,outgoingMessage:o}})(e,s,i);try{await yr({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:s,message:o})}catch(t){throw Bt(e),t}finally{(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()})(a)}},yr=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:o})=>{const i=wr(e);try{await Promise.all([ar(n,e,r),i(n)])}catch(e){throw(({error:e,methodName:t,isSubprocess:r})=>{if("EPIPE"===e.code)throw new Error(`${Nt(t,r)} cannot be used: the ${$t(r)} is disconnecting.`,{cause:e})})({error:e,methodName:t,isSubprocess:r}),(({error:e,methodName:t,isSubprocess:r,message:n})=>{if((({code:e,message:t})=>Ot.has(e)||Mt.some((e=>t.includes(e))))(e))throw new Error(`${Nt(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}},wr=e=>{if(vr.has(e))return vr.get(e);const t=(0,N.promisify)(e.send.bind(e));return vr.set(e,t),t},vr=new WeakMap,Sr=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await xr({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Or.signal),xr=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{Er||(Er=!0,n?null!==t?(Zt(e,t,r),await _e.scheduler.yield()):Ir():(()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")})())};let Er=!1;const Tr=e=>e?.type===Dr&&(Or.abort(e.message),!0),Dr="execa:ipc:cancel",Ir=()=>{Or.abort(new Error(`\`cancelSignal\` aborted: the ${$t(!0)} disconnected.`))},Or=new AbortController,Mr=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:i})=>r?[Nr({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:o,controller:i})]:[],Nr=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await vt(t,o);const i=Cr(t);throw await((e,t)=>{const r="cancelSignal";return Dt(r,!1,e.connected),yr({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:Dr,message:t},message:t})})(e,i),yt({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",t.reason},Cr=({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},$r=(e,t,r,n)=>0===t||void 0===t?[]:[Br(e,t,r,n)],Br=async(e,t,r,{signal:n})=>{throw await(0,_e.setTimeout)(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new ze},Ar=e(import.meta.url)("node:v8"),jr={advanced:e=>{try{(0,Ar.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})}}},Pr=async(e,t)=>{void 0!==t&&await e.sendMessage(t)},Rr=new Set(["utf8","utf16le"]),kr=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Lr=new Set([...Rr,...kr]),Ur={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Fr=e=>"string"==typeof e?`"${e}"`:String(e),Gr=()=>{try{return C.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},Wr=(e,t,r)=>{r.cwd=((e=Gr())=>{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=_r(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(Lr.has(e))return;const t=(e=>{if(null===e)return"buffer";if("string"!=typeof e)return;const t=e.toLowerCase();return t in Ur?Ur[t]:Lr.has(t)?t:void 0})(e);if(void 0!==t)throw new TypeError(`Invalid option \`encoding: ${Fr(e)}\`.\nPlease rename it to ${Fr(t)}.`);const r=[...Lr].map((e=>Fr(e))).join(", ");throw new TypeError(`Invalid option \`encoding: ${Fr(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`.");jr[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=zr(p),p.killSignal=(e=>{const t="option `killSignal`";if(0===e)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return st(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&&!kr.has(p.encoding)&&p.buffer[t])),"win32"===C.platform&&"cmd"===Fe.basename(c,".exe")&&l.unshift("/q"),{file:c,commandArguments:l,options:p}},_r=({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}),zr=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:o,nodePath:i})=>{const s=t?{...C.env,...e}:e;return r||n?(0,We.V)({env:s,cwd:o,execPath:i,preferLocal:r,addExecPath:n}):s};function Vr(e){if("string"==typeof e)return Hr(e);if(!ArrayBuffer.isView(e)||1!==e.BYTES_PER_ELEMENT)throw new Error("Input must be a string or a Uint8Array");return Kr(e)}const Hr=e=>e.at(-1)===qr?e.slice(0,e.at(-2)===Xr?-2:-1):e,Kr=e=>e.at(-1)===Yr?e.subarray(0,e.at(-2)===Qr?-2:-1):e,qr="\n",Yr=qr.codePointAt(0),Xr="\r",Qr=Xr.codePointAt(0);function Jr(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 Zr(e,{checkOpen:t=!0}={}){return Jr(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 en(e,{checkOpen:t=!0}={}){return Jr(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 tn(e,t){return Zr(e,t)&&en(e,t)}const rn=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class nn{#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 on=Symbol();function sn(){return this[on].next()}function an(e){return this[on].return(e)}Object.defineProperty(sn,"name",{value:"next"}),Object.defineProperty(an,"name",{value:"return"});const cn=Object.create(rn,{next:{enumerable:!0,configurable:!0,writable:!0,value:sn},return:{enumerable:!0,configurable:!0,writable:!0,value:an}});function ln({preventCancel:e=!1}={}){const t=this.getReader(),r=new nn(t,e),n=Object.create(cn);return n[on]=r,n}const dn=e=>{if(en(e,{checkOpen:!1})&&void 0!==fn.on)return pn(e);if("function"==typeof e?.[Symbol.asyncIterator])return e;if("[object ReadableStream]"===un.call(e))return ln.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:un}=Object.prototype,pn=async function*(e){const t=new AbortController,r={};mn(e,t,r);try{for await(const[r]of fn.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()}},mn=async(e,t,r)=>{try{await fn.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){r.error=e}finally{t.abort()}},fn={},hn=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const l=dn(e),d=t();d.length=0;try{for await(const e of l){const t=r[wn(e)](e,d);gn({convertedChunk:t,state:d,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:c})}return bn({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}},bn=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{const s=o(e);void 0!==s&&gn({convertedChunk:s,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},gn=({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 yn(e,t,o,a);const c=n(e,i-t.length);throw void 0!==c&&yn(c,t,o,i),new Sn},yn=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},wn=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=vn.call(e);return"[object ArrayBuffer]"===r?"arrayBuffer":"[object DataView]"===r?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===vn.call(e.buffer)?"typedArray":"others"},{toString:vn}=Object.prototype;class Sn extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const xn=(e,t,r)=>{if(t.length!==r)return;const n=new Sn;throw n.maxBufferInfo={fdNumber:"ipc"},n},En=([,e])=>e,Tn=({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=Dn(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} (${mt(m)})${f}`:void 0!==s?`Command was killed with ${s} (${a})`:void 0!==c?`Command failed with exit code ${c}`:"Command failed"},Dn=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",In=e=>"string"==typeof e?e:p(e)?g(e):"",On=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:o,options:{cwd:i},startTime:s})=>$n({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:[]}),Mn=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:s})=>Nn({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}),Nn=({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}=Bn(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=Tn({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 ze)return;const r=Ke(n=e)&&He in n?e.originalMessage:String(e?.message??e);var n;const o=te(((e,t)=>{if(t===Gr())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(Vr((e=>Array.isArray(e)?e.map((e=>Vr(In(e)))).filter(Boolean).join("\n"):In(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?Ye:qe)(t,e instanceof ze?{}:{cause:e}))(e,I,v);return Object.assign(O,Cn({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},Cn=({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})=>$n({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:[]}),$n=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e))),Bn=(e,t)=>{const r=null===t?void 0:t;return{exitCode:null===e?void 0:e,signal:r,signalDescription:void 0===r?void 0:mt(t)}},An=e=>Number.isFinite(e)?e:0;function jn(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(An(1e3*e)%1e3),nanoseconds:Math.trunc(An(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 Pn=(e,t)=>{const r=`(done in ${jn(e.durationMs)})`;Me({type:"duration",verboseMessage:r,verboseInfo:t,result:e})},Rn=(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),Pn(e,t))})(e,t),e.failed&&r)throw e;return e},kn=(e,t)=>Hn(e)?"asyncGenerator":Kn(e)?"generator":Yn(e)?"fileUrl":Xn(e)?"filePath":to(e)?"webStream":Jr(e,{checkOpen:!1})?"native":p(e)?"uint8Array":no(e)?"asyncIterable":oo(e)?"iterable":ro(e)?Fn({transform:e},t):qn(e)?Ln(e,t):"native",Ln=(e,t)=>tn(e.transform,{checkOpen:!1})?Un(e,t):ro(e.transform)?Fn(e,t):_n(e,t),Un=(e,t)=>(Gn(e,t,"Duplex stream"),"duplex"),Fn=(e,t)=>(Gn(e,t,"web TransformStream"),"webTransform"),Gn=({final:e,binary:t,objectMode:r},n,o)=>{Wn(e,`${n}.final`,o),Wn(t,`${n}.binary`,o),zn(r,`${n}.objectMode`)},Wn=(e,t,r)=>{if(void 0!==e)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},_n=({transform:e,final:t,binary:r,objectMode:n},o)=>{if(void 0!==e&&!Vn(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(tn(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(ro(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(void 0!==t&&!Vn(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return zn(r,`${o}.binary`),zn(n,`${o}.objectMode`),Hn(e)||Hn(t)?"asyncGenerator":"generator"},zn=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw new TypeError(`The \`${t}\` option must use a boolean.`)},Vn=e=>Hn(e)||Kn(e),Hn=e=>"[object AsyncGeneratorFunction]"===Object.prototype.toString.call(e),Kn=e=>"[object GeneratorFunction]"===Object.prototype.toString.call(e),qn=e=>o(e)&&(void 0!==e.transform||void 0!==e.final),Yn=e=>"[object URL]"===Object.prototype.toString.call(e),Xn=e=>o(e)&&1===Object.keys(e).length&&Qn(e.file),Qn=e=>"string"==typeof e,Jn=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Zn=e=>"[object ReadableStream]"===Object.prototype.toString.call(e),eo=e=>"[object WritableStream]"===Object.prototype.toString.call(e),to=e=>Zn(e)||eo(e),ro=e=>Zn(e?.readable)&&eo(e?.writable),no=e=>io(e)&&"function"==typeof e[Symbol.asyncIterator],oo=e=>io(e)&&"function"==typeof e[Symbol.iterator],io=e=>"object"==typeof e&&null!==e,so=new Set(["generator","asyncGenerator","duplex","webTransform"]),ao=new Set(["fileUrl","filePath","fileNumber"]),co=new Set(["fileUrl","filePath"]),lo=new Set([...co,"webStream","nodeStream"]),uo=new Set(["webTransform","duplex"]),po={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"},mo=(e,t,r,n)=>"output"===n?fo(e,t,r):ho(e,t,r),fo=(e,t,r)=>{const n=0!==t&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},ho=(e,t,r)=>{const n=0===t?!0===e:r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t!==r.length-1&&(e??n)}},bo=(e,t,r,{encoding:n})=>{const o=e.filter((({type:e})=>so.has(e))),i=Array.from({length:o.length});for(const[e,s]of Object.entries(o))i[e]=go({stdioItem:s,index:Number(e),newTransforms:i,optionName:t,direction:r,encoding:n});return So(i,r)},go=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:o,direction:i,encoding:s})=>"duplex"===t?yo({stdioItem:e,optionName:o}):"webTransform"===t?wo({stdioItem:e,index:r,newTransforms:n,direction:i}):vo({stdioItem:e,index:r,newTransforms:n,direction:i,encoding:s}),yo=({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}}},wo=({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}=mo(a,r,n,i);return{...e,value:{transform:s,writableObjectMode:c,readableObjectMode:l}}},vo=({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||kr.has(s),{writableObjectMode:m,readableObjectMode:f}=mo(u,r,n,i);return{...e,value:{transform:a,final:c,binary:p,preserveNewlines:d,writableObjectMode:m,readableObjectMode:f}}},So=(e,t)=>"input"===t?e.reverse():e,xo=["input","output","output"],Eo=()=>{},To=()=>"input",Do={generator:Eo,asyncGenerator:Eo,fileUrl:Eo,filePath:Eo,iterable:To,asyncIterable:To,uint8Array:To,webStream:e=>eo(e)?"output":"input",nodeStream:e=>en(e,{checkOpen:!1})?Zr(e,{checkOpen:!1})?void 0:"input":"output",webTransform:Eo,duplex:Eo,native(e){const t=Io(e);return void 0!==t?t:Jr(e,{checkOpen:!1})?Do.nodeStream(e):void 0}},Io=e=>[0,C.stdin].includes(e)?"input":[1,2,C.stdout,C.stderr].includes(e)?"output":void 0,Oo=e=>A.some((t=>void 0!==e[t])),Mo=(e,t)=>Array.isArray(e)?e.map((e=>Mo(e,t))):null==e?t>=A.length?"ignore":"pipe":e,No=e=>"pipe"===e||Array.isArray(e)&&e.every((e=>"pipe"===e)),Co=({value:e,optionName:t,fdNumber:r,direction:n})=>{const o=$o(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}: ${zt(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:m((0,ee.readFileSync)(o)),optionName:t}}},$o=(e,t)=>{if("inherit"===e)return t;if("number"==typeof e)return e;const r=B.indexOf(e);return-1!==r?r:void 0},Bo=(e,t,r)=>{const n=B[e];if(void 0===n)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n},Ao=({input:e,inputFile:t},r)=>0===r?[...jo(e),...Ro(t)]:[],jo=e=>void 0===e?[]:[{type:Po(e),value:e,optionName:"input"}],Po=e=>{if(en(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.")},Ro=e=>void 0===e?[]:[{...ko(e),optionName:"inputFile"}],ko=e=>{if(Yn(e))return{type:"fileUrl",value:e};if(Qn(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},Lo=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{const i=e.filter((e=>Uo(e,r)));if(0===i.length)return;const s=i.find((e=>e.direction!==o));return Fo(s,n,t),"output"===o?i[0].stream:void 0},Uo=({type:e,value:t},r)=>"filePath"===e?t.file===r.file:"fileUrl"===e?t.href===r.href:t===r,Fo=(e,t,r)=>{if(void 0!==e)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${po[r]} that is the same.`)},Go=(e,t,r,n)=>{const o=(({stdio:e,ipc:t,buffer:r,...n},o,i)=>{const s=((e,t)=>{if(void 0===e)return A.map((e=>t[e]));if(Oo(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${A.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,A.length);return Array.from({length:r},((t,r)=>e[r]))})(e,n).map(((e,t)=>Mo(e,t)));return i?((e,t,r)=>e.map(((e,n)=>t[n]||0===n||Y(r,n)||!No(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)=>Wo({stdioOption:e,fdNumber:r,options:t,isSync:n}))),s=Xo({initialFileDescriptors:i,addProperties:e,options:t,isSync:n});return t.stdio=s.map((({stdioItems:e})=>ei(e))),s},Wo=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{const o=j(t),{stdioItems:i,isStdioArray:s}=_o({stdioOption:e,fdNumber:t,options:r,optionName:o}),a=((e,t,r)=>{const n=e.map((e=>(({type:e,value:t},r)=>xo[r]??Do[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=Co({value:t,optionName:r,fdNumber:n,direction:o});if(void 0!==i)return i;if(Jr(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:Bo(n,t,r),optionName:r}:"number"==typeof t?{type:"nodeStream",value:Bo(t,t,r),optionName:r}:Jr(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})=>!so.has(e))),...bo(e,t,r,n)])(c,o,a,r),d=((e,t)=>{const r=e.findLast((({type:e})=>so.has(e)));return void 0!==r&&("input"===t?r.value.writableObjectMode:r.value.readableObjectMode)})(l,a);return Yo(l,d),{direction:a,objectMode:d,stdioItems:l}},_o=({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=>zo(e,n))),...Ao(r,t)]),i=o.length>1;return Vo(o,i,n),Ko(o),{stdioItems:o,isStdioArray:i}},zo=(e,t)=>({type:kn(e,t),value:e,optionName:t}),Vo=(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(Ho.has(t))throw new Error(`The \`${r}\` option must not include \`${t}\`.`)},Ho=new Set(["ignore","ipc"]),Ko=e=>{for(const t of e)qo(t)},qo=({type:e,value:t,optionName:r})=>{if((e=>Yn(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&&!Jn.has(t))(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Yo=(e,t)=>{if(!t)return;const r=e.find((({type:e})=>ao.has(e)));if(void 0!==r)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},Xo=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{const o=[];try{for(const i of e)o.push(Qo({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:r,isSync:n}));return o}catch(e){throw Zo(o),e}},Qo=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:o,options:i,isSync:s})=>{const a=r.map((t=>Jo({stdioItem:t,addProperties:o,direction:e,options:i,fileDescriptors:n,isSync:s})));return{direction:e,objectMode:t,stdioItems:a}},Jo=({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 lo.has(e)?Lo({otherStdioItems:s,type:e,value:t,optionName:r,direction:n}):void(uo.has(e)&&(({otherStdioItems:e,type:t,value:r,optionName:n})=>{const o=e.find((({value:{transform:e}})=>e===r.transform));Fo(o,n,t)})({otherStdioItems:s,type:e,value:t,optionName:r}));(({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{co.has(t)&&Lo({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)}},Zo=e=>{for(const{stdioItems:t}of e)for(const{stream:e}of t)void 0===e||$(e)||e.destroy()},ei=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"},ti=({type:e,optionName:t})=>{ri(t,po[e])},ri=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},ni={generator(){},asyncGenerator:ti,webStream:ti,nodeStream:ti,webTransform:ti,duplex:ti,asyncIterable:ti,native:({optionName:e,value:t})=>("ipc"!==t&&"overlapped"!==t||ri(e,`"${t}"`),{})},oi={input:{...ni,fileUrl:({value:e})=>({contents:[m((0,ee.readFileSync)(e))]}),filePath:({value:{file:e}})=>({contents:[m((0,ee.readFileSync)(e))]}),fileNumber:ti,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...ni,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e}})=>({path:e}),fileNumber:({value:e})=>({path:e}),iterable:ti,string:ti,uint8Array:ti}},ii=(e,{stripFinalNewline:t},r)=>si(t,r)&&void 0!==e&&!Array.isArray(e)?Vr(e):e,si=(e,t)=>"all"===t?e[1]||e[2]:e[t];var ai=n(7075);const ci=(e,t,r,n)=>e||r?void 0:ui(t,n),li=(e,t,r)=>r?e.flatMap((e=>di(e,t))):di(e,t),di=(e,t)=>{const{transform:r,final:n}=ui(t,{});return[...r(e),...n()]},ui=(e,t)=>(t.previousChunks="",{transform:pi.bind(void 0,t,e),final:fi.bind(void 0,t)}),pi=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=mi(r,i,t,e);let a=r.slice(o+1,i+1-s);n.length>0&&(a=gi(n,a),n=""),yield a,o=i}o!==r.length-1&&(n=gi(n,r.slice(o+1))),e.previousChunks=n},mi=(e,t,r,n)=>r?0:(n.isWindowsNewline=0!==t&&"\r"===e[t-1],n.isWindowsNewline?2:1),fi=function*({previousChunks:e}){e.length>0&&(yield e)},hi=({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:bi.bind(void 0,n)},bi=function*({isWindowsNewline:e=!1},t){const{unixNewline:r,windowsNewline:n,LF:o,concatBytes:i}="string"==typeof t?yi:wi;if(t.at(-1)===o)return void(yield t);const s=e?n:r;yield i(t,s)},gi=(e,t)=>`${e}${t}`,yi={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:gi},wi={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 vi=n(4573);const Si=(e,t)=>e?void 0:xi.bind(void 0,t),xi=function*(e,t){if("string"!=typeof t&&!p(t)&&!vi.Buffer.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Ei=(e,t)=>e?Ti.bind(void 0,t):Di.bind(void 0,t),Ti=function*(e,t){Ii(e,t),yield t},Di=function*(e,t){if(Ii(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},Ii=(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; }`)},Oi=(e,t,r)=>{if(r)return;if(e)return{transform:Mi.bind(void 0,new TextEncoder)};const n=new d.StringDecoder(t);return{transform:Ni.bind(void 0,n),final:Ci.bind(void 0,n)}},Mi=function*(e,t){vi.Buffer.isBuffer(t)?yield m(t):"string"==typeof t?yield e.encode(t):yield t},Ni=function*(e,t){yield p(t)?e.write(t):t},Ci=function*(e){const t=e.end();""!==t&&(yield t)},$i=(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}})),Bi=async function*(e,t,r){if(r===t.length)return void(yield e);const{transform:n=Ri}=t[r];for await(const o of n(e))yield*Bi(o,t,r+1)},Ai=async function*(e){for(const[t,{final:r}]of Object.entries(e))yield*ji(r,Number(t),e)},ji=async function*(e,t,r){if(void 0!==e)for await(const n of e())yield*Bi(n,r,t+1)},Pi=(0,N.callbackify)((async({currentIterable:e},t)=>{if(void 0===e){if(t)throw t}else await(t?e.throw(t):e.return())})),Ri=function*(e){yield e},ki=(e,t,r,n)=>{try{for(const n of e(...t))r.push(n);n()}catch(e){n(e)}},Li=(e,t)=>[...t.flatMap((t=>[...Ui(t,e,0)])),...Fi(e)],Ui=function*(e,t,r){if(r===t.length)return void(yield e);const{transform:n=Wi}=t[r];for(const o of n(e))yield*Ui(o,t,r+1)},Fi=function*(e){for(const[t,{final:r}]of Object.entries(e))yield*Gi(r,Number(t),e)},Gi=function*(e,t,r){if(void 0!==e)for(const n of e())yield*Ui(n,r,t+1)},Wi=function*(e){yield e},_i=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:o},optionName:i},{encoding:s})=>{const a={},c=Vi(e,s,i),l=Hn(t),d=Hn(r),u=l?$i.bind(void 0,Bi,a):ki.bind(void 0,Ui),p=l||d?$i.bind(void 0,Ai,a):ki.bind(void 0,Fi),m=l||d?Pi.bind(void 0,a):void 0;return{stream:new ai.Transform({writableObjectMode:n,writableHighWaterMark:(0,ai.getDefaultHighWaterMark)(n),readableObjectMode:o,readableHighWaterMark:(0,ai.getDefaultHighWaterMark)(o),transform(e,t,r){u([e,c,0],this,r)},flush(e){p([c],this,e)},destroy:m})}},zi=(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=Vi(t,r,n);e=Li(o,e)}return e},Vi=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:i},s,a)=>{const c={};return[{transform:Si(n,a)},Oi(r,s,n),ci(r,i,n,c),{transform:e,final:t},{transform:Ei(o,a)},hi({binary:r,preserveNewlines:i,readableObjectMode:o,state:c})].filter(Boolean)},Hi=(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 ${po[e]} with synchronous methods.`)}const i=o.map((({contents:e})=>e)).map((e=>Ki(e,n)));r.input=y(i)},Ki=(e,t)=>{const r=zi(e,t,"utf8",!0);return qi(r),y(r)},qi=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}.`)},Yi=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>"all"!==n&&Y(r,n)&&!kr.has(t)&&Xi(n)&&(e.some((({type:e,value:t})=>"native"===e&&Qi.has(t)))||e.every((({type:e})=>so.has(e)))),Xi=e=>1===e||2===e,Qi=new Set(["pipe","overlapped"]),Ji=e=>e._readableState.pipes.length>0,Zi=(e,t,r)=>{const n=Ae(e);Me({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})},es=(e,t,r,n)=>{try{return zi(e,t,r,!1)}catch(t){return n.error=t,e}},ts=({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:li(s,!o[i],t)}:{serializedResult:s}},rs=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:o,stdioItems:i,objectMode:s})=>{if(!Yi({stdioItems:i,encoding:o,verboseInfo:n,fdNumber:t}))return;const a=li(e,!1,s);try{((e,t,r)=>{for(const n of e)Zi(n,t,r)})(a,t,n)}catch(e){r.error??=e}},ns=(e,t,r)=>{for(const{path:n}of t.filter((({type:e})=>ao.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))}},os=async e=>{try{return await(0,wt.once)(e,"exit")}catch{return os(e)}},is=async e=>{const[t,r]=await e;if(!ss(t,r)&&as(t,r))throw new ze;return[t,r]},ss=(e,t)=>void 0===e&&void 0===t,as=(e,t)=>0!==e||null!==t,cs=(e,t,r)=>void 0!==e?e:as(t,r)?new ze:void 0,ls=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,ds=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&us("ipcInput"),e&&us("ipc: true"),r&&us("detached: true"),n&&us("cancelSignal")},us=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},ps=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:a})=>{const c=ms({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=cs(e,t,r),s="ETIMEDOUT"===i?.code,a=((e,t,r)=>"ENOBUFS"===e?.code&&null!==t&&t.some((e=>null!==e&&e.length>En(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=En(r);return e.length>n?e.slice(0,n):e})(e,i,u),f=m(p),{stdioItems:h,objectMode:b}=t[r],g=es([f],h,c,n),{serializedResult:y,finalResult:w=y}=ts({chunks:g,objectMode:b,encoding:c,lines:l,stripFinalNewline:d,fdNumber:r});rs({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&&ns(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)=>ii(e,r,t))),w=ii((([,e,t],r)=>{if(r.all)return void 0===e?t:void 0===t?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,ii(t,r,"all")]:Array.isArray(t)?[ii(e,r,"all"),...t]:p(e)&&p(t)?v([e,t]):`${e}${t}`})(b,r),r,"all");return hs({error:g,exitCode:d,signal:u,timedOut:f,isMaxBuffer:h,stdio:y,all:w,options:r,command:n,escapedCommand:o,startTime:a})},ms=({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))Hi(e,r,t)})(i,r);const n=fs(r);return(0,l.spawnSync)(e,t,n)}catch(e){return Mn({error:e,command:n,escapedCommand:o,fileDescriptors:i,options:r,startTime:s,isSync:!0})}},fs=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:En(t)}),hs=({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?On({command:c,escapedCommand:l,stdio:i,all:s,ipcOutput:[],options:a,startTime:d}):Nn({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}),bs=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0,filter:i}={})=>(Et({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:rr(e)}),gs({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:o})),gs=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:o})=>{Ht(t,o);const i=Zt(e,t,r),s=new AbortController;try{return await Promise.race([ys(i,n,s),ws(i,r,s),vs(i,r,s)])}catch(t){throw Bt(e),t}finally{s.abort(),qt(t,o)}},ys=async(e,t,{signal:r})=>{if(void 0===t){const[t]=await(0,wt.once)(e,"message",{signal:r});return t}for await(const[n]of(0,wt.on)(e,"message",{signal:r}))if(t(n))return n},ws=async(e,t,{signal:r})=>{await(0,wt.once)(e,"disconnect",{signal:r}),(e=>{throw new Error(`${Nt("getOneMessage",e)} could not complete: the ${$t(e)} exited or disconnected.`)})(t)},vs=async(e,t,{signal:r})=>{const[n]=await(0,wt.once)(e,"strict:error",{signal:r});throw It(n,t)},Ss=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0}={})=>xs({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),xs=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:o,reference:i})=>{Et({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:rr(e)}),Ht(t,i);const s=Zt(e,t,r),a=new AbortController,c={};return Es(e,s,a),Ts({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),Ds({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:r,shouldAwait:o,controller:a,state:c,reference:i})},Es=async(e,t,r)=>{try{await(0,wt.once)(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},Ts=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{const[o]=await(0,wt.once)(e,"strict:error",{signal:r.signal});n.error=It(o,t),r.abort()}catch{}},Ds=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,wt.on)(r,"message",{signal:i.signal}))Is(s),yield e}catch{Is(s)}finally{i.abort(),qt(t,a),n||Bt(e),o&&await e}},Is=({error:e})=>{if(e)throw e},Os=(e,t,r)=>({sendMessage:br.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:bs.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:Ss.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}),Ms=()=>{const e=new ai.PassThrough;return e.end(),e},Ns=()=>new ai.Readable({read(){}}),Cs=()=>new ai.Writable({write(){}}),$s=()=>new ai.Duplex({read(){},write(){}}),Bs=async(e,t,r)=>Rn(e,t,r),As=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${po[e]}.`)},js={fileNumber:As,generator:_i,asyncGenerator:_i,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){const n=t||r;return{stream:ai.Duplex.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Ps={input:{...js,fileUrl:({value:e})=>({stream:(0,ee.createReadStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,ee.createReadStream)(e)}),webStream:({value:e})=>({stream:ai.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:ai.Readable.from(e)}),asyncIterable:({value:e})=>({stream:ai.Readable.from(e)}),string:({value:e})=>({stream:ai.Readable.from(e)}),uint8Array:({value:e})=>({stream:ai.Readable.from(vi.Buffer.from(e))})},output:{...js,fileUrl:({value:e})=>({stream:(0,ee.createWriteStream)(e)}),filePath:({value:{file:e}})=>({stream:(0,ee.createWriteStream)(e)}),webStream:({value:e})=>({stream:ai.Writable.fromWeb(e)}),iterable:As,asyncIterable:As,string:As,uint8Array:As}},Rs=e(import.meta.url)("node:stream/promises");function ks(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const t of e)_s(t);const t=e.some((({readableObjectMode:e})=>e)),r=Ls(e,t),n=new Us({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(const t of e)n.add(t);return n}const Ls=(e,t)=>{if(0===e.length)return(0,ai.getDefaultHighWaterMark)(t);const r=e.filter((({readableObjectMode:e})=>e===t)).map((({readableHighWaterMark:e})=>e));return Math.max(...r)};class Us extends ai.PassThrough{#s=new Set([]);#a=new Set([]);#c=new Set([]);#l;#d=Symbol("unpipe");#u=new WeakMap;add(e){if(_s(e),this.#s.has(e))return;this.#s.add(e),this.#l??=Fs(this,this.#s,this.#d);const t=zs({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(_s(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 Fs=async(e,t,r)=>{ea(e,ta);const n=new AbortController;try{await Promise.race([Gs(e,n),Ws(e,t,r,n)])}finally{n.abort(),ea(e,-ta)}},Gs=async(e,{signal:t})=>{try{await(0,Rs.finished)(e,{signal:t,cleanup:!0})}catch(t){throw Ys(e,t),t}},Ws=async(e,t,r,{signal:n})=>{for await(const[o]of(0,wt.on)(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},_s=e=>{if("function"!=typeof e?.pipe)throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},zs=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{ea(e,ra);const a=new AbortController;try{await Promise.race([Vs(i,t,a),Hs({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),Ks({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),ea(e,-ra)}r.size>0&&r.size===n.size+o.size&&(0===n.size&&o.size>0?Qs(e):qs(e))},Vs=async(e,t,{signal:r})=>{try{await e,r.aborted||Qs(t)}catch(e){r.aborted||Ys(t,e)}},Hs=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await(0,Rs.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;Xs(n)?o.add(t):Js(e,n)}},Ks=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await(0,wt.once)(e,o,{signal:i}),!e.readable)return(0,wt.once)(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},qs=e=>{e.writable&&e.end()},Ys=(e,t)=>{Xs(t)?Qs(e):Js(e,t)},Xs=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,Qs=e=>{(e.readable||e.writable)&&e.destroy()},Js=(e,t)=>{e.destroyed||(e.once("error",Zs),e.destroy(t))},Zs=()=>{},ea=(e,t)=>{const r=e.getMaxListeners();0!==r&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},ta=2,ra=1,na=(e,t)=>{e.pipe(t),oa(e,t),sa(e,t)},oa=async(e,t)=>{if(!$(e)&&!$(t)){try{await(0,Rs.finished)(e,{cleanup:!0,readable:!0,writable:!1})}catch{}ia(t)}},ia=e=>{e.writable&&e.end()},sa=async(e,t)=>{if(!$(e)&&!$(t)){try{await(0,Rs.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}aa(e)}},aa=e=>{e.readable&&e.destroy()},ca=(e,t,r,n)=>{"output"===r?na(e.stdio[n],t):na(t,e.stdio[n]);const o=la[n];void 0!==o&&(e[o]=t),e.stdio[n]=t},la=["stdin","stdout","stderr"],da=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:o,controller:i})=>{if(void 0===t)return;ua(t,i);const[s,a]="output"===r?[t,e.stdio[n]]:[e.stdio[n],t],c=o.get(s)??[];o.set(s,[...c,a])},ua=(e,{signal:t})=>{$(e)&&Vt(e,pa,t)},pa=2;var ma=n(7017);const fa=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(ha,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(ha)(o,i,s),pipeOptions:s}}if(Rt.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}`)},ha=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),ba=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>Mn({error:e,command:ga,escapedCommand:ga,fileDescriptors:t,options:r,startTime:n,isSync:!1}),ga="source.pipe(destination)",ya=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},wa=new WeakMap,va=(e,t)=>void 0===e?[]:[Sa(e,t)],Sa=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 ba({error:s,fileDescriptors:n,sourceOptions:o,startTime:i})},xa=(e,...t)=>{if(o(t[0]))return xa.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});const{destination:r,...n}=(({source:e,sourcePromise:t,boundOptions:r,createNested:n},...o)=>{const i=ke(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:d}=((e,t,r)=>{try{const{destination:n,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=fa(e,t,...r);return{destination:n,destinationStream:jt(n,i),from:o,unpipeSignal:s}}catch(e){return{destinationError:e}}})(r,n,o),{sourceStream:u,sourceError:p}=((e,t)=>{try{return{sourceStream:Pt(e,t)}}catch(e){return{sourceError:e}}})(e,l),{options:m,fileDescriptors:f}=Rt.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=Ea({...n,destination:r});return i.pipe=xa.bind(void 0,{...e,source:r,sourcePromise:i,boundOptions:{}}),i},Ea=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:o,destinationStream:i,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{const d=Ta(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?(aa(e),n):void 0!==t?(ia(r),t):void 0)({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(void 0!==a)throw ba({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=wa.has(t)?((e,t)=>{const r=wa.get(t);return r.add(e),r})(e,t):((e,t)=>{const r=ks([e]);return na(r,t),wa.set(t,r),r})(e,t);return Vt(e,2,r.signal),Vt(t,1,r.signal),(async e=>{try{await(0,Rs.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}wa.delete(e)})(t),n})(t,i,u);return await Promise.race([ya(d),...va(a,{sourceStream:t,mergedStream:e,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{u.abort()}},Ta=(e,t)=>Promise.allSettled([e,t]),Da=e=>e,Ia=()=>{},Oa=({contents:e})=>e,Ma=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Na=e=>e.length,Ca={init:()=>({contents:[]}),convertChunk:{string:Da,buffer:Da,arrayBuffer:Da,dataView:Da,typedArray:Da,others:Da},getSize:()=>1,truncateChunk:Ia,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:Ia,finalize:Oa},$a=new TextEncoder,Ba=e=>new Uint8Array(e),Aa=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ja=e=>Pa**Math.ceil(Math.log(e)/Math.log(Pa)),Pa=2,Ra=()=>"resize"in ArrayBuffer.prototype,ka={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>$a.encode(e),buffer:Ba,arrayBuffer:Ba,dataView:Aa,typedArray:Aa,others:Ma},getSize:Na,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:r},n)=>{const o=Ra()?((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;const r=new ArrayBuffer(t,{maxByteLength:ja(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(ja(t));return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,n);return new Uint8Array(o).set(e,r),o},getFinalChunk:Ia,finalize:({contents:e,length:t})=>Ra()?e:e.slice(0,t)},La=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Ua={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:Da,buffer:La,arrayBuffer:La,dataView:La,typedArray:La,others:Ma},getSize:Na,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:Oa},Fa=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:o,preserveNewlines:i})=>{const s=new AbortController;return Ga(t,s),za({stream:e,controller:s,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},Ga=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Wa=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:o,allMixed:i})=>{const s=new AbortController;_a(t,s,e);const a=e.readableObjectMode&&!i;return za({stream:e,controller:s,binary:"buffer"===n,shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},_a=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},za=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})=>{const a=(0,wt.on)(e,"data",{signal:t.signal,highWaterMark:Ha,highWatermark:Ha});return Ka({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})},Va=(0,ai.getDefaultHighWaterMark)(!0),Ha=Va,Ka=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s}){const a=qa({binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(const[t]of e)yield*Ui(t,a,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*Fi(a)}},qa=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:o})=>[Oi(e,r,!t),ci(e,o,!n,{})].filter(Boolean),Ya=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=Xa({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:d});if(!o)return void await Promise.all([Qa(e),u]);const p=si(c,r),m=Wa({stream:e,onStreamEnd:t,lines:s,encoding:n,stripFinalNewline:p,allMixed:a}),[f]=await Promise.all([Ja({stream:e,iterable:m,fdNumber:r,encoding:n,maxBuffer:i,lines:s}),u]);return f},Xa=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!Yi({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:i,fdNumber:r}))return;const a=Wa({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await(async(e,t,r,n)=>{for await(const o of e)Ji(t)||Zi(o,r,n)})(a,e,r,i)},Qa=async e=>{await(0,_e.setImmediate)(),null===e.readableFlowing&&e.resume()},Ja=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 hn(e,Ca,t)}(r,{maxBuffer:i}):"buffer"===o?new Uint8Array(await async function(e,t){return hn(e,ka,t)}(r,{maxBuffer:i})):await async function(e,t){return hn(e,Ua,t)}(r,{maxBuffer:i})}catch(r){return ec((({error:e,stream:t,readableObjectMode:r,lines:n,encoding:o,fdNumber:i})=>{if(!(e instanceof Sn))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}))}},Za=async e=>{try{return await e}catch(e){return ec(e)}},ec=({bufferedData:e})=>{return t=e,"[object ArrayBuffer]"===u.call(t)?new Uint8Array(e):e;var t},tc=async(e,t,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{const i=rc(e,r),s=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],(0,Rs.finished)(e,{cleanup:!0,signal:s.signal})])}catch(e){i.stdinCleanedUp||ic(e,t,r,n)}finally{s.abort()}},rc=(e,{originalStreams:[t],subprocess:r})=>{const n={stdinCleanedUp:!1};return e===t&&nc(e,r,n),n},nc=(e,t,r)=>{const{_destroy:n}=e;e._destroy=(...o)=>{oc(t,r),n.call(e,...o)}},oc=({exitCode:e,signalCode:t},r)=>{null===e&&null===t||(r.stdinCleanedUp=!0)},ic=(e,t,r,n)=>{if(!sc(e,t,r,n))throw e},sc=(e,t,r,n=!0)=>r.propagating?lc(e)||cc(e):(r.propagating=!0,ac(r,t)===n?lc(e):cc(e)),ac=({fileDescriptors:e},t)=>"all"!==t&&"input"===e[t].direction,cc=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,lc=e=>"EPIPE"===e?.code,dc=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=tc(e,t,l);if(ac(l,t))return void await d;const[u]=await Promise.all([Ya({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},uc=({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}},pc=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode,mc=(e,t)=>{const r=Ae(e);Me({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})},fc=async(e,t)=>(await Promise.allSettled([e]),t),hc=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,wt.once)(e,"spawn"),(0,wt.once)(e,"exit")]);return"rejected"===t.status?[]:"rejected"===r.status?os(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)=>dc({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})=>dc({...uc(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:pc(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 xs({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(xn(0,o,c),o.push(t)),s&&mc(t,i);return o})({subprocess:e,buffer:r,maxBuffer:n,ipc:d,ipcOutput:x,verboseInfo:m}),T=bc(h,e,w),D=gc(f,w);try{return await Promise.race([Promise.all([{},is(y),Promise.all(v),S,E,Pr(e,u),...T,...D]),b,yc(e,g),...$r(e,i,p,g),...St({subprocess:e,cancelSignal:s,gracefulCancel:a,context:p,controller:g}),...Mr({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=>Za(e)))),Za(S),fc(E,x),Promise.allSettled(T),Promise.allSettled(D)])}},bc=(e,t,r)=>e.map(((e,n)=>e===t.stdio[n]?void 0:tc(e,n,r))),gc=(e,t)=>e.flatMap((({stdioItems:e},r)=>e.filter((({value:e,stream:t=e})=>Jr(t,{checkOpen:!1})&&!$(t))).map((({type:e,value:n,stream:o=n})=>tc(o,r,t,{isSameDirection:so.has(e),stopOnExit:"native"===e}))))),yc=async(e,{signal:t})=>{const[r]=await(0,wt.once)(e,"error",{signal:t});throw r},wc=(e,t,r)=>{const n=e[r];n.has(t)||n.set(t,[]);const o=n.get(t),i=At();return o.push(i),{resolve:i.resolve.bind(i),promises:o}},vc=async({resolve:e,promises:t},r)=>{e();const[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n},Sc=async e=>{if(void 0!==e)try{await xc(e)}catch{}},xc=async e=>{await(0,Rs.finished)(e,{cleanup:!0,readable:!1,writable:!0})},Ec=async e=>{await(0,Rs.finished)(e,{cleanup:!0,readable:!0,writable:!1})},Tc=async(e,t)=>{if(await e,t)throw t},Dc=(e,t,r)=>{r&&!cc(r)?e.destroy(r):t&&e.destroy()},Ic=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:o=!0,preserveNewlines:i=!0}={})=>{const s=o||kr.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Oc(e,n,t),{readableEncoding:l,readableObjectMode:d,readableHighWaterMark:u}=Mc(a,s),{read:p,onStdoutDataDone:m}=Nc({subprocessStdout:a,subprocess:e,binary:s,encoding:r,preserveNewlines:i}),f=new ai.Readable({read:p,destroy:(0,N.callbackify)(Bc.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:u,objectMode:d,encoding:l});return $c({subprocessStdout:a,onStdoutDataDone:m,readable:f,subprocess:e}),f},Oc=(e,t,r)=>{const n=Pt(e,t);return{subprocessStdout:n,waitReadableDestroy:wc(r,n,"readableDestroy")}},Mc=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Va},Nc=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:o})=>{const i=At(),s=Fa({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){Cc(this,s,i)},onStdoutDataDone:i}},Cc=async(e,t,r)=>{try{const{value:n,done:o}=await t.next();o?r.resolve():e.push(n)}catch{}},$c=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:o})=>{try{await Ec(e),await n,await Sc(o),await t,r.readable&&r.push(null)}catch(e){await Sc(o),Ac(r,e)}},Bc=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await vc(r,t)&&(Ac(e,n),await Tc(t,n))},Ac=(e,t)=>{Dc(e,e.readable,t)},jc=({subprocess:e,concurrentStreams:t},{to:r}={})=>{const{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}=Pc(e,r,t),s=new ai.Writable({...Rc(n,e,o),destroy:(0,N.callbackify)(Fc.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Uc(n,s),s},Pc=(e,t,r)=>{const n=jt(e,t);return{subprocessStdin:n,waitWritableFinal:wc(r,n,"writableFinal"),waitWritableDestroy:wc(r,n,"writableDestroy")}},Rc=(e,t,r)=>({write:kc.bind(void 0,e),final:(0,N.callbackify)(Lc.bind(void 0,e,t,r))}),kc=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},Lc=async(e,t,r)=>{await vc(r,t)&&(e.writable&&e.end(),await t)},Uc=async(e,t,r)=>{try{await xc(e),t.writable&&t.end()}catch(e){await(async e=>{if(void 0!==e)try{await Ec(e)}catch{}})(r),Gc(t,e)}},Fc=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await vc(r,t),await vc(n,t)&&(Gc(e,o),await Tc(t,o))},Gc=(e,t)=>{Dc(e,e.writable,t)},Wc=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||kr.has(r),{subprocessStdout:c,waitReadableDestroy:l}=Oc(e,n,t),{subprocessStdin:d,waitWritableFinal:u,waitWritableDestroy:p}=Pc(e,o,t),{readableEncoding:m,readableObjectMode:f,readableHighWaterMark:h}=Mc(c,a),{read:b,onStdoutDataDone:g}=Nc({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),y=new ai.Duplex({read:b,...Rc(d,e,u),destroy:(0,N.callbackify)(_c.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 $c({subprocessStdout:c,onStdoutDataDone:g,readable:y,subprocess:e,subprocessStdin:d}),Uc(d,y,c),y},_c=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([Bc({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},s),Fc({subprocessStdin:t,subprocess:r,waitWritableFinal:o,waitWritableDestroy:i},s)])},zc=(e,t,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{const i=n||kr.has(t),s=Pt(e,r),a=Fa({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return Vc(a,s,e)},Vc=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}},Hc=(e,{encoding:t})=>{const r={readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap};e.readable=Ic.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=jc.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=Wc.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=zc.bind(void 0,e,t),e[Symbol.asyncIterator]=zc.bind(void 0,e,t,{})},Kc=(async()=>{})().constructor.prototype,qc=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(Kc,e)])),Yc=(e,t,r)=>{const{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ue(e,t,r),{file:a,commandArguments:c,options:l}=Wr(e,t,r),d=Xc(l),u=((e,t)=>Go(Ps,e,t,!1))(d,s);return{file:a,commandArguments:c,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:d,fileDescriptors:u}},Xc=({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}},Qc=({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})=>{Zo(n);const a=new l.ChildProcess;((e,t)=>{const r=Ms(),n=Ms(),o=Ms(),i=Array.from({length:t.length-3},Ms),s=Ms(),a=[r,n,o,...i];Object.assign(e,{stdin:r,stdout:n,stderr:o,all:s,stdio:a})})(a,n),Object.assign(a,{readable:Ns,writable:Cs,duplex:$s});const c=Mn({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:!1});return{subprocess:a,promise:Bs(c,s,o)}})({error:e,command:i,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}const d=new AbortController;(0,wt.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})=>so.has(e))))ca(e,t,s,o);for(const{stream:t}of i.filter((({type:e})=>!so.has(e))))da({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]:ks(t);na(r,e)}})(c,a,d),((e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;const o=(0,ma.cf)((()=>{e.kill()}));(0,wt.addAbortListener)(n,(()=>{o()}))})(c,r,d);const p={},m=At();return c.kill=ft.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)?ks([e,t].filter(Boolean)):void 0)(c,r),Hc(c,r),((e,{ipc:t})=>{Object.assign(e,Os(e,!1,t))})(c,r),{subprocess:c,promise:Jc({subprocess:c,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:u,command:i,escapedCommand:s,context:p,onInternalError:m,controller:d})}},Jc=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 hc({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)=>ii(e,t,r))),y=ii(h,t,"all"),w=Zc({errorInfo:u,exitCode:p,signal:m,stdio:g,all:y,ipcOutput:b,context:c,options:t,command:s,escapedCommand:a,startTime:r});return Rn(w,n,t)},Zc=({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?Nn({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 Sn,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,options:a,startTime:d,isSync:!1}):On({command:c,escapedCommand:l,stdio:n,all:o,ipcOutput:i,options:a,startTime:d}),el=(e,t)=>{const r=Object.fromEntries(Object.entries(t).map((([t,r])=>[t,tl(t,e[t],r)])));return{...e,...r}},tl=(e,t,r)=>rl.has(e)&&o(t)&&o(r)?{...t,...r}:r,rl=new Set(["env",...H]),nl=(e,t,r,n)=>{const o=(e,t,n)=>nl(e,t,r,n),i=(...i)=>ol({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:o},...i);return void 0!==n&&n(i,o,t),i},ol=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:i},s,...a)=>{if(o(s))return i(e,el(r,s),n);const{file:c,commandArguments:l,options:d,isSync:u}=il({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=ls(r),{file:c,commandArguments:l,options:d}=Wr(e,t,a);ds(d);const u=((e,t)=>Go(oi,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=ps({file:n,commandArguments:o,options:l,command:i,escapedCommand:s,verboseInfo:c,fileDescriptors:d,startTime:a});return Rn(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}=Yc(e,t,r),{subprocess:p,promise:m}=Qc({file:o,commandArguments:i,options:d,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:u});return p.pipe=xa.bind(void 0,{source:p,sourcePromise:m,boundOptions:{},createNested:n}),((e,t)=>{for(const[r,n]of qc){const o=n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}})(p,m),Rt.set(p,{options:d,fileDescriptors:u}),p})(c,l,d,i)},il=({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=el(el(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}},sl=(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]=al(e);return{file:r,commandArguments:n}},al=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(cl)){const t=r.at(-1);t&&t.endsWith("\\")?r[r.length-1]=`${t.slice(0,-1)} ${e}`:r.push(e)}return r},cl=/ +/g,ll=({options:e})=>({...dl(e),isSync:!0}),dl=e=>({options:{...ul(e),...e}}),ul=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},pl=nl((()=>({}))),ml=nl((()=>({isSync:!0}))),{sendMessage:fl,getOneMessage:hl,getEachMessage:bl,getCancelSignal:gl}=(nl((({file:e,commandArguments:t})=>sl(e,t))),nl((({file:e,commandArguments:t})=>({...sl(e,t),isSync:!0}))),nl((({options:e})=>{if(!1===e.node)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}})),nl((({options:e})=>dl(e)),{},{preferLocal:!0},((e,t,r)=>{e.sync=t(ll,r),e.s=e.sync})),(()=>{const e=C,t=!0,r=void 0!==C.channel;return{...Os(e,t,r),getCancelSignal:Sr.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}})())},5190:(e,t,r)=>{r.d(t,{V:()=>a});var n=r(1708),o=r(6760),i=r(3136);function s(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"}const a=({env:e=n.env,...t}={})=>{const r=s({env:e={...e}});return t.path=e[r],e[r]=(({cwd:e=n.cwd(),path:t=n.env[s()],preferLocal:r=!0,execPath:a=n.execPath,addExecPath:c=!0}={})=>{const l=e instanceof URL?(0,i.fileURLToPath)(e):e,d=o.resolve(l),u=[];return r&&((e,t)=>{let r;for(;r!==t;)e.push(o.join(t,"node_modules/.bin")),r=t,t=o.resolve(t,"..")})(u,d),c&&((e,t,r)=>{const n=t instanceof URL?(0,i.fileURLToPath)(t):t;e.push(o.resolve(r,n,".."))})(u,a,d),[...u,t].join(o.delimiter)})(t),e}},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(8905);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};
|