@cmflow/cli 3.4.0 → 3.6.0

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.
Files changed (44) hide show
  1. package/dist/bin/cm.mjs +16 -8699
  2. package/dist/bin/cmrelease.mjs +0 -8676
  3. package/dist/common-51c2M9y0.mjs +4 -0
  4. package/dist/common-51c2M9y0.mjs.map +1 -0
  5. package/dist/{compile-packages-CPkDuiiR.mjs → compile-packages-BbF1save.mjs} +2 -2
  6. package/dist/{compile-packages-CPkDuiiR.mjs.map → compile-packages-BbF1save.mjs.map} +1 -1
  7. package/dist/{docker-CwPUDL7v.mjs → docker-DXhAJ3ii.mjs} +2 -2
  8. package/dist/{docker-CwPUDL7v.mjs.map → docker-DXhAJ3ii.mjs.map} +1 -1
  9. package/dist/{docker-clean-tags-4Z1VHhE4.mjs → docker-clean-tags-CGWL7cFn.mjs} +2 -2
  10. package/dist/{docker-clean-tags-4Z1VHhE4.mjs.map → docker-clean-tags-CGWL7cFn.mjs.map} +1 -1
  11. package/dist/{docker-publish-BFuDmUA1.mjs → docker-publish-YJqQd34C.mjs} +2 -2
  12. package/dist/{docker-publish-BFuDmUA1.mjs.map → docker-publish-YJqQd34C.mjs.map} +1 -1
  13. package/dist/{find-packages-C6Y7bRd0.mjs → find-packages-CG9LQebY.mjs} +2 -2
  14. package/dist/{find-packages-C6Y7bRd0.mjs.map → find-packages-CG9LQebY.mjs.map} +1 -1
  15. package/dist/get-config-m5362szF.mjs +42 -0
  16. package/dist/get-config-m5362szF.mjs.map +1 -0
  17. package/dist/index.d.mts +0 -350
  18. package/dist/index.mjs +15 -15
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/{npm-CN1gb9zd.mjs → npm-DPLnAVRR.mjs} +2 -2
  21. package/dist/{npm-CN1gb9zd.mjs.map → npm-DPLnAVRR.mjs.map} +1 -1
  22. package/dist/semantic/core/analyze-commits.mjs +1 -1
  23. package/dist/semantic/core/conditional.mjs +1 -1
  24. package/dist/semantic/core/exit.mjs +1 -1
  25. package/dist/semantic/core/prepare/artifacts.mjs +1 -1
  26. package/dist/semantic/core/prepare/bump-version.mjs +1 -1
  27. package/dist/semantic/core/prepare/commit.mjs +1 -1
  28. package/dist/semantic/core/publish-packages.mjs +1 -1
  29. package/dist/semantic/core/push-release.mjs +1 -1
  30. package/dist/semantic/core/run.mjs +1 -1
  31. package/dist/semantic/core/sync-repository.mjs +1 -1
  32. package/dist/semantic/core/verify-conditions.mjs +1 -1
  33. package/dist/semantic/core/verify-release.mjs +1 -1
  34. package/dist/semantic/docker/publish.mjs +1 -1
  35. package/dist/semantic/docker/success.mjs +1 -1
  36. package/dist/{source-DKfioGh_.mjs → source-CehOU1XK.mjs} +2 -2
  37. package/dist/{source-DKfioGh_.mjs.map → source-CehOU1XK.mjs.map} +1 -1
  38. package/dist/{write-packages-BuxaZvCH.mjs → write-packages-CfzjR7WR.mjs} +2 -2
  39. package/dist/{write-packages-BuxaZvCH.mjs.map → write-packages-CfzjR7WR.mjs.map} +1 -1
  40. package/package.json +3 -4
  41. package/dist/common-Dk_Pm7J8.mjs +0 -4
  42. package/dist/common-Dk_Pm7J8.mjs.map +0 -1
  43. package/dist/get-config-DvDR_kk5.mjs +0 -44
  44. package/dist/get-config-DvDR_kk5.mjs.map +0 -1
@@ -0,0 +1,42 @@
1
+ import { fileURLToPath as __cliFileURLToPath } from "node:url";
2
+ const __filename = __cliFileURLToPath(import.meta.url);
3
+ import{i as e,r as t,t as n}from"./rolldown-runtime-DQqWX4ve.mjs";import{spawnSync as r}from"child_process";import{fileURLToPath as i}from"node:url";import{ChildProcess as a,execFile as o,spawn as s,spawnSync as c}from"node:child_process";import{StringDecoder as l}from"node:string_decoder";import{aborted as u,callbackify as d,debuglog as f,inspect as p,promisify as m,stripVTControlCharacters as h}from"node:util";import g,{execArgv as _,execPath as v,hrtime as y,platform as b}from"node:process";import x from"node:tty";import S,{join as C}from"node:path";import{scheduler as w,setImmediate as T,setTimeout as E}from"node:timers/promises";import{constants as D}from"node:os";import{EventEmitter as ee,addAbortListener as te,on as ne,once as O,setMaxListeners as re}from"node:events";import{serialize as ie}from"node:v8";import k,{appendFileSync as ae,closeSync as oe,createReadStream as se,createWriteStream as ce,openSync as le,readFileSync as ue,readSync as de,statSync as fe,writeFileSync as pe}from"node:fs";import{Buffer as me}from"node:buffer";import"node:fs/promises";import{finished as A}from"node:stream/promises";import{Duplex as he,PassThrough as ge,Readable as j,Transform as _e,Writable as ve,getDefaultHighWaterMark as ye}from"node:stream";import be from"node:path/win32";import xe from"fs";function M(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const Se=(e,t)=>{let n=Te(Ce(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},Ce=e=>we(e)?e.toString():e,we=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Te=e=>e instanceof URL?i(e):e,Ee=(e,t=[],n={})=>{let r=Se(e,`First argument`),[i,a]=M(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!M(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,{__proto__:null,...a}]},{toString:De}=Object.prototype,Oe=e=>De.call(e)===`[object ArrayBuffer]`,N=e=>De.call(e)===`[object Uint8Array]`,P=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ke=new TextEncoder,Ae=e=>ke.encode(e),je=new TextDecoder,Me=e=>je.decode(e),Ne=(e,t)=>Pe(e,t).join(``),Pe=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new l(t),r=e.map(e=>typeof e==`string`?Ae(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Fe=e=>e.length===1&&N(e[0])?e[0]:Le(Ie(e)),Ie=e=>e.map(e=>typeof e==`string`?Ae(e):e),Le=e=>{let t=new Uint8Array(Re(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Re=e=>{let t=0;for(let n of e)t+=n.length;return t},ze=e=>Array.isArray(e)&&Array.isArray(e.raw),Be=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=Ve({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},Ve=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=He(i,e.raw[r]),c=Ge(n,a,o);if(r===t.length)return c;let l=t[r],u=Array.isArray(l)?l.map(e=>Ke(e)):[Ke(l)];return Ge(c,u,s)},He=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=Ue.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(Ue.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
4
+ `?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=We[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},Ue=new Set([` `,` `,`\r`,`
5
+ `]),We={x:3,u:5},Ge=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Ke=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(M(e)&&(`stdout`in e||`isMaxBuffer`in e))return qe(e);throw e instanceof a||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},qe=({stdout:e})=>{if(typeof e==`string`)return e;if(N(e))return Me(e);throw TypeError(e===void 0?`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`:`Unexpected "${typeof e}" stdout in template expression`)},F=e=>Je.includes(e),Je=[g.stdin,g.stdout,g.stderr],I=[`stdin`,`stdout`,`stderr`],Ye=e=>I[e]??`stdio[${e}]`,Xe=e=>{let t={...e};for(let n of ct)t[n]=Ze(e,n);return t},Ze=(e,t)=>{let n=Qe(e),r=Array.from({length:n+1}),i=$e(e[t],r,t,n);return ot(i,t)},Qe=({stdio:e})=>Array.isArray(e)?Math.max(e.length,I.length):I.length,$e=(e,t,n,r)=>M(e)?et(e,t,n,r):t.fill(e),et=(e,t,n,r)=>{for(let i of Object.keys(e).sort(tt))for(let a of rt(i,n,r))t[a]=e[i];return t},tt=(e,t)=>nt(e)<nt(t)?1:-1,nt=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,rt=(e,t,n)=>{if(e===`ipc`)return[n];let r=it(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
6
+ It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r!==`all`&&r>=n)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
7
+ Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},it=e=>{if(e===`all`)return e;if(I.includes(e))return I.indexOf(e);let t=at.exec(e);if(t!==null)return Number(t.groups.fdNumber)},at=/^fd(?<fdNumber>\d+)$/,ot=(e,t)=>e.map(e=>e===void 0?st[t]:e),st={lines:!1,buffer:!0,maxBuffer:1e8,verbose:f(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},ct=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],lt=(e,t)=>t===`ipc`?e.at(-1):e[t],ut=({verbose:e},t)=>pt(e,t)!==`none`,dt=({verbose:e},t)=>![`none`,`short`].includes(pt(e,t)),ft=({verbose:e},t)=>{let n=pt(e,t);return ht(n)?n:void 0},pt=(e,t)=>t===void 0?mt(e):lt(e,t),mt=e=>e.find(e=>ht(e))??gt.findLast(t=>e.includes(t)),ht=e=>typeof e==`function`,gt=[`none`,`short`,`full`],_t=(e,t)=>{let n=[e,...t];return{command:n.join(` `),escapedCommand:n.map(e=>wt(yt(e))).join(` `)}},vt=e=>h(e).split(`
8
+ `).map(e=>yt(e)).join(`
9
+ `),yt=e=>e.replaceAll(xt,e=>bt(e)),bt=e=>{let t=St[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=Ct?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},xt=(()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),St={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},Ct=65535,wt=e=>Tt.test(e)?e:b===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,Tt=/^[\w\-./]+$/;function Et(){let{env:e}=g,{TERM:t,TERM_PROGRAM:n}=e;return g.platform===`win32`?!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask===`{cmd::Cmder}`||n===`Terminus-Sublime`||n===`vscode`||t===`xterm-256color`||t===`alacritty`||t===`rxvt-unicode`||t===`rxvt-unicode-256color`||e.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t!==`linux`}const Dt={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},Ot={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},kt={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},At={...Dt,...Ot},jt={...Dt,...kt},Mt=Et()?At:jt;Object.entries(Ot);const Nt=x?.WriteStream?.prototype?.hasColors?.()??!1,L=(e,t)=>{if(!Nt)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}};L(0,0);const Pt=L(1,22);L(2,22),L(3,23),L(4,24),L(`4:2`,24),L(`4:3`,24),L(`4:4`,24),L(`4:5`,24),L(53,55),L(7,27),L(8,28),L(9,29),L(30,39),L(31,39),L(32,39),L(33,39),L(34,39),L(35,39),L(36,39),L(37,39);const Ft=L(90,39);L(40,49),L(41,49),L(42,49),L(43,49),L(44,49),L(45,49),L(46,49),L(47,49),L(100,49);const It=L(91,39);L(92,39);const Lt=L(93,39);L(94,39),L(95,39),L(96,39),L(97,39),L(101,49),L(102,49),L(103,49),L(104,49),L(105,49),L(106,49),L(107,49),L(`58;5;0`,59),L(`58;5;1`,59),L(`58;5;2`,59),L(`58;5;3`,59),L(`58;5;4`,59),L(`58;5;5`,59),L(`58;5;6`,59),L(`58;5;7`,59),L(`58;5;8`,59),L(`58;5;9`,59),L(`58;5;10`,59),L(`58;5;11`,59),L(`58;5;12`,59),L(`58;5;13`,59),L(`58;5;14`,59),L(`58;5;15`,59);const Rt=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=zt(n),c=Ht[e]({failed:a,reject:o,piped:r}),l=Wt[e]({reject:o});return`${Ft(`[${s}]`)} ${Ft(`[${i}]`)} ${l(c)} ${l(t)}`},zt=e=>`${Bt(e.getHours(),2)}:${Bt(e.getMinutes(),2)}:${Bt(e.getSeconds(),2)}.${Bt(e.getMilliseconds(),3)}`,Bt=(e,t)=>String(e).padStart(t,`0`),Vt=({failed:e,reject:t})=>e?t?Mt.cross:Mt.warning:Mt.tick,Ht={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:Vt,duration:Vt},Ut=e=>e,Wt={command:()=>Pt,output:()=>Ut,ipc:()=>Ut,error:({reject:e})=>e?It:Lt,duration:()=>Ft},Gt=(e,t,n)=>{let r=ft(t,n);return e.map(({verboseLine:e,verboseObject:t})=>Kt(e,t,r)).filter(e=>e!==void 0).map(e=>qt(e)).join(``)},Kt=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},qt=e=>e.endsWith(`
10
+ `)?e:`${e}\n`,Jt=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=Yt({type:e,result:i,verboseInfo:r}),o=Xt(t,a),s=Gt(o,r,n);s!==``&&console.warn(s.slice(0,-1))},Yt=({type:e,result:t,verboseInfo:n})=>{let{escapedCommand:r,commandId:i,rawOptions:a}=n,{piped:o=!1,...s}=a;return{type:e,escapedCommand:r,commandId:`${i}`,timestamp:new Date,piped:o,result:t,options:s}},Xt=(e,t)=>e.split(`
11
+ `).map(e=>Zt({...t,message:e})),Zt=e=>({verboseLine:Rt(e),verboseObject:e}),Qt=e=>{let t=typeof e==`string`?e:p(e);return vt(t).replaceAll(` `,()=>` `.repeat($t))},$t=2,en=(e,t)=>{ut(t)&&Jt({type:`command`,verboseMessage:e,verboseInfo:t})},tn=(e,t,n)=>(an(e),{verbose:e,escapedCommand:t,commandId:nn(e),rawOptions:n}),nn=e=>ut({verbose:e})?rn++:void 0;let rn=0n;const an=e=>{for(let t of e){if(t===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!gt.includes(t)&&!ht(t)){let e=gt.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},on=()=>y.bigint(),sn=e=>Number(y.bigint()-e)/1e6,cn=(e,t,n)=>{let r=on(),{command:i,escapedCommand:a}=_t(e,t),o=Ze(n,`verbose`),s=tn(o,a,{...n});return en(a,s),{command:i,escapedCommand:a,startTime:r,verboseInfo:s}};function ln(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`}m(o);function un(e){return e instanceof URL?i(e):e}function dn(e){return{*[Symbol.iterator](){let t=S.resolve(un(e)),n;for(;n!==t;)yield t,n=t,t=S.resolve(t,`..`)}}}const fn=({cwd:e=g.cwd(),path:t=g.env[ln()],preferLocal:n=!0,execPath:r=g.execPath,addExecPath:i=!0}={})=>{let a=S.resolve(un(e)),o=[],s=t.split(S.delimiter);return n&&pn(o,s,a),i&&mn(o,s,r,a),t===``||t===S.delimiter?`${o.join(S.delimiter)}${t}`:[...o,t].join(S.delimiter)},pn=(e,t,n)=>{for(let r of dn(n)){let n=S.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},mn=(e,t,n,r)=>{let i=S.resolve(r,un(n),`..`);t.includes(i)||e.push(i)},hn=({env:e=g.env,...t}={})=>{e={...e};let n=ln({env:e});return t.path=e[n],e[n]=fn(t),e},gn=(e,t,n)=>new(n?Cn:Sn)(t,e instanceof _n?{}:{cause:e});var _n=class extends Error{};const vn=(e,t)=>{Object.defineProperties(e.prototype,{name:{value:t,writable:!0,enumerable:!1,configurable:!0},[bn]:{value:!0,writable:!1,enumerable:!1,configurable:!1}})},yn=e=>xn(e)&&bn in e,bn=Symbol(`isExecaError`),xn=e=>Object.prototype.toString.call(e)===`[object Error]`;var Sn=class extends Error{};vn(Sn,Sn.name);var Cn=class extends Error{};vn(Cn,Cn.name);const wn=()=>{let e=64-En+1;return Array.from({length:e},Tn)},Tn=(e,t)=>({name:`SIGRT${t+1}`,number:En+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),En=34,Dn=[{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`}],On=()=>{let e=wn();return[...Dn,...e].map(kn)},kn=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=D,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},An=()=>{let e=On();return Object.fromEntries(e.map(jn))},jn=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o}],Mn=An(),Nn=()=>{let e=On(),t=Array.from({length:65},(t,n)=>Pn(n,e));return Object.assign({},...t)},Pn=(e,t)=>{let n=Fn(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},Fn=(e,t)=>{let n=t.find(({name:t})=>D.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};Nn();const In=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Rn(e,t)},Ln=e=>e===0?e:Rn(e,"`subprocess.kill()`'s argument"),Rn=(e,t)=>{if(Number.isInteger(e))return zn(e,t);if(typeof e==`string`)return Vn(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${Hn()}`)},zn=(e,t)=>{if(Bn.has(e))return Bn.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${Hn()}`)},Bn=new Map(Object.entries(D.signals).reverse().map(([e,t])=>[t,e])),Vn=(e,t)=>{if(e in D.signals)return e;throw e.toUpperCase()in D.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${Hn()}`)},Hn=()=>`Available signal names: ${Un()}.
12
+ Available signal numbers: ${Wn()}.`,Un=()=>Object.keys(D.signals).sort().map(e=>`'${e}'`).join(`, `),Wn=()=>[...new Set(Object.values(D.signals).sort((e,t)=>e-t))].join(`, `),Gn=e=>Mn[e].description,Kn=e=>{if(e===!1)return e;if(e===!0)return qn;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},qn=5e3,Jn=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Yn(o,s,n);Xn(l,r);let u=e(c);return Zn({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Yn=(e,t,n)=>{let[r=n,i]=xn(e)?[void 0,e]:[e,t];if(typeof r!=`string`&&!Number.isInteger(r))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!xn(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Ln(r),error:i}},Xn=(e,t)=>{e!==void 0&&t.reject(e)},Zn=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&Qn({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},Qn=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await E(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??=!0)}catch{}},$n=async(e,t)=>{e.aborted||await O(e,`abort`,{signal:t})},er=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},tr=({kill:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[nr(e,t,r,i)],nr=async(e,t,n,{signal:r})=>{throw await $n(t,r),n.terminationReason??=`cancel`,e(),t.reason},rr=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{ir(e,t,n),ar(e,t,r)},ir=(e,t,n)=>{if(!n)throw Error(`${R(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},ar=(e,t,n)=>{if(!n)throw Error(`${R(e,t)} cannot be used: the ${z(t)} has already exited or disconnected.`)},or=e=>{throw Error(`${R(`getOneMessage`,e)} could not complete: the ${z(e)} exited or disconnected.`)},sr=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} is sending a message too, instead of listening to incoming messages.
13
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
14
+
15
+ const [receivedMessage] = await Promise.all([
16
+ ${R(`getOneMessage`,e)},
17
+ ${R(`sendMessage`,e,`message, {strict: true}`)},
18
+ ]);`)},cr=(e,t)=>Error(`${R(`sendMessage`,t)} failed when sending an acknowledgment response to the ${z(t)}.`,{cause:e}),lr=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} is not listening to incoming messages.`)},ur=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} exited without listening to incoming messages.`)},dr=()=>Error(`\`cancelSignal\` aborted: the ${z(!0)} disconnected.`),fr=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},pr=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${R(t,n)} cannot be used: the ${z(n)} is disconnecting.`,{cause:e})},mr=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(hr(e))throw Error(`${R(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},hr=({code:e,message:t})=>gr.has(e)||_r.some(e=>t.includes(e)),gr=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),_r=[`could not be cloned`,`circular structure`,`call stack size exceeded`],R=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${vr(t)}${e}(${n})`,vr=e=>e?``:`subprocess.`,z=e=>e?`parent process`:`subprocess`,yr=e=>{e.connected&&e.disconnect()},B=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},br=(e,t,n)=>{let r=e.getMaxListeners();r!==0&&r!==1/0&&(e.setMaxListeners(r+t),te(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},xr=(e,t)=>{t&&Sr(e)},Sr=e=>{e.refCounted()},Cr=(e,t)=>{t&&wr(e)},wr=e=>{e.unrefCounted()},Tr=(e,t)=>{t&&(wr(e),wr(e))},Er=(e,t)=>{t&&(Sr(e),Sr(e))},Dr=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(Rr(i)||si(i))return;kr.has(e)||kr.set(e,[]);let a=kr.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await Kr(e,r,i),await w.yield();let o=await Lr({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},Or=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{li();let a=kr.get(e);for(;a?.length>0;)await O(r,`message:done`);e.removeListener(`message`,i),Er(t,n),r.connected=!1,r.emit(`disconnect`)},kr=new WeakMap,Ar=(e,t,n)=>{if(jr.has(e))return jr.get(e);let r=new ee;return r.connected=!0,jr.set(e,r),Mr({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},jr=new WeakMap,Mr=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Dr.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,Or.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Tr(n,r)},Nr=e=>{let t=jr.get(e);return t===void 0?e.channel!==void 0&&e.channel!==null:t.connected},Pr=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=Ar(e,t,n),o=Yr(e,a);return{id:Fr++,type:Hr,message:r,hasListeners:o}};let Fr=0n;const Ir=(e,t)=>{if(!(t?.type!==Hr||t.hasListeners))for(let{id:t}of e)t!==void 0&&Br[t].resolve({isDeadlock:!0,hasListeners:!1})},Lr=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==Hr||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:Ur,message:Yr(t,i)};try{await Qr({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},Rr=e=>{if(e?.type!==Ur)return!1;let{id:t,message:n}=e;return Br[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},zr=async(e,t,n)=>{if(e?.type!==Hr)return;let r=B();Br[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,Vr(t,n,i)]);e&&sr(n),a||lr(n)}finally{i.abort(),delete Br[e.id]}},Br={},Vr=async(e,t,{signal:n})=>{br(e,1,n),await O(e,`disconnect`,{signal:n}),ur(t)},Hr=`execa:ipc:request`,Ur=`execa:ipc:response`,Wr=(e,t,n)=>{V.has(e)||V.set(e,new Set);let r=V.get(e),i={onMessageSent:B(),id:n?t.id:void 0};return r.add(i),{outgoingMessages:r,outgoingMessage:i}},Gr=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},Kr=async(e,t,n)=>{for(;!Yr(e,t)&&V.get(e)?.size>0;){let t=[...V.get(e)];Ir(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},V=new WeakMap,qr=new WeakMap,Jr=(e,t)=>{qr.set(e,t)},Yr=(e,t)=>t.listenerCount(`message`)>Xr(e),Xr=e=>+(Zr(e)!==void 0&&!lt(Zr(e).buffer,`ipc`)),Zr=e=>qr.get(e),Qr=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return rr({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),$r({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},$r=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=Pr({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=Wr(e,o,a);try{await ei({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw yr(e),t}finally{Gr(s)}},ei=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=ti(e);try{await Promise.all([zr(r,e,n),a(r)])}catch(e){throw pr({error:e,methodName:t,isSubprocess:n}),mr({error:e,methodName:t,isSubprocess:n,message:i}),e}},ti=e=>{if(ni.has(e))return ni.get(e);let t=m(e.send.bind(e));return ni.set(e,t),t},ni=new WeakMap,ri=(e,t)=>{let n=`cancelSignal`;return ar(n,!1,e.connected),ei({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:ci,message:t},message:t})},ii=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await ai({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),ui.signal),ai=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!oi){if(oi=!0,!r){fr();return}if(t===null){li();return}Ar(e,t,n),await w.yield()}};let oi=!1;const si=e=>e?.type===ci&&(ui.abort(e.message),!0),ci=`execa:ipc:cancel`,li=()=>{ui.abort(dr())},ui=new AbortController,di=({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(t===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r===`json`)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},fi=({subprocess:e,kill:t,cancelSignal:n,gracefulCancel:r,forceKillAfterDelay:i,context:a,controller:o})=>r?[pi({subprocess:e,kill:t,cancelSignal:n,forceKillAfterDelay:i,context:a,controller:o})]:[],pi=async({subprocess:e,kill:t,cancelSignal:n,forceKillAfterDelay:r,context:i,controller:{signal:a}})=>{await $n(n,a);let o=mi(n);throw await ri(e,o),Qn({kill:t,forceKillAfterDelay:r,context:i,controllerSignal:a}),i.terminationReason??=`gracefulCancel`,n.reason},mi=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},hi=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},gi=(e,t,n,r)=>t===0||t===void 0?[]:[_i(e,t,n,r)],_i=async(e,t,n,{signal:r})=>{throw await E(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e(),new _n},vi=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},yi=(e,t,{node:n=!1,nodePath:r=v,nodeOptions:i=_.filter(e=>!e.startsWith(`--inspect`)),cwd:a,execPath:o,...s})=>{if(o!==void 0)throw TypeError(`The "execPath" option has been removed. Please use the "nodePath" option instead.`);let c=Se(r,`The "nodePath" option`),l=S.resolve(a,c),u={__proto__:null,shell:!1,...s,nodePath:l,node:n,cwd:a};if(!n)return[e,t,u];if(S.basename(e,`.exe`)===`node`)throw TypeError(`When the "node" option is true, the first argument does not need to be "node".`);return[l,[...i,e,...t],{__proto__:null,ipc:!0,...u,shell:!1}]},bi=({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");xi[n](e)}},xi={advanced:e=>{try{ie(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},Si=async(e,t,n)=>{t!==void 0&&await Qr({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n},t)},Ci=({encoding:e})=>{if(Ti.has(e))return;let t=Ei(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${Oi(e)}\`.
19
+ Please rename it to ${Oi(t)}.`);let n=[...Ti].map(e=>Oi(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${Oi(e)}\`.
20
+ Please rename it to one of: ${n}.`)},wi=new Set([`utf8`,`utf16le`]),H=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),Ti=wi.union(H),Ei=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Di)return Di[t];if(Ti.has(t))return t},Di={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Oi=e=>typeof e==`string`?`"${e}"`:String(e),U=g.platform===`win32`,ki=U?/[\/\\]/v:/\//v;function Ai(e,t){if(typeof e!=`string`||e.length===0)throw TypeError(`Expected a non-empty string.`);let{cwd:n=g.cwd(),path:r=g.env.PATH??(U?g.env.Path:void 0)??``,pathExt:i=g.env.PATHEXT||`.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC`}=t;return{cwd:n,searchPath:r,pathExt:i}}function ji(e,t){let n=t.split(S.delimiter).filter(Boolean),r=S.extname(e).toLowerCase();return r!==``&&n.some(e=>e.toLowerCase()===r)?[``,...n]:n}function*Mi(e,{cwd:t,searchPath:n,pathExt:r}){let i=U?ji(e,r):[``];if(ki.test(e)){let n=S.resolve(t,e);for(let e of i)yield n+e;return}let a=[...U?[t]:[],...n.split(S.delimiter)];for(let n of a){let r=U&&n.length>1&&n.startsWith(`"`)&&n.endsWith(`"`)?n.slice(1,-1):n;if(r===``)continue;let a=S.resolve(t,r,e);for(let e of i)yield a+e}}function Ni(e){let t;try{t=k.statSync(e)}catch(e){return U&&e.code===`EACCES`}if(!t.isFile())return!1;if(U)return!0;try{return k.accessSync(e,k.constants.X_OK),!0}catch{return!1}}function Pi(e,t={}){let n=Ai(e,t);for(let t of Mi(e,n))if(Ni(t))return t}const Fi=(e,t,n)=>{let r={file:e,commandArguments:[...t],options:n};return n.shell||g.platform!==`win32`?r:Ri(r)},Ii=/\.(?:com|exe)$/i,Li=/\.(?:bat|cmd)$/i,Ri=e=>{let t=zi(e);if(t!==void 0&&Ii.test(t))return e.options.argv0===void 0&&(e.options.argv0=e.file),e.file=t,e;for(let t of[e.file,...e.commandArguments])Yi(t);let n=t!==void 0&&Li.test(t),r=`"${[Zi(S.normalize(t??e.file)),...e.commandArguments.map(e=>$i(e,n))].join(` `)}"`;return e.options.windowsVerbatimArguments=!0,{file:g.env.comspec||`cmd.exe`,commandArguments:[`/d`,`/s`,`/c`,r],options:e.options}},zi=e=>{let t=Bi(e),n=t!==void 0&&Gi(t);return n?(e.commandArguments.unshift(t),e.file=n,Bi(e)):t},Bi=e=>{let t=e.options.env||g.env,n=e.options.cwd??g.cwd(),r=Wi(t,`PATHEXT`),i=S.extname(e.file),a=i===``?r:`${i}${S.delimiter}${r??``}`;if(Vi(e.file))return Pi(S.resolve(n,e.file),{cwd:n,pathExt:a});let o={cwd:n,path:Wi(t,`PATH`)??Wi(g.env,`PATH`)??``,pathExt:a};return Hi(t)?Pi(e.file,o):Ui(e.file,o)},Vi=e=>e.includes(`/`)||e.includes(`\\`)||e.includes(`:`),Hi=e=>Wi(g.env,`NODEFAULTCURRENTDIRECTORYINEXEPATH`)===void 0&&Wi(e,`NODEFAULTCURRENTDIRECTORYINEXEPATH`)===void 0,Ui=(e,{cwd:t,path:n,pathExt:r})=>{for(let i of n.split(S.delimiter)){let n=i.length>1&&i.startsWith(`"`)&&i.endsWith(`"`)?i.slice(1,-1):i;if(n===``)continue;let a=Pi(S.resolve(t,n,e),{cwd:t,pathExt:r});if(a!==void 0)return a}},Wi=(e,t)=>{let n=Object.keys(e).sort().find(e=>e.toUpperCase()===t);return n===void 0?void 0:e[n]},Gi=e=>{let t=me.alloc(150);try{let n=le(e,`r`);try{de(n,t,0,150,0)}finally{oe(n)}}catch{return}return qi(t.toString())},Ki=/^#!(?<line>.*)/,qi=e=>{let t=e.match(Ki)?.groups.line.trim();if(!t)return;let[n,r]=t.split(` `),i=n.split(`/`).at(-1);return i===`env`?r:r?`${i} ${r}`:i},Ji=/[\n\r]/,Yi=e=>{if(Ji.test(e))throw TypeError(`The command and its arguments cannot contain a line break on Windows without a shell.\nThis would allow a command injection with \`cmd.exe\`.\nInvalid value: ${JSON.stringify(`${e}`)}`)},Xi=/[()\][%!^"`<>&|;, *?]/g,Zi=e=>e.replaceAll(Xi,`^$&`),Qi=/\\+/g,$i=(e,t)=>{let n=`${e}`.replaceAll(Qi,(e,t,n)=>{let r=n[t+e.length];return r===`"`||r===void 0?e.repeat(2):e}).replaceAll(`"`,`\\"`),r=Zi(`"${n}"`);return t?Zi(r):r},ea=(e=ta())=>{let t=Se(e,`The "cwd" option`);return S.resolve(t)},ta=()=>{try{return g.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},na=(e,t)=>{if(t===ta())return e;let n;try{n=fe(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}`},ra=/^cmd(?:\.exe)?$/i,ia=(e,t,n)=>{let r={__proto__:null,...n};r.cwd=ea(r.cwd);let[i,a,o]=yi(e,t,r),s=Xe(o),c=aa(s);c.env=oa(c);let{file:l,commandArguments:u}=Fi(i,a,c);return hi(c),Ci(c),bi(c),er(c),di(c),c.shell=Te(c.shell),c.killSignal=In(c.killSignal),c.forceKillAfterDelay=Kn(c.forceKillAfterDelay),c.lines=c.lines.map((e,t)=>e&&!H.has(c.encoding)&&c.buffer[t]),g.platform===`win32`&&ra.test(S.basename(l))&&u.unshift(`/q`),{file:l,commandArguments:u,options:c}},aa=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i=`utf8`,reject:a=!0,cleanup:o=!0,killDescendants:s=!1,all:c=!1,windowsHide:l=!0,killSignal:u=`SIGTERM`,forceKillAfterDelay:d=!0,gracefulCancel:f=!1,ipcInput:p,ipc:m=p!==void 0||f,serialization:h=`advanced`,...g})=>({__proto__:null,...g,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:a,cleanup:o,killDescendants:s,all:c,windowsHide:l,killSignal:u,forceKillAfterDelay:d,gracefulCancel:f,ipcInput:p,ipc:m,serialization:h}),oa=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{...g.env,...e}:e;return n||r?hn({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o},sa=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function ca(e){if(typeof e==`string`)return la(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return ua(e)}const la=e=>e.at(-1)===da?e.slice(0,e.at(-2)===pa?-2:-1):e,ua=e=>e.at(-1)===fa?e.subarray(0,e.at(-2)===ma?-2:-1):e,da=`
21
+ `,fa=`
22
+ `.codePointAt(0),pa=`\r`,ma=`\r`.codePointAt(0);function W(e,{checkOpen:t=!0}={}){return typeof e==`object`&&!!e&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe==`function`}function ha(e,{checkOpen:t=!0}={}){return W(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write==`function`&&typeof e.end==`function`&&typeof e.writable==`boolean`&&typeof e.writableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function ga(e,{checkOpen:t=!0}={}){return W(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read==`function`&&typeof e.readable==`boolean`&&typeof e.readableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function _a(e,t){return ha(e,t)&&ga(e,t)}const va=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var ya=class{#e;#t;#n=!1;#r=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){let t=()=>this.#a(e);return this.#r?this.#r.then(t,t):t()}async#i(){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#a(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const ba=Symbol();function xa(){return this[ba].next()}Object.defineProperty(xa,"name",{value:`next`});function Sa(e){return this[ba].return(e)}Object.defineProperty(Sa,"name",{value:`return`});const Ca=Object.create(va,{next:{enumerable:!0,configurable:!0,writable:!0,value:xa},return:{enumerable:!0,configurable:!0,writable:!0,value:Sa}});function wa({preventCancel:e=!1}={}){let t=new ya(this.getReader(),e),n=Object.create(Ca);return n[ba]=t,n}const Ta=e=>{if(ga(e,{checkOpen:!1})&&ka.on!==void 0)return Da(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(Ea.call(e)===`[object ReadableStream]`)return wa.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:Ea}=Object.prototype,Da=async function*(e){let t=new AbortController,n={};Oa(e,t,n);try{for await(let[n]of ka.on(e,`data`,{signal:t.signal}))yield n}catch(e){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},Oa=async(e,t,n)=>{try{await ka.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},ka={},Aa=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=Ta(e),u=t();u.length=0;try{for await(let e of l){let t=n[Pa(e)](e,u);Ma({convertedChunk:t,state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c})}return ja({state:u,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(u)}catch(e){let t=typeof e==`object`&&e?e:Error(e);throw t.bufferedData=s(u),t}},ja=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&Ma({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},Ma=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Na(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Na(c,t,i,a),new Ia},Na=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},Pa=e=>{let t=typeof e;if(t===`string`)return`string`;if(t!==`object`||e===null)return`others`;if(globalThis.Buffer?.isBuffer(e))return`buffer`;let n=Fa.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Fa.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Fa}=Object.prototype;var Ia=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const G=e=>e,La=()=>void 0,Ra=({contents:e})=>e,za=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},Ba=e=>e.length;async function Va(e,t){return Aa(e,Ha,t)}const Ha={init:()=>({contents:[]}),convertChunk:{string:G,buffer:G,arrayBuffer:G,dataView:G,typedArray:G,others:G},getSize:()=>1,truncateChunk:La,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:La,finalize:Ra};async function Ua(e,t){return Aa(e,ro,t)}const Wa=()=>({contents:new ArrayBuffer(0)}),Ga=e=>Ka.encode(e),Ka=new TextEncoder,qa=e=>new Uint8Array(e),Ja=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ya=(e,t)=>e.slice(0,t),Xa=(e,{contents:t,length:n},r)=>{let i=no()?Qa(t,r):Za(t,r);return new Uint8Array(i).set(e,n),i},Za=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer($a(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Qa=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:$a(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},$a=e=>eo**Math.ceil(Math.log(e)/Math.log(eo)),eo=2,to=({contents:e,length:t})=>no()?e:e.slice(0,t),no=()=>`resize`in ArrayBuffer.prototype,ro={init:Wa,convertChunk:{string:Ga,buffer:qa,arrayBuffer:qa,dataView:Ja,typedArray:Ja,others:za},getSize:Ba,truncateChunk:Ya,addChunk:Xa,getFinalChunk:La,finalize:to};async function io(e,t){return Aa(e,so,t)}const ao=()=>({contents:``,textDecoder:new TextDecoder}),oo=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),so={init:ao,convertChunk:{string:G,buffer:oo,arrayBuffer:oo,dataView:oo,typedArray:oo,others:za},getSize:Ba,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:Ra},co=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof Ia))throw e;if(a===`all`)return e;throw e.maxBufferInfo={fdNumber:a,unit:lo(n,r,i)},t.destroy(),e},lo=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,uo=(e,t,n)=>{if(t.length!==n)return;let r=new Ia;throw r.maxBufferInfo={fdNumber:`ipc`},r},fo=(e,t)=>{let{streamName:n,threshold:r,unit:i}=po(e,t);return`Command's ${n} was larger than ${r} ${i}`},po=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:`output`,threshold:t[1],unit:`bytes`};let{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;let i=lt(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:Ye(n),threshold:i,unit:r}},mo=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>go(n)),ho=(e,t,n)=>{if(!t)return e;let r=go(n);return e.length>r?e.slice(0,r):e},go=([,e])=>e,_o=({stdio:e,all:t,ipcOutput:n,originalError:r,signal:i,signalDescription:a,exitCode:o,escapedCommand:s,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:_})=>{let v=r?.code,y=vo({originalError:r,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:v,signal:i,signalDescription:a,exitCode:o,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),b=bo(r,_),x=`${y}: ${s}${b===void 0?``:`\n${b}`}`;return{originalMessage:b,shortMessage:x,message:[x,...t===void 0?[e[2],e[1]]:[t],...e.slice(3),n.map(e=>xo(e)).join(`
23
+ `)].map(e=>vt(ca(So(e)))).filter(Boolean).join(`
24
+
25
+ `)}},vo=({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:a,signal:o,signalDescription:s,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=yo(d,f);return t?`Command timed out after ${n} milliseconds${m}`:u?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${o} (${s})`:l?`Command was canceled${m}`:r?`${fo(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${Gn(p)})${m}`:o===void 0?c===void 0?`Command failed`:`Command failed with exit code ${c}`:`Command was killed with ${o} (${s})`:`Command failed with ${a}${m}`},yo=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,bo=(e,t)=>{if(e instanceof _n)return;let n=yn(e)?e.originalMessage:String(e?.message??e),r=vt(na(n,t));return r===``?void 0:r},xo=e=>typeof e==`string`?e:p(e),So=e=>Array.isArray(e)?e.map(e=>ca(Co(e))).filter(Boolean).join(`
26
+ `):Co(e),Co=e=>typeof e==`string`?e:N(e)?Me(e):``,wo=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>Oo({command:e,escapedCommand:t,cwd:a,durationMs:sn(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),To=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>Eo({error:e,command:t,escapedCommand:n,startTime:a,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),Eo=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:_,cwd:v,maxBuffer:y},isSync:b})=>{let{exitCode:x,signal:S,signalDescription:C}=ko(l,u),{originalMessage:w,shortMessage:T,message:E}=_o({stdio:d,all:f,ipcOutput:p,originalError:e,signal:S,signalDescription:C,exitCode:x,escapedCommand:n,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:_,maxBuffer:y,timeout:h,cwd:v}),D=gn(e,E,b);return Object.assign(D,Do({error:D,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:x,signal:S,signalDescription:C,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:w,shortMessage:T})),D},Do=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:_})=>Oo({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:sn(r),failed:!0,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isTerminated:u!==void 0,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:e.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),Oo=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),ko=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t;return{exitCode:n,signal:r,signalDescription:r===void 0?void 0:Gn(t)}},Ao=e=>Number.isFinite(e)?e:0;function jo(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(Ao(e*1e3)%1e3),nanoseconds:Math.trunc(Ao(e*1e6)%1e3)}}function Mo(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function No(e){switch(typeof e){case`number`:if(Number.isFinite(e))return jo(e);break;case`bigint`:return Mo(e)}throw TypeError(`Expected a finite number or bigint`)}const Po=e=>e===0||e===0n,Fo=(e,t)=>t===1||t===1n?e:`${e}s`,Io=24n*60n*60n*1000n;function Lo(e,t){let n=typeof e==`bigint`;if(!n&&!Number.isFinite(e))throw TypeError(`Expected a finite number or bigint`);t={...t};let r=e<0?`-`:``;e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],a=(e,t)=>{let n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&Po(e)&&!(t.colonNotation&&r===`m`))){if(a??=String(e),t.colonNotation){let e=a.includes(`.`)?a.split(`.`)[0].length:a.length,t=i.length>0?2:1;a=`0`.repeat(Math.max(0,t-e))+a}else a+=t.verbose?` `+Fo(n,e):r;i.push(a)}},s=No(e),c=BigInt(s.days);if(t.hideYearAndDays?o(BigInt(c)*24n+BigInt(s.hours),`hour`,`h`):(t.hideYear?o(c,`day`,`d`):(o(c/365n,`year`,`y`),o(c%365n,`day`,`d`)),o(Number(s.hours),`hour`,`h`)),o(Number(s.minutes),`minute`,`m`),!t.hideSeconds){if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(s.seconds),n=Number(s.milliseconds),r=Number(s.microseconds),i=Number(s.nanoseconds);if(o(e,`second`,`s`),t.formatSubMilliseconds)o(n,`millisecond`,`ms`),o(r,`microsecond`,`µs`),o(i,`nanosecond`,`ns`);else{let e=n+r/1e3+i/1e6,a=typeof t.millisecondsDecimalDigits==`number`?t.millisecondsDecimalDigits:0,s=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);o(Number.parseFloat(s),`millisecond`,`ms`,s)}}else{let r=a((n?Number(e%Io):e)/1e3%60,typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?r:r.replace(/\.0+$/,``);o(Number.parseFloat(i),`second`,`s`,i)}}if(i.length===0)return r+`0`+(t.verbose?` milliseconds`:`ms`);let l=t.colonNotation?`:`:` `;return typeof t.unitCount==`number`&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(l)}const Ro=(e,t)=>{e.failed&&Jt({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},zo=(e,t)=>{ut(t)&&(Ro(e,t),Bo(e,t))},Bo=(e,t)=>{let n=`(done in ${Lo(e.durationMs)})`;Jt({type:`duration`,verboseMessage:n,verboseInfo:t,result:e})},Vo=(e,t,{reject:n})=>{if(zo(e,t),e.failed&&n)throw e;return e},Ho=(e,t)=>K(e)?`asyncGenerator`:Zo(e)?`generator`:$o(e)?`fileUrl`:ts(e)?`filePath`:us(e)?`webStream`:W(e,{checkOpen:!1})?`native`:N(e)?`uint8Array`:fs(e)?`asyncIterable`:ps(e)?`iterable`:ds(e)?Go({transform:e},t):Qo(e)?Uo(e,t):`native`,Uo=(e,t)=>_a(e.transform,{checkOpen:!1})?Wo(e,t):ds(e.transform)?Go(e,t):Jo(e,t),Wo=(e,t)=>(Ko(e,t,`Duplex stream`),`duplex`),Go=(e,t)=>(Ko(e,t,`web TransformStream`),`webTransform`),Ko=({final:e,binary:t,objectMode:n},r,i)=>{qo(e,`${r}.final`,i),qo(t,`${r}.binary`,i),Yo(n,`${r}.objectMode`)},qo=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Jo=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!Xo(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(_a(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(ds(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Xo(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return Yo(n,`${i}.binary`),Yo(r,`${i}.objectMode`),K(e)||K(t)?`asyncGenerator`:`generator`},Yo=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},Xo=e=>K(e)||Zo(e),K=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Zo=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Qo=e=>M(e)&&(e.transform!==void 0||e.final!==void 0),$o=e=>Object.prototype.toString.call(e)===`[object URL]`,es=e=>$o(e)&&e.protocol!==`file:`,ts=e=>M(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>ns.has(e))&&rs(e.file),ns=new Set([`file`,`append`]),rs=e=>typeof e==`string`,is=e=>M(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>as.has(e))&&`value`in e,as=new Set([`value`,`input`]),os=(e,t)=>e===`native`&&typeof t==`string`&&!ss.has(t),ss=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),cs=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,ls=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,us=e=>cs(e)||ls(e),ds=e=>cs(e?.readable)&&ls(e?.writable),fs=e=>ms(e)&&typeof e[Symbol.asyncIterator]==`function`,ps=e=>ms(e)&&typeof e[Symbol.iterator]==`function`,ms=e=>typeof e==`object`&&!!e,q=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),hs=new Set([`fileUrl`,`filePath`,`fileNumber`]),gs=new Set([`fileUrl`,`filePath`]),_s=new Set([...gs,`webStream`,`nodeStream`]),vs=new Set([`webTransform`,`duplex`]),ys={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`},bs=(e,t,n,r)=>r===`output`?xs(e,t,n):Ss(e,t,n),xs=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},Ss=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},Cs=(e,t)=>{let n=e.findLast(({type:e})=>q.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},ws=(e,t,n,r)=>[...e.filter(({type:e})=>!q.has(e)),...Ts(e,t,n,r)],Ts=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>q.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=Es({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return As(a,n)},Es=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?Ds({stdioItem:e,optionName:i}):t===`webTransform`?Os({stdioItem:e,index:n,newTransforms:r,direction:a}):ks({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),Ds=({stdioItem:e,optionName:t})=>{let{value:n}=e,{transform:r}=n,{writableObjectMode:i,readableObjectMode:a}=r,{objectMode:o=a}=n;if(o&&!a)throw TypeError(`The \`${t}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&a)throw TypeError(`The \`${t}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:r,writableObjectMode:i,readableObjectMode:a}}},Os=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=M(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=bs(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},ks=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:a})=>{let{transform:o,final:s,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=M(t)?t:{transform:t},d=c||H.has(a),{writableObjectMode:f,readableObjectMode:p}=bs(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},As=(e,t)=>t===`input`?e.reverse():e,js=(e,t,n)=>{let r=e.map(e=>Ms(e,t));if(r.includes(`input`)&&r.includes(`output`))throw TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??Rs},Ms=(e,t)=>Ps[t]??Ns(e),Ns=({type:e,value:t,direction:n,optionName:r})=>{let i=Is[e](t);if(n===`input`&&i===`output`)throw TypeError(`The \`${r}\` option is invalid: \`input: true\` cannot be used with a writable value, which is always an output.`);return n??i},Ps=[`input`,`output`,`output`],J=()=>void 0,Fs=()=>`input`,Is={generator:J,asyncGenerator:J,fileUrl:J,filePath:J,iterable:Fs,asyncIterable:Fs,uint8Array:Fs,webStream:e=>ls(e)?`output`:`input`,nodeStream(e){return ga(e,{checkOpen:!1})?ha(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:J,duplex:J,native(e){let t=Ls(e);if(t!==void 0)return t;if(W(e,{checkOpen:!1}))return Is.nodeStream(e)}},Ls=e=>{if([0,g.stdin].includes(e))return`input`;if([1,2,g.stdout,g.stderr].includes(e))return`output`},Rs=`output`,zs=(e,t)=>t?[...e,`ipc`]:e,Bs=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=Ws(e,r).map((e,t)=>Ks(e,t));return Vs(o),a?qs(o,n,i):zs(o,t)},Vs=e=>{if(e.some(e=>Hs(e)))throw Error("The `ipc: true` option must be used instead of `stdio: 'ipc'`.")},Hs=e=>Array.isArray(e)?e.some(e=>Us(e)):Us(e),Us=e=>is(e)?e.value===`ipc`:e===`ipc`,Ws=(e,t)=>{if(e===void 0)return I.map(e=>t[e]);if(Gs(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${I.map(e=>`\`${e}\``).join(`, `)}`);if(typeof e==`string`)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let n=Math.max(e.length,I.length);return Array.from({length:n},(t,n)=>e[n])},Gs=e=>I.some(t=>e[t]!==void 0),Ks=(e,t)=>Array.isArray(e)?e.map(e=>Ks(e,t)):e??(t>=I.length?`ignore`:`pipe`),qs=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!dt(n,r)&&Js(e,r)?`ignore`:e),Js=(e,t)=>Ys(e,t)||Array.isArray(e)&&e.every(e=>Ys(e,t)),Ys=(e,t)=>e===`pipe`||Xs(e,t),Xs=(e,t)=>is(e)&&e.value===`pipe`&&(e.input===void 0||e.input===!1||Zs(t,e.input)),Zs=(e,t)=>t===!0&&(e===1||e===2),Qs=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=Y.get(e),i=ec(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(rc(i,t,n,!0));return a},$s=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=Y.get(e),i=ec(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(rc(i,t,n,!1));return a},Y=new WeakMap,ec=(e,t,n)=>{let r=tc(t,n);return nc(r,t,n,e),r},tc=(e,t)=>{let n=it(e);if(n!==void 0)return n;let{validOptions:r,defaultValue:i}=t?{validOptions:`"stdin"`,defaultValue:`stdin`}:{validOptions:`"stdout", "stderr", "all"`,defaultValue:`stdout`};throw TypeError(`"${oc(t)}" must not be "${e}".
27
+ It must be ${r} or "fd3", "fd4" (and so on).
28
+ It is optional and defaults to "${i}".`)},nc=(e,t,n,r)=>{let i=r[ac(e)];if(i===void 0)throw TypeError(`"${oc(n)}" must not be ${t}. That file descriptor does not exist.
29
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction===`input`&&!n)throw TypeError(`"${oc(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${oc(n)}" must not be ${t}. It must be a writable stream, not readable.
30
+ If you meant to use it as input, please set its "stdio" option to \`{value: 'pipe', input: true}\`.`)},rc=(e,t,n,r)=>{if(e===`all`&&!n.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:a}=ic(e,n);return`The "${i}: ${sc(a)}" option is incompatible with using "${oc(r)}: ${sc(t)}".
31
+ Please set this option with "pipe" instead.`},ic=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=ac(e);return a===0&&t!==void 0?{optionName:`stdin`,optionValue:t}:a===1&&n!==void 0?{optionName:`stdout`,optionValue:n}:a===2&&r!==void 0?{optionName:`stderr`,optionValue:r}:{optionName:`stdio[${a}]`,optionValue:i[a]}},ac=e=>e===`all`?1:e,oc=e=>e?`to`:`from`,sc=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,cc=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?lc({stdioItem:e,fdNumber:r,direction:i}):fc({stdioItem:e,fdNumber:r}),lc=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=uc({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(W(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},uc=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=dc(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(x.isatty(i))throw TypeError(`The \`${t}: ${sc(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:P(ue(i)),optionName:t}}},dc=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Je.indexOf(e);if(n!==-1)return n},fc=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:pc(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:pc(t,t,n),optionName:n}:W(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,pc=(e,t,n)=>{let r=Je[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},mc=({input:e,inputFile:t},n)=>n===0?[...hc(e),..._c(t)]:[],hc=e=>e===void 0?[]:[{type:gc(e),value:e,optionName:`input`}],gc=e=>{if(ga(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(N(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},_c=e=>e===void 0?[]:[{...vc(e),optionName:`inputFile`}],vc=e=>{if($o(e))return{type:`fileUrl`,value:e};if(rs(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},yc=e=>e.filter((t,n)=>e.every((e,r)=>!bc(t,e)||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),bc=(e,t)=>e.value===t.value&&e.direction===t.direction,xc=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=Sc(i,e);if(o.length!==0){if(a){Cc({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(_s.has(e))return wc({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});vs.has(e)&&Ec({otherStdioItems:o,type:e,value:t,optionName:n})}},Sc=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),Cc=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{gs.has(t)&&wc({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},wc=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>Tc(e,n));if(a.length===0)return;let o=a.find(e=>e.direction!==i);return Dc(o,r,t),i===`output`?a[0].stream:void 0},Tc=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,Ec=({otherStdioItems:e,type:t,value:n,optionName:r})=>{let i=e.find(({value:{transform:e}})=>e===n.transform);Dc(i,r,t)},Dc=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${ys[n]} that is the same.`)},Oc=(e,t,n,r)=>{let i=Bs(t,n,r).map((e,n)=>kc({stdioOption:e,fdNumber:n,options:t,isSync:r})),a=Bc({initialFileDescriptors:i,addProperties:e,options:t,isSync:r});return t.stdio=a.map(({stdioItems:e})=>Wc(e)),a},kc=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Ye(t),{stdioItems:a,isStdioArray:o}=Ac({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=js(a,t,i),c=a.map(e=>cc({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),l=ws(c,i,s,n),u=Cs(l,s);return zc(l,u),{direction:s,objectMode:u,stdioItems:l}},Ac=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=Array.isArray(e)?e:[e],a=mc(n,t),o=[...jc(i.map(e=>Nc(e,r)),a),...a],s=yc(o),c=s.length>1;return Fc(s,c,r),Lc(s),{stdioItems:s,isStdioArray:c}},jc=(e,t)=>t.length>0&&Mc(e)?[]:e,Mc=e=>e.length===1&&e[0].type===`native`&&e[0].value===`inherit`,Nc=(e,t)=>is(e)?Pc(e,t):{type:Ho(e,t),value:e,optionName:t},Pc=({value:e,input:t},n)=>(Yo(t,`${n}.input`),{type:Ho(e,n),value:e,direction:t?`input`:void 0,optionName:n}),Fc=(e,t,n)=>{if(e.length===0)throw TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(let{value:t,optionName:n}of e)if(Ic.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},Ic=new Set([`ignore`]),Lc=e=>{for(let t of e)Rc(t)},Rc=({type:e,value:t,optionName:n})=>{if(es(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
32
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(os(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},zc=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>hs.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},Bc=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(Vc({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw Uc(i),e}},Vc=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>({direction:e,objectMode:t,stdioItems:n.map(t=>Hc({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}))}),Hc=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=xc({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},Uc=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!F(e)&&e.destroy()},Wc=e=>{if(e.length>1)return e.some(({value:e})=>e===`overlapped`)?`overlapped`:`pipe`;let[{type:t,value:n}]=e;return t===`native`?n:`pipe`},Gc=(e,t)=>Oc(Xc,e,t,!0),X=({type:e,optionName:t})=>{Jc(t,ys[e])},Kc=({optionName:e,value:t})=>(t===`overlapped`&&Jc(e,`"${t}"`),{}),qc=e=>{let{optionName:t,value:n}=e;if(n===`pipe`&&t!==`stdin`)throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be an input pipe with synchronous methods.`);return Kc(e)},Jc=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Yc={generator(){},asyncGenerator:X,webStream:X,nodeStream:X,webTransform:X,duplex:X,asyncIterable:X,native:Kc},Xc={input:{...Yc,native:qc,fileUrl:({value:e})=>({contents:[P(ue(e))]}),filePath:({value:{file:e}})=>({contents:[P(ue(e))]}),fileNumber:X,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Yc,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:X,string:X,uint8Array:X}},Z=(e,{stripFinalNewline:t},n)=>Zc(t,n)&&e!==void 0&&!Array.isArray(e)?ca(e):e,Zc=(e,t)=>t===`all`?e[1]||e[2]:e[t],Qc=(e,t,n,r)=>e||n?void 0:tl(t,r),$c=(e,t,n)=>n?e.flatMap(e=>el(e,t)):el(e,t),el=(e,t)=>{let{transform:n,final:r}=tl(t,{});return[...n(e),...r()]},tl=(e,t)=>(t.previousChunks=``,{transform:nl.bind(void 0,t,e),final:il.bind(void 0,t)}),nl=function*(e,t,n){if(typeof n!=`string`){yield n;return}let{previousChunks:r}=e,i=-1;for(let a=0;a<n.length;a+=1){if(n[a]!==`
33
+ `)continue;let o=rl(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=sl(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=sl(r,n.slice(i+1))),e.previousChunks=r},rl=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),il=function*({previousChunks:e}){e.length>0&&(yield e)},al=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:ol.bind(void 0,r)},ol=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?cl:ll;if(t.at(-1)===i){yield t;return}yield a(t,e?r:n)},sl=(e,t)=>`${e}${t}`,cl={windowsNewline:`\r
34
+ `,unixNewline:`
35
+ `,LF:`
36
+ `,concatBytes:sl},ll={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}},ul=(e,t)=>e?void 0:dl.bind(void 0,t),dl=function*(e,t){if(typeof t!=`string`&&!N(t)&&!me.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},fl=(e,t)=>e?pl.bind(void 0,t):ml.bind(void 0,t),pl=function*(e,t){hl(e,t),yield t},ml=function*(e,t){if(hl(e,t),typeof t!=`string`&&!N(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},hl=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
37
+ Instead, \`yield\` should either be called with a value, or not be called at all. For example:
38
+ if (condition) { yield value; }`)},gl=(e,t,n)=>{if(n)return;if(e)return{transform:_l.bind(void 0,new TextEncoder)};let r=new l(t);return{transform:vl.bind(void 0,r),final:yl.bind(void 0,r)}},_l=function*(e,t){me.isBuffer(t)?yield P(t):typeof t==`string`?yield e.encode(t):yield t},vl=function*(e,t){yield N(t)?e.write(t):t},yl=function*(e){let t=e.end();t!==``&&(yield t)},bl=d(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),xl=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Tl}=t[n];for await(let i of r(e))yield*xl(i,t,n+1)},Sl=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Cl(n,Number(t),e)},Cl=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*xl(r,n,t+1)},wl=d(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Tl=function*(e){yield e},El=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},Dl=(e,t)=>[...t.flatMap(t=>[...Q(t,e,0)]),...Ol(e)],Q=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Al}=t[n];for(let i of r(e))yield*Q(i,t,n+1)},Ol=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*kl(n,Number(t),e)},kl=function*(e,t,n){if(e!==void 0)for(let r of e())yield*Q(r,n,t+1)},Al=function*(e){yield e},jl=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=Nl(e,o,a),l=K(t),u=K(n),d=l?bl.bind(void 0,xl,s):El.bind(void 0,Q),f=l||u?bl.bind(void 0,Sl,s):El.bind(void 0,Ol),p=l||u?wl.bind(void 0,s):void 0;return{stream:new _e({writableObjectMode:r,writableHighWaterMark:ye(r),readableObjectMode:i,readableHighWaterMark:ye(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},Ml=(e,t,n,r)=>{let i=t.filter(({type:e})=>e===`generator`),a=r?i.reverse():i;for(let{value:t,optionName:r}of a){let i=Nl(t,n,r);e=Dl(i,e)}return e},Nl=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:ul(r,s)},gl(n,o,r),Qc(n,a,r,c),{transform:e,final:t},{transform:fl(i,s)},al({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},Pl=(e,t)=>{for(let n of Fl(e))Il(e,n,t)},Fl=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),Il=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length===0)return;if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${ys[e]} with synchronous methods.`)}let a=i.map(({contents:e})=>e).map(e=>Ll(e,r));n.input=Fe(a)},Ll=(e,t)=>{let n=Ml(e,t,`utf8`,!0);return Rl(n),Fe(n)},Rl=e=>{let t=e.find(e=>typeof e!=`string`&&!N(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},zl=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&dt(n,r)&&!H.has(t)&&Bl(r)&&(e.some(({type:e,value:t})=>e===`native`&&Vl.has(t))||e.every(({type:e})=>q.has(e))),Bl=e=>e===1||e===2,Vl=new Set([`pipe`,`overlapped`]),Hl=async(e,t,n,r)=>{for await(let i of e)Wl(t)||Gl(i,n,r)},Ul=(e,t,n)=>{for(let r of e)Gl(r,t,n)},Wl=e=>e._readableState.pipes.length>0,Gl=(e,t,n)=>{let r=Qt(e);Jt({type:`output`,verboseMessage:r,fdNumber:t,verboseInfo:n})},Kl=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set;return{output:t.map((t,s)=>ql({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},ql=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:a,verboseInfo:o},{buffer:s,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(e===null)return;let f=ho(e,a,d),p=P(f),{stdioItems:m,objectMode:h}=t[n],g=Jl([p],m,c,r),{serializedResult:_,finalResult:v=_}=Yl({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});Xl({serializedResult:_,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:m,objectMode:h});let y=s[n]?v:void 0;try{return r.error===void 0&&Zl(_,m,i),y}catch(e){return r.error=e,y}},Jl=(e,t,n,r)=>{try{return Ml(e,t,n,!1)}catch(t){return r.error=t,e}},Yl=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:Fe(e)};let o=Ne(e,n);return r[a]?{serializedResult:o,finalResult:$c(o,!i[a],t)}:{serializedResult:o}},Xl=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!zl({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=$c(e,!1,o);try{Ul(s,t,r)}catch(e){n.error??=e}},Zl=(e,t,n)=>{let r=t.filter(({type:e})=>hs.has(e));for(let{path:t,append:i}of r){let r=typeof t==`string`?t:t.toString();i||n.has(r)?ae(t,e):(n.add(r),pe(t,e))}},Ql=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Z(t,n,`all`)]:Array.isArray(t)?[Z(e,n,`all`),...t]:N(e)&&N(t)?Le([e,t]):`${e}${t}`},$l=async(e,t)=>{let[n,r]=await eu(e);return t.isForcefullyTerminated??=!1,[n,r]},eu=async e=>{let[t,n]=await Promise.allSettled([O(e,`spawn`),O(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?tu(e):n.value},tu=async e=>{try{return await O(e,`exit`)}catch{return tu(e)}},nu=async e=>{let[t,n]=await e;if(!ru(t,n)&&iu(t,n))throw new _n;return[t,n]},ru=(e,t)=>e===void 0&&t===void 0,iu=(e,t)=>e!==0||t!==null,au=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=ou(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:mo(a,r,i)}},ou=(e,t,n)=>e===void 0?iu(t,n)?new _n:void 0:e,su=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=cu(e,t,n),d=fu({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s});return Vo(d,c,l)},cu=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=cn(e,t,n),s=lu(n),{file:c,commandArguments:l,options:u}=ia(e,t,s);return uu(u),{file:c,commandArguments:l,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:Gc(u,o)}},lu=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,uu=({ipc:e,ipcInput:t,detached:n,cancelSignal:r,killDescendants:i})=>{t&&du(`ipcInput`),e&&du(`ipc: true`),n&&du(`detached: true`),i&&du(`killDescendants: true`),r&&du(`cancelSignal`)},du=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},fu=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=pu({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:s});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=au(c,n),{output:m,error:h=l}=Kl({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a}),g=m.map((e,t)=>Z(e,n,t)),_=Z(Ql(m,n),n,`all`);return hu({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:n,command:r,escapedCommand:i,startTime:s})},pu=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{Pl(a,n);let r=mu(n);return c(...sa(e,t,r))}catch(e){return To({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},mu=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:go(t)}),hu=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:a,all:o,options:s,command:c,escapedCommand:l,startTime:u})=>e===void 0?wo({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):Eo({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:a,all:o,ipcOutput:[],options:s,startTime:u,isSync:!0}),gu=Symbol(`internalGetOneMessageOptions`),_u=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i={})=>{let{reference:a=!0,filter:o}=i,{signal:s}=i[gu]??{};return rr({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Nr(e)}),vu({anyProcess:e,channel:t,isSubprocess:n,filter:o,reference:a,signal:s})},vu=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i,signal:a})=>{xr(t,i);let o=Ar(e,t,n),s=new AbortController;yu(a,s);try{return await Promise.race([bu(o,r,s),xu(o,n,s),Su(o,n,s)])}catch(t){throw yr(e),t}finally{s.abort(),Cr(t,i)}},yu=(e,t)=>{if(e!==void 0){if(e.aborted){t.abort();return}e.addEventListener(`abort`,()=>{t.abort()},{once:!0,signal:t.signal})}},bu=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await O(e,`message`,{signal:n});return t}for await(let[r]of ne(e,`message`,{signal:n}))if(t(r))return r},xu=async(e,t,{signal:n})=>{await O(e,`disconnect`,{signal:n}),or(t)},Su=async(e,t,{signal:n})=>{let[r]=await O(e,`strict:error`,{signal:n});throw cr(r,t)},Cu=Symbol(`internalGetEachMessageOptions`),wu=(e,t={})=>{let{reference:n=!0}=t,{signal:r,shouldAwait:i=!e.isSubprocess}=t[Cu]??{};return Tu({...e,shouldAwait:i,reference:n,signal:r})},Tu=({anyProcess:e,waitProcess:t=e,channel:n,isSubprocess:r,ipc:i,shouldAwait:a,reference:o,signal:s})=>{rr({methodName:`getEachMessage`,isSubprocess:r,ipc:i,isConnected:Nr(e)}),xr(n,o);let c=Ar(e,n,r),l=new AbortController,u={};return Eu(s,l),Du(e,c,l),Ou({ipcEmitter:c,isSubprocess:r,controller:l,state:u}),ku({anyProcess:e,waitProcess:t,channel:n,ipcEmitter:c,isSubprocess:r,shouldAwait:a,controller:l,state:u,reference:o})},Eu=(e,t)=>{if(e!==void 0){if(e.aborted){t.abort();return}e.addEventListener(`abort`,()=>{t.abort()},{once:!0,signal:t.signal})}},Du=async(e,t,n)=>{try{await O(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},Ou=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await O(e,`strict:error`,{signal:n.signal});r.error=cr(i,t),n.abort()}catch{}},ku=async function*({anyProcess:e,waitProcess:t,channel:n,ipcEmitter:r,isSubprocess:i,shouldAwait:a,controller:o,state:s,reference:c}){try{for await(let[e]of ne(r,`message`,{signal:o.signal}))Au(s),yield e}catch{Au(s)}finally{o.abort(),Cr(n,c),i||yr(e),a&&await t}},Au=({error:e})=>{if(e)throw e},ju=(e,t,{ipc:n})=>{Object.assign(e,Nu(t,!1,n,e))},Mu=()=>{let e=g,t=g.channel!==void 0;return{...Nu(e,!0,t),getCancelSignal:ii.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},Nu=(e,t,n,r=e)=>({sendMessage:Qr.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:_u.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:wu.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n,waitProcess:r})}),Pu=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:o,verboseInfo:s})=>{Uc(r);let c=new a,l=Fu(c,r),u=To({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:o,isSync:!1});return{subprocess:c,promise:Wu(u,s,i),all:i.all?l:void 0,convertedStreams:{readable:Lu,writable:Ru,duplex:zu,readableStream:Bu,writableStream:Vu,transformStream:Hu,iterable:Uu,[Symbol.asyncIterator]:Uu}}},Fu=(e,t)=>{let n=Iu(),r=Iu(),i=Iu(),a=Array.from({length:t.length-3},Iu),o=Iu(),s=[n,r,i,...a];return Object.assign(e,{stdin:n,stdout:r,stderr:i,stdio:s}),o},Iu=()=>{let e=new ge;return e.end(),e},Lu=()=>new j({read(){}}),Ru=()=>new ve({write(){}}),zu=()=>new he({read(){},write(){}}),Bu=()=>j.toWeb(Lu()),Vu=()=>ve.toWeb(Ru()),Hu=()=>he.toWeb(zu()),Uu=async function*(){},Wu=async(e,t,n)=>Vo(e,t,n),Gu=(e,t)=>Oc(Ju,e,t,!1),Ku=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${ys[e]}.`)},qu={fileNumber:Ku,generator:jl,asyncGenerator:jl,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:he.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Ju={input:{...qu,fileUrl:({value:e})=>({stream:se(e)}),filePath:({value:{file:e}})=>({stream:se(e)}),webStream:({value:e})=>({stream:j.fromWeb(e)}),iterable:({value:e})=>({stream:j.from(e)}),asyncIterable:({value:e})=>({stream:j.from(e)}),string:({value:e})=>({stream:j.from(e)}),uint8Array:({value:e})=>({stream:j.from(me.from(e))})},output:{...qu,fileUrl:({value:e})=>({stream:ce(e)}),filePath:({value:{file:e,append:t}})=>({stream:ce(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:ve.fromWeb(e)}),iterable:Ku,asyncIterable:Ku,string:Ku,uint8Array:Ku}};function Yu(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)td(t);let t=e.some(({readableObjectMode:e})=>e),n=Xu(e,t),r=new Zu({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const Xu=(e,t)=>{if(e.length===0)return ye(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)};var Zu=class extends ge{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#i=Symbol(`unpipe`);#a=new WeakMap;add(e){if(td(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Qu(this,this.#e,this.#i);let t=nd({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#i});this.#a.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(td(e),!this.#e.has(e))return!1;let t=this.#a.get(e);return t!==void 0&&(this.#a.delete(e),e.unpipe(this),await t,!0)}};const Qu=async(e,t,n)=>{fd(e,pd);let r=new AbortController;try{await Promise.race([$u(e,r),ed(e,t,n,r)])}finally{r.abort(),fd(e,-pd)}},$u=async(e,{signal:t})=>{try{await A(e,{signal:t,cleanup:!0})}catch(t){throw sd(e,t),t}},ed=async(e,t,n,{signal:r})=>{for await(let[i]of ne(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},td=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},nd=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{fd(e,md);let s=new AbortController;try{await Promise.race([rd(a,t,s),id({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),ad({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),fd(e,-md)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?ld(e):od(e))},rd=async(e,t,{signal:n})=>{try{await e,n.aborted||ld(t)}catch(e){n.aborted||sd(t,e)}},id=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await A(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;cd(r)?i.add(t):ud(e,r)}},ad=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await O(e,i,{signal:a}),!e.readable)return O(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},od=e=>{e.writable&&e.end()},sd=(e,t)=>{cd(t)?ld(e):ud(e,t)},cd=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,ld=e=>{(e.readable||e.writable)&&e.destroy()},ud=(e,t)=>{e.destroyed||(e.once(`error`,dd),e.destroy(t))},dd=()=>{},fd=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},pd=2,md=1,hd=(e,t)=>{e.pipe(t),gd(e,t),vd(e,t)},gd=async(e,t)=>{if(!(F(e)||F(t))){try{await A(e,{cleanup:!0,readable:!0,writable:!1})}catch{}_d(t)}},_d=e=>{e.writable&&e.end()},vd=async(e,t)=>{if(!(F(e)||F(t))){try{await A(t,{cleanup:!0,readable:!1,writable:!0})}catch{}yd(e)}},yd=e=>{e.readable&&e.destroy()},bd=(e,t,n)=>{let r=new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){let t=a.filter(({type:e})=>q.has(e));for(let{stream:n}of t)xd(e,n,o,i);let s=a.filter(({type:e})=>!q.has(e));for(let{stream:t}of s)Cd({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r){let n=t.length===1?t[0]:Yu(t);hd(n,e)}},xd=(e,t,n,r)=>{n===`output`?hd(e.stdio[r],t):hd(t,e.stdio[r]);let i=Sd[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},Sd=[`stdin`,`stdout`,`stderr`],Cd=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;wd(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},wd=(e,{signal:t})=>{F(e)&&br(e,Td,t)},Td=2,Ed=g.platform===`win32`,Dd=e=>e.killDescendants&&!Ed?{...e,detached:!0}:e,Od=(e,{killDescendants:t})=>t?(Ed?Ad:kd).bind(void 0,e):e.kill.bind(e),kd=(e,t)=>{if(e.pid===void 0)return!1;try{return g.kill(-e.pid,t)}catch{return e.kill(t)}},Ad=(e,t)=>{if(e.pid===void 0)return!1;let n=jd();return n===void 0?e.kill(t):(o(n,[`/pid`,`${e.pid}`,`/T`,`/F`],n=>{n&&e.kill(t)}),!0)},jd=()=>{let e=[g.env.SystemRoot,g.env.windir].find(e=>e&&Md(e));return e===void 0?void 0:be.join(e,`System32`,`taskkill.exe`)},Md=e=>{let{root:t}=be.parse(e);return/^[a-z]:[/\\]/i.test(t)},$=[];$.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&$.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&$.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const Nd=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,Pd=Symbol.for(`signal-exit emitter`),Fd=globalThis,Id=Object.defineProperty.bind(Object);var Ld=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Fd[Pd])return Fd[Pd];Id(Fd,Pd,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?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(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},Rd=class{};const zd=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var Bd=class extends Rd{onExit(){return()=>{}}load(){}unload(){}},Vd=class extends Rd{#e=Hd.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new Ld;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of $)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!Nd(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of $)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,$.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return Nd(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&Nd(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}return n.call(this.#n,e,...t)}};const Hd=globalThis.process,{onExit:Ud,load:Wd,unload:Gd}=zd(Nd(Hd)?new Vd(Hd):new Bd),Kd=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let i=Ud(()=>{e()});te(r,()=>{i()})},qd=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Jd=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=B();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},Yd=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},Xd=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return Zd(t,o),ef({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},Zd=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Qd=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;$d(t,o,e);let s=e.readableObjectMode&&!a;return ef({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},$d=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},ef=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>{let s=ne(e,`data`,{signal:t.signal,highWaterMark:nf,highWatermark:nf});return rf({onStdoutChunk:s,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})},tf=ye(!0),nf=tf,rf=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=af({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*Q(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*Ol(s)}},af=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[gl(e,n,!t),Qc(e,i,!r,{})].filter(Boolean),of=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||H.has(t),o=$s(e,n),s=Xd({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i});return sf(s,o,e)},sf=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},cf=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=lf(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],A(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||ff(e,t,n,r)}finally{o.abort()}},lf=(e,{originalStreams:t,subprocess:n})=>{let[r]=t,i={stdinCleanedUp:!1};return e===r&&uf(e,n,i),i},uf=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{df(t,n),r.call(e,...i)}},df=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},ff=(e,t,n,r)=>{if(!pf(e,t,n,r))throw e},pf=(e,t,n,r=!0)=>n.propagating?gf(e)||hf(e):(n.propagating=!0,mf(n,t)===r?gf(e):hf(e)),mf=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,hf=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,gf=e=>e?.code===`EPIPE`,_f=async e=>{if(e!==void 0)try{await yf(e)}catch{}},vf=async e=>{if(e!==void 0)try{await bf(e)}catch{}},yf=async e=>{await A(e,{cleanup:!0,readable:!1,writable:!0})},bf=async e=>{await A(e,{cleanup:!0,readable:!0,writable:!1})},xf=async(e,t)=>{if(await e,t)throw t},Sf=(e,t,n)=>{n&&!hf(n)?e.destroy(n):t&&e.destroy()},Cf=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||H.has(n),{subprocessStdout:s,waitReadableDestroy:c}=wf(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:f}=Tf(s,o),{read:p,onStdoutDataDone:m}=Ef({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),h=new j({read:p,destroy:d(Af.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:u,encoding:l});return Of({subprocessStdout:s,onStdoutDataDone:m,readable:h,subprocess:e}),h},wf=(e,t,n)=>{let r=$s(e,t);return{subprocessStdout:r,waitReadableDestroy:Jd(n,r,`readableDestroy`)}},Tf=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:tf},Ef=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=B(),o=Xd({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Df(this,o,a)},onStdoutDataDone:a}},Df=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},Of=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await bf(e),await r,await _f(i),await t,n.readable&&n.push(null)}catch(e){await _f(i),jf(n,await kf(r,e))}},kf=async(e,t)=>{if(t.code!==`ERR_STREAM_PREMATURE_CLOSE`)return t;try{await e}catch(e){return e}return t},Af=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Yd(n,t)&&(jf(e,r),await xf(t,r))},jf=(e,t)=>{Sf(e,e.readable,t)},Mf=(e,t)=>j.toWeb(e.readable(t)),Nf=(e,t)=>ve.toWeb(e.writable(t)),Pf=(e,t)=>he.toWeb(e.duplex(t)),Ff=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=on(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=If(n,r,i),{sourceStream:d,sourceError:f}=zf(e,l),{options:p,fileDescriptors:m}=Y.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},If=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=Lf(e,t,...n);return{destination:r,destinationStream:Qs(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},Lf=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(Rf,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||we(n)){if(Object.keys(e).length>0)throw TypeError(`Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).`);let[i,a,o]=Ee(n,...r);return{destination:t(Rf)(i,a,o),pipeOptions:o}}if(Y.has(n)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},Rf=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),zf=(e,t)=>{try{return{sourceStream:$s(e,t)}}catch(e){return{sourceError:e}}},Bf=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=Vf({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw Hf({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},Vf=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return yd(e),r;if(t!==void 0)return _d(n),t},Hf=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>To({error:e,command:Uf,escapedCommand:Uf,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Uf=`source.pipe(destination)`,Wf=async e=>{let[{status:t,reason:n,value:r=n},{status:i,reason:a,value:o=a}]=await e;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i===`rejected`)throw o;if(t===`rejected`)throw r;return o},Gf=(e,t,n)=>{let r=Yf.has(t)?qf(e,t):Kf(e,t);return br(e,Xf,n.signal),br(t,Zf,n.signal),Jf(t),r},Kf=(e,t)=>{let n=Yu([e]);return hd(n,t),Yf.set(t,n),n},qf=(e,t)=>{let n=Yf.get(t);return n.add(e),n},Jf=async e=>{try{await A(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Yf.delete(e)},Yf=new WeakMap,Xf=2,Zf=1,Qf=(e,t)=>e===void 0?[]:[$f(e,t)],$f=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await u(e,t),await n.remove(t),Hf({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})},ep=(e,...t)=>{if(M(t[0]))return ep.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=Ff(e,...t),i=new AbortController,a=hp({...r,destination:n,pipeFailureController:i});return a.pipe=ep.bind(void 0,{...e,source:n,sourcePromise:a,boundOptions:{}}),tp(a,n,i.signal),a},tp=(e,t,n)=>{t!==void 0&&(np(e,t),sp(e,t,n))},np=(e,t)=>{let n=Y.get(t);Y.set(e,n),e.stdio=t.stdio,e.all=t.all;let{options:{encoding:r}}=n,i=qd();e[Symbol.asyncIterator]=of.bind(void 0,e,r,{}),e.iterable=of.bind(void 0,e,r),e.readable=ap.bind(void 0,e,{subprocess:e,concurrentStreams:i,encoding:r}),e.readableStream=Mf.bind(void 0,e),rp(e,t)},rp=(e,t)=>{if(t.all===void 0){e.all=void 0;return}Object.defineProperty(e,"all",{get(){ip(e,t.all);let n=e.readable({from:`all`});return ip(e,n),n},enumerable:!0,configurable:!0})},ip=(e,t)=>{Object.defineProperty(e,"all",{value:t,writable:!0,enumerable:!0,configurable:!0})},ap=(e,t,...n)=>{let r=Cf(t,...n);return op(e,r),r},op=async(e,t)=>{try{await e}catch(e){t.destroy(e)}},sp=(e,t,n)=>{e.sendMessage=t.sendMessage,e.getOneMessage=cp.bind(void 0,t,n),e.getEachMessage=dp.bind(void 0,e,t,n)},cp=(e,t,...n)=>{let r=new AbortController,i=e.getOneMessage(...pp(n,r.signal,gu));return lp(t,i,r)},lp=async(e,t,n)=>{try{return await Promise.race([t,up(e,n.signal)])}finally{n.abort()}},up=(e,t)=>new Promise((n,r)=>{if(e.aborted){r(e.reason);return}e.addEventListener(`abort`,()=>{r(e.reason)},{once:!0,signal:t})}),dp=(e,t,n,...r)=>{let i=new AbortController,a=t.getEachMessage(...pp(r,i.signal,Cu));return mp(n,i),fp(e,a,i)},fp=async function*(e,t,n){try{yield*t}finally{n.abort(),await e}},pp=(e,t,n)=>{if(e[0]===null)return e;let[r]=e;return[{...r,[n]:{signal:t,shouldAwait:!1}}]},mp=(e,t)=>{if(e.aborted){t.abort();return}e.addEventListener(`abort`,()=>{t.abort()},{once:!0,signal:t.signal})},hp=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l,pipeFailureController:u})=>{let d=new AbortController;try{let u=gp(e,i);Bf({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let f=Gf(t,a,d);return await Promise.race([Wf(u),...Qf(s,{sourceStream:t,mergedStream:f,sourceOptions:n,fileDescriptors:c,startTime:l})])}catch(e){throw u.abort(e),e}finally{d.abort()}},gp=(e,t)=>Promise.allSettled([e,t]),_p=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:a,lines:o,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=vp({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([yp(e),d]);return}let f=Zc(c,n),p=Qd({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:f,allMixed:s}),[m]=await Promise.all([bp({stream:e,iterable:p,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return m},vp=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{if(!zl({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n}))return;let s=Qd({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await Hl(s,e,n,a)},yp=async e=>{await T(),e.readableFlowing===null&&e.resume()},bp=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await Va(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await Ua(n,{maxBuffer:a})):await io(n,{maxBuffer:a})}catch(n){return Sp(co({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},xp=async e=>{try{return await e}catch(e){return Sp(e)}},Sp=({bufferedData:e})=>Oe(e)?new Uint8Array(e):e,Cp=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>wp({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),wp=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l})=>{if(!e)return;let u=cf(e,t,l);if(mf(l,t)){await u;return}let[d]=await Promise.all([_p({stream:e,onStreamEnd:u,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l}),u]);return d},Tp=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Yu([e,t].filter(Boolean)):void 0,Ep=({subprocess:e,all:t,encoding:n,buffer:r,maxBuffer:i,lines:a,stripFinalNewline:o,verboseInfo:s,streamInfo:c})=>wp({...Dp(e,t,r),fdNumber:`all`,encoding:n,maxBuffer:i[1]+i[2],lines:a[1]||a[2],allMixed:Op(e,t),stripFinalNewline:o,verboseInfo:s,streamInfo:c}),Dp=({stdout:e,stderr:t},n,[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},Op=({stdout:e,stderr:t},n)=>n&&e&&t&&e.readableObjectMode!==t.readableObjectMode,kp=e=>dt(e,`ipc`),Ap=(e,t)=>{let n=Qt(e);Jt({type:`ipc`,verboseMessage:n,fdNumber:`ipc`,verboseInfo:t})},jp=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=kp(a),s=lt(t,`ipc`),c=lt(n,`ipc`);for await(let t of Tu({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(uo(e,i,c),i.push(t)),o&&Ap(t,a);return i},Mp=async(e,t)=>(await Promise.allSettled([e]),t),Np=async({subprocess:e,kill:t,all:n,options:{encoding:r,buffer:i,maxBuffer:a,lines:o,timeoutDuration:s,cancelSignal:c,gracefulCancel:l,forceKillAfterDelay:u,stripFinalNewline:d,ipc:f,ipcInput:p},context:m,verboseInfo:h,fileDescriptors:g,originalStreams:_,onInternalError:v,controller:y})=>{let b=$l(e,m),x={originalStreams:_,fileDescriptors:g,subprocess:e,exitPromise:b,propagating:!1},S=Cp({subprocess:e,encoding:r,buffer:i,maxBuffer:a,lines:o,stripFinalNewline:d,verboseInfo:h,streamInfo:x}),C=Ep({subprocess:e,all:n,encoding:r,buffer:i,maxBuffer:a,lines:o,stripFinalNewline:d,verboseInfo:h,streamInfo:x}),w=[],T=jp({subprocess:e,buffer:i,maxBuffer:a,ipc:f,ipcOutput:w,verboseInfo:h}),E=Pp(_,e,x),D=Fp(g,x);try{return await Promise.race([Promise.all([{},nu(b),Promise.all(S),C,T,Si(e,p,f),...E,...D]),v,Ip(e,y),...gi(t,s,m,y),...tr({kill:t,cancelSignal:c,gracefulCancel:l,context:m,controller:y}),...fi({subprocess:e,kill:t,cancelSignal:c,gracefulCancel:l,forceKillAfterDelay:u,context:m,controller:y})])}catch(e){return m.terminationReason??=`other`,Promise.all([{error:e},b,Promise.all(S.map(e=>xp(e))),xp(C),Mp(T,w),Promise.allSettled(E),Promise.allSettled(D)])}},Pp=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:cf(e,r,n)),Fp=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>W(t,{checkOpen:!1})&&!F(t)).map(({type:e,value:r,stream:i=r})=>cf(i,n,t,{isSameDirection:q.has(e),stopOnExit:e===`native`}))),Ip=async(e,{signal:t})=>{let[n]=await O(e,`error`,{signal:t});throw n},Lp=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=Rp(e,n,t),o=new ve({...zp(r,e,i),destroy:d(Gp.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Hp(r,o,void 0,e),o},Rp=(e,t,n)=>{let r=Qs(e,t);return{subprocessStdin:r,waitWritableFinal:Jd(n,r,`writableFinal`),waitWritableDestroy:Jd(n,r,`writableDestroy`)}},zp=(e,t,n)=>({write:Bp.bind(void 0,e),final:d(Vp.bind(void 0,e,t,n))}),Bp=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},Vp=async(e,t,n)=>{await Yd(n,t)&&(e.writable&&e.end(),await t)},Hp=async(e,t,n,r)=>{try{await yf(e),await r,t.writable&&t.end()}catch(e){await vf(n),Kp(t,await Up(r,e))}},Up=async(e,t)=>{if(!Wp(t))return t;try{await e}catch(e){return e}return t},Wp=e=>e===void 0||hf(e),Gp=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Yd(n,t),await Yd(r,t)&&(Kp(e,i),await xf(t,i))},Kp=(e,t)=>{Sf(e,e.writable,t)},qp=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||H.has(n),{subprocessStdout:c,waitReadableDestroy:l}=wf(e,r,t),{subprocessStdin:u,waitWritableFinal:f,waitWritableDestroy:p}=Rp(e,i,t),{readableEncoding:m,readableObjectMode:h,readableHighWaterMark:g}=Tf(c,s),{read:_,onStdoutDataDone:v}=Ef({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),y=new he({read:_,...zp(u,e,f),destroy:d(Jp.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:f,waitWritableDestroy:p})),readableHighWaterMark:g,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:m});return Of({subprocessStdout:c,onStdoutDataDone:v,readable:y,subprocess:e,subprocessStdin:u}),Hp(u,y,c,e),y},Jp=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([Af({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),Gp({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},Yp=(e,{encoding:t})=>{let n=qd();e.readable=Cf.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=Lp.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=qp.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.readableStream=Mf.bind(void 0,e),e.writableStream=Nf.bind(void 0,e),e.transformStream=Pf.bind(void 0,e),e.iterable=of.bind(void 0,e,t),e[Symbol.asyncIterator]=of.bind(void 0,e,t,{})},Xp=(e,t)=>Object.assign(e,t),Zp=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Qp(e,t,n),{subprocess:f,promise:p,kill:m,all:h,convertedStreams:g}=em({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d}),_=tm({promise:p,nodeChildProcess:f,kill:m,all:h,convertedStreams:g,options:u});return _.pipe=ep.bind(void 0,{source:_,sourcePromise:p,boundOptions:{},createNested:r}),Y.set(_,{options:u,fileDescriptors:d}),_},Qp=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=cn(e,t,n),{file:s,commandArguments:c,options:l}=ia(e,t,n),u=$p(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:Gu(u,o)}},$p=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},em=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:c})=>{let l;try{l=s(...sa(e,t,Dd(n)))}catch(e){return Pu({error:e,command:a,escapedCommand:o,fileDescriptors:c,options:n,startTime:r,verboseInfo:i})}let u=new AbortController;re(1/0,u.signal);let d=[...l.stdio];bd(l,c,u),Jr(l,n);let f={},p=B(),m=Jn.bind(void 0,{kill:Od(l,n),options:n,onInternalError:p,context:f,controller:u});Kd(m,n,u);let h=Tp(l,n),g=rm({subprocess:l,kill:m,all:h,options:n,startTime:r,verboseInfo:i,fileDescriptors:c,originalStreams:d,command:a,escapedCommand:o,context:f,onInternalError:p,controller:u});return{subprocess:l,promise:g,kill:m,all:h}},tm=({promise:e,nodeChildProcess:t,kill:n,all:r,convertedStreams:i,options:a})=>{let o=Xp(e,nm(t,r));return o.kill=n??o.kill,i===void 0?Yp(o,a):Object.assign(o,i),ju(o,t,a),o},nm=(e,t)=>({nodeChildProcess:e,pid:e.pid,stdin:e.stdin,stdout:e.stdout,stderr:e.stderr,stdio:e.stdio,all:t,kill:e.kill.bind(e)}),rm=async({subprocess:e,kill:t,all:n,options:r,startTime:i,verboseInfo:a,fileDescriptors:o,originalStreams:s,command:c,escapedCommand:l,context:u,onInternalError:d,controller:f})=>{let[p,[m,h],g,_,v]=await Np({subprocess:e,kill:t,all:n,options:r,context:u,verboseInfo:a,fileDescriptors:o,originalStreams:s,onInternalError:d,controller:f});f.abort(),d.resolve();let y=g.map((e,t)=>Z(e,r,t)),b=Z(_,r,`all`),x=im({errorInfo:p,exitCode:m,signal:h,stdio:y,all:b,ipcOutput:v,context:u,options:r,command:c,escapedCommand:l,startTime:i});return Vo(x,a,r)},im=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,context:o,options:s,command:c,escapedCommand:l,startTime:u})=>`error`in e?Eo({error:e.error,command:c,escapedCommand:l,timedOut:o.terminationReason===`timeout`,isCanceled:o.terminationReason===`cancel`||o.terminationReason===`gracefulCancel`,isGracefullyCanceled:o.terminationReason===`gracefulCancel`,isMaxBuffer:e.error instanceof Ia,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):wo({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),am=(e,t)=>{let n={__proto__:null,...e},r=Object.fromEntries(Object.entries(t).map(([e,t])=>[e,om(e,n[e],t)]));return{...n,...r}},om=(e,t,n)=>sm.has(e)&&M(t)&&M(n)?{...t,...n}:n,sm=new Set([`env`,...ct]),cm=(e,t,n,r)=>{let i=(e,t,r)=>cm(e,t,n,r),a=(...a)=>lm({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},lm=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(M(a))return i(e,am(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=um({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?su(s,c,l):Zp(s,c,l,i)},um=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let a=ze(t)?Be(t,n):[t,...n],[o,s,c]=Ee(...a),l=am(am(r,i),c),{options:u=l,isSync:d=!1}=e({options:l});return{file:o,commandArguments:s,options:u,isSync:d}},dm=(e,t,n)=>{e.sync=t(pm,n),e.s=e.sync},fm=({options:e})=>mm(e),pm=({options:e})=>({...mm(e),isSync:!0}),mm=e=>({options:{...hm(e),...e}}),hm=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},gm={preferLocal:!0},_m=cm(()=>({})),vm=cm(()=>({isSync:!0}));cm(vi),cm(fm,{},gm,dm);const{sendMessage:ym,getOneMessage:bm,getEachMessage:xm,getCancelSignal:Sm}=Mu();var Cm=class e{constructor(e){this.cmd=e}sync(...t){return e.run(this.cmd,t).sync()}run(...t){return e.run(this.cmd,t)}get(...t){return e.run(this.cmd,t).get()}static run(t,n=[],r={}){let i=(e={})=>_m(t,n,{cwd:process.cwd(),...e,...r}),a=!0,o=new Promise((e,t)=>{setTimeout(async()=>{if(a)try{e(await i({stdio:`inherit`}))}catch(e){t(e)}else e()},10)});return o.toStream=e=>(a=!1,i(e)),o.cwd=e=>(r.cwd=e,o),o.sync=e=>(a=!1,vm(t,n,{cwd:process.cwd(),stdio:`inherit`,...r,...e})),o.getRaw=i=>(a=!1,e.getRaw(t,n,{cwd:process.cwd(),...r,...i})),o.get=o.getRaw,o}static getRaw(e,t,n){return r(e,t,n).output.filter(e=>e!==null).map(e=>e.toString()).join(`
39
+ `).trim()}},wm=n(((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}})),Tm=n(((e,n)=>{let r=t(`os`),i=t(`tty`),a=wm(),{env:o}=process,s;a(`no-color`)||a(`no-colors`)||a(`color=false`)||a(`color=never`)?s=0:(a(`color`)||a(`colors`)||a(`color=true`)||a(`color=always`))&&(s=1),`FORCE_COLOR`in o&&(s=o.FORCE_COLOR===`true`?1:o.FORCE_COLOR===`false`?0:o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3));function c(e){return e!==0&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,t){if(s===0)return 0;if(a(`color=16m`)||a(`color=full`)||a(`color=truecolor`))return 3;if(a(`color=256`))return 2;if(e&&!t&&s===void 0)return 0;let n=s||0;if(o.TERM===`dumb`)return n;if(process.platform===`win32`){let e=r.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in o)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in o)||o.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in o)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION);if(o.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in o){let e=parseInt((o.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(o.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||`COLORTERM`in o?1:n}function u(e){return c(l(e,e&&e.isTTY))}n.exports={supportsColor:u,stdout:c(l(!0,i.isatty(1))),stderr:c(l(!0,i.isatty(2)))}}));const Em=new class extends Cm{constructor(){super(`git`)}init(...e){return this.run(`init`,...e)}add(...e){return this.run(`add`,...e)}status(...e){return this.sync(`status`,...e)}branch(...e){return this.run(`branch`,...e)}clean(...e){return this.run(`clean`,...e)}config(...e){return this.run(`config`,...e).get()}checkout(...e){return this.run(`checkout`,...e)}commit(...e){return this.run(`commit`,...e)}fetch(...e){return this.run(`fetch`,...e)}prune(...e){return this.run(`prune`,...e)}merge(...e){return this.sync(`merge`,...e)}reset(...e){return this.sync(`reset`,...e)}remote(...e){return this.run(`remote`,...e)}rebase(...e){return this.run(`rebase`,...e)}getCommitTag(e=`HEAD`){return this.get(`rev-parse`,`--short`,e)}getBranchName(e=`HEAD`){return this.get(`rev-parse`,`--abbrev-ref`,e)}getLastCommitMsg(){return this.get(`log`,`-1`,`--pretty=%B`)}push(...e){return this.run(`push`,...e)}branchExists(e,t=`origin`){return this.run(`branch`,`-a`).getRaw().trim().includes(`remotes/${t}/${e}`)}checkBranchRemoteStatus(e,t=`origin`){return this.run(`cherry`,e,`${t}/${e}`).get()}branches(...e){return this.run(`branch`,...e).get().split(`
40
+ `).map(e=>e.trim().replace(`* `,``)).filter(e=>!!e).filter(e=>!String(e).includes(`/HEAD`))}show(e){return this.run(`show`,`--format="%ci|%cr|%an"`,e,`--`).getRaw().split(`
41
+ `)[0].trim()}branchesInfos(...e){return this.branches(...e).map(e=>{try{let[t,n,r]=this.show(e).split(`|`);return{branch:e,date:t,creation:n,author:r}}catch{return}}).filter(e=>!!e).sort((e,t)=>e.date<t.date?1:-1)}},Dm=e=>e instanceof URL?i(e):e;function Om(e,{cwd:t=g.cwd(),type:n=`file`,stopAt:r}={}){let i=S.resolve(Dm(t)??``),{root:a}=S.parse(i);r=S.resolve(i,Dm(r)??a);let o=S.isAbsolute(e);for(;i;){let t=o?e:S.join(i,e);try{let e=k.statSync(t,{throwIfNoEntry:!1});if(n===`file`&&e?.isFile()||n===`directory`&&e?.isDirectory())return t}catch{}if(i===r||i===a)break;i=S.dirname(i)}}function km(e=g.cwd()){return!!Om(`yarn.lock`,{cwd:e})}var Am=n(((e,t)=>{t.exports=Array.isArray})),jm=n(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),Mm=n(((e,t)=>{var n=jm(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),Nm=n(((e,t)=>{t.exports=Mm().Symbol})),Pm=n(((e,t)=>{var n=Nm(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),Fm=n(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),Im=n(((e,t)=>{var n=Nm(),r=Pm(),i=Fm(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),Lm=n(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),Rm=n(((e,t)=>{var n=Im(),r=Lm(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),zm=n(((e,t)=>{var n=Am(),r=Rm(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Bm=n(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Vm=n(((e,t)=>{var n=Im(),r=Bm(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Hm=n(((e,t)=>{t.exports=Mm()[`__core-js_shared__`]})),Um=n(((e,t)=>{var n=Hm(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Wm=n(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Gm=n(((e,t)=>{var n=Vm(),r=Um(),i=Bm(),a=Wm(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Km=n(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),qm=n(((e,t)=>{var n=Gm(),r=Km();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Jm=n(((e,t)=>{t.exports=qm()(Object,`create`)})),Ym=n(((e,t)=>{var n=Jm();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Xm=n(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),Zm=n(((e,t)=>{var n=Jm(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Qm=n(((e,t)=>{var n=Jm(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),$m=n(((e,t)=>{var n=Jm(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),eh=n(((e,t)=>{var n=Ym(),r=Xm(),i=Zm(),a=Qm(),o=$m();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),th=n(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),nh=n(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),rh=n(((e,t)=>{var n=nh();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),ih=n(((e,t)=>{var n=rh(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),ah=n(((e,t)=>{var n=rh();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),oh=n(((e,t)=>{var n=rh();function r(e){return n(this.__data__,e)>-1}t.exports=r})),sh=n(((e,t)=>{var n=rh();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),ch=n(((e,t)=>{var n=th(),r=ih(),i=ah(),a=oh(),o=sh();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),lh=n(((e,t)=>{t.exports=qm()(Mm(),`Map`)})),uh=n(((e,t)=>{var n=eh(),r=ch(),i=lh();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),dh=n(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),fh=n(((e,t)=>{var n=dh();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),ph=n(((e,t)=>{var n=fh();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),mh=n(((e,t)=>{var n=fh();function r(e){return n(this,e).get(e)}t.exports=r})),hh=n(((e,t)=>{var n=fh();function r(e){return n(this,e).has(e)}t.exports=r})),gh=n(((e,t)=>{var n=fh();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),_h=n(((e,t)=>{var n=uh(),r=ph(),i=mh(),a=hh(),o=gh();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),vh=n(((e,t)=>{var n=_h(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),yh=n(((e,t)=>{var n=vh(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),bh=n(((e,t)=>{var n=yh(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),xh=n(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),Sh=n(((e,t)=>{var n=Nm(),r=xh(),i=Am(),a=Rm(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),Ch=n(((e,t)=>{var n=Sh();function r(e){return e==null?``:n(e)}t.exports=r})),wh=n(((e,t)=>{var n=Am(),r=zm(),i=bh(),a=Ch();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),Th=n(((e,t)=>{var n=Rm(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),Eh=n(((e,t)=>{var n=wh(),r=Th();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),Dh=e(n(((e,t)=>{var n=Eh();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r}))(),1);function Oh(){try{let e=xe.readFileSync(`${process.cwd()}/package.json`,{encoding:`utf8`});return JSON.parse(e)}catch(e){return console.error(`Error while loading package.json`,e),{name:`@clubmed/root`}}}function kh(){let{env:e}=process,{GIT_USER_NAME:t,GIT_USER_EMAIL:n}=e;if(e.CI){if(e.GITLAB_CI){let{CI_BUILD_ID:r,CI_JOB_ID:i,CI_COMMIT_SHA:a,CI_COMMIT_BRANCH:o}=e;return{CI_NAME:`GitLab CI`,USER:t||`GitLab CI`,EMAIL:n||`gitlab@gitlab.com`,BUILD_NUMBER:r||i,CI_ORIGIN:`origin-git`,REF_COMMIT:a,IS_PULL_REQUEST:!1,BRANCH_NAME:o}}if(e.CIRCLECI){let{CIRCLE_BUILD_NUM:r,CIRCLE_SHA1:i,CIRCLE_PULL_REQUEST:a,CIRCLE_BRANCH:o}=e;return{CI_NAME:`Circle CI`,USER:t||`Circle CI`,EMAIL:n||`circle@circleci.com`,BUILD_NUMBER:r,CI_ORIGIN:`origin-git`,REF_COMMIT:i,IS_PULL_REQUEST:a&&a!==`false`,BRANCH_NAME:o}}if(e.GITHUB_ACTION){let{GITHUB_ACTION:r,GITHUB_SHA:i,GITHUB_REF:a,GITHUB_ACTOR:o}=e;return{CI_NAME:`Github CI`,USER:t||o||`Github CI`,EMAIL:n||`action@github.com`,BUILD_NUMBER:r,CI_ORIGIN:`origin-git`,REF_COMMIT:i,IS_PULL_REQUEST:!1,BRANCH_NAME:a.replace(`refs/heads/`,``)}}return{NAME:`Unsupported CI`,BUILD_NUMBER:``,CI_ORIGIN:`origin-git`,IS_PULL_REQUEST:!1,BRANCH_NAME:Em.getBranchName()}}return{NAME:`LOCAL`,BUILD_NUMBER:`1`,CI_ORIGIN:`origin-git`,BRANCH_NAME:Em.getBranchName()}}function Ah(){let e=Oh(),[t,n]=e.name.replace(/^@/,``).split(`/`),{E2E_CMD:r,PROJECT_NAME:i,DOCKER_HUB_ID:a,DOCKER_HUB_PWD:o,REF_COMMIT:s,GH_TOKEN:c,SCM_TOKEN:l,REPOSITORY_URL:u,GIT_DISABLE_SSL:d,GIT_USER_NAME:f,GIT_USER_EMAIL:p,GITLAB_USER_EMAIL:m,GITLAB_USER_NAME:h,GIT_FETCH_MAX_DEPTH:g,JIRA_API:_,JIRA_EMAIL:v,JIRA_TOKEN:y,DIRECTUS_URL:b,DIRECTUS_FLOW_ID:x,DIRECTUS_ACCESS_TOKEN:S,HTTPS_PROXY:w}=process.env,T=k.existsSync(C(process.cwd(),`.yarnrc.yml`)),E=km()||T,D=k.existsSync(C(process.cwd(),`pnpm-lock.yaml`)),ee=k.existsSync(C(process.cwd(),`bun.lock`))||k.existsSync(C(process.cwd(),`bun.lockb`)),te=(0,Dh.default)(e,`flow.bumpMethod`,`default`);return(T||D||ee)&&[`native`,`default`].includes(te)&&(te=`cmflow`),{outputDir:e.flow?.outputDir??`dist`,npmAccess:e.flow?.npmAccess??`public`,npmDistTag:e.flow?.npmDistTag??e.publishConfig?.tag,npmFallbackDistTag:e.flow?.npmFallbackDistTag??`latest`,skipNpmPublish:e.flow?.skipNpmPublish??!1,trustedPublishing:e.flow?.trustedPublishing??!1,registry:e.publishConfig?.registry??`https://registry.npmjs.org/`,registries:e.flow?.registries??[],buildCmd:e.flow?.buildCmd??`build`,rootDir:process.cwd(),pkg:e,E2E_CMD:r,PACKAGE_MANAGER:D?`pnpm`:ee?`bun`:E?`yarn`:`npm`,PROJECT_NAME:i||n,HAS_YARN:E,HAS_PNPM:D,HAS_BUN:ee,IS_YARN_BERRY:T,HAS_LERNA:e.dependencies&&e.dependencies.lerna||e.devDependencies&&e.devDependencies.lerna,CI_SKIP:`[ci skip]`,RELEASE_CANDIDATE_TAG:`[MEP]`,ORIGIN:`origin`,get PRODUCTION_BRANCH(){return(0,Dh.default)(e,`flow.branch.production`)||process.env.PRODUCTION_BRANCH||`production`},get DEVELOP_BRANCH(){return(0,Dh.default)(e,`flow.branch.develop`)||process.env.DEVELOP_BRANCH||`master`},get OWNER(){return process.env.OWNER||t},get DOCKER_REPOSITORY(){let{DOCKER_REPOSITORY:e,OWNER:r,PROJECT_NAME:i}=process.env;return e||`${r||t}/${i||n}`},DOCKER_HUB_ID:a,DOCKER_HUB_PWD:o,REF_COMMIT:s,GH_TOKEN:c,SCM_TOKEN:c||l,REPOSITORY_URL:(0,Dh.default)(e,`repository.url`,(0,Dh.default)(e,`repository`,u)),GIT_USER_NAME:f||h,GIT_USER_EMAIL:p||m,GIT_FETCH_MAX_DEPTH:g,GIT_DISABLE_SSL:d,BUMP_METHOD:te,JIRA_API:_,JIRA_EMAIL:v,JIRA_TOKEN:y,HTTPS_PROXY:w,DIRECTUS_URL:b,DIRECTUS_FLOW_ID:x,DIRECTUS_ACCESS_TOKEN:S,CAN_TRIGGER_WORKFLOW:S&&x&&b,WORKSPACES:e.workspaces||[],...kh()}}export{Tm as C,Mt as E,Em as S,Yu as T,Im as _,Th as a,jm as b,_h as c,nh as d,qm as f,Lm as g,Bm as h,Eh as i,lh as l,Vm as m,Ah as n,wh as o,Wm as p,Oh as r,xh as s,kh as t,ch as u,Nm as v,Cm as w,Am as x,Mm as y};
42
+ //# sourceMappingURL=get-config-m5362szF.mjs.map