@nice-move/cli 0.11.13 → 0.11.14

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