@nice-move/cli 0.11.23 → 0.11.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=e(import.meta.url);export{s as __commonJSMin,c as __export,d as __require,u as __toESM};
@@ -0,0 +1 @@
1
+ import{ansi_styles_default as e,stringWidth as t}from"./string-width-COq1QS9y.mjs";function n(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,i=[`\x1B`,`›`],a=e=>`${i[0]}[${e}m`,o=(t,n,r)=>{let i=[];t=[...t];for(let r of t){let o=r;r.includes(`;`)&&(r=r.split(`;`)[0][0]+`0`);let s=e.codes.get(Number.parseInt(r,10));if(s){let e=t.indexOf(s.toString());e===-1?i.push(a(n?s:o)):t.splice(e,1)}else if(n){i.push(a(0));break}else i.push(a(o))}if(n&&(i=i.filter((e,t)=>i.indexOf(e)===t),r!==void 0)){let t=a(e.codes.get(Number.parseInt(r,10)));i=i.reduce((e,n)=>n===t?[n,...e]:[...e,n],[])}return i.join(``)};function s(e,t,a){let s=[...e],c=[],l=typeof a==`number`?a:s.length,u=!1,d,f=0,p=``;for(let[m,h]of s.entries()){let s=!1;if(i.includes(h)){let t=/\d[^m]*/.exec(e.slice(m,m+18));d=t&&t.length>0?t[0]:void 0,f<l&&(u=!0,d!==void 0&&c.push(d))}else u&&h===`m`&&(u=!1,s=!0);if(!u&&!s&&f++,!r.test(h)&&n(h.codePointAt())&&(f++,typeof a!=`number`&&l++),f>t&&f<=l)p+=h;else if(f===t&&!u&&d!==void 0)p=o(c);else if(f>=l){p+=o(c,!0,d);break}}return p}function c(e,t,n){if(e.charAt(t)===` `)return t;let r=n?1:-1;for(let n=0;n<=3;n++){let i=t+n*r;if(e.charAt(i)===` `)return i}return t}function l(e,n,r={}){let{position:i=`end`,space:a=!1,preferTruncationOnSpace:o=!1}=r,{truncationCharacter:l=`…`}=r;if(typeof e!=`string`)throw TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof n!=`number`)throw TypeError(`Expected \`columns\` to be a number, got ${typeof n}`);if(n<1)return``;if(n===1)return l;let u=t(e);if(u<=n)return e;if(i===`start`){if(o){let t=c(e,u-n+1,!0);return l+s(e,t,u).trim()}return a===!0&&(l+=` `),l+s(e,u-n+t(l),u)}if(i===`middle`){a===!0&&(l=` ${l} `);let r=Math.floor(n/2);if(o){let t=c(e,r),i=c(e,u-(n-r)+1,!0);return s(e,0,t)+l+s(e,i,u).trim()}return s(e,0,r)+l+s(e,u-(n-r)+t(l),u)}if(i===`end`){if(o){let t=c(e,n-1);return s(e,0,t)+l}return a===!0&&(l=` ${l}`),s(e,0,n-t(l))+l}throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${i}`)}export{l as default};
package/dist/cli.mjs CHANGED
@@ -1,2 +1 @@
1
- #!/usr/bin/env node
2
- import*as o from"cheetor";import{createRequire as e}from"node:module";export const __webpack_id__=27;export const __webpack_ids__=[27];export const __webpack_modules__={7642:(r,t,m)=>{const s=(n={Cheetor:()=>o.Cheetor},c={},m.d(c,n),c);var n,c,a=m(3938);const i=e(import.meta.url)("node:module");var p=m(3208),d=m(9948),g=m(9767);process.on("SIGINT",(()=>{})),new s.Cheetor("../package.json",import.meta.url).website("https://www.npmjs.com/org/nice-move").command(g).command(a).commandSmart((function(){if((0,d.kj)("svgo/package.json")&&(0,d.kj)("svgo-config/package.json"))return{command:"svgo",describe:"Run `svgo` to optimize `*.svg`",handler({_:[o,e="./"]}){const r=(0,i.createRequire)(import.meta.url);(0,p.Ho)("svgo",["-r","-q","--pretty","--indent","2","--config",r.resolve("svgo-config"),"-f",e]).then((()=>{console.log("Done: calling svgo")})).catch((o=>{process.exitCode=1,console.error("Error:",o.message)}))}}})).setup()}};import r from"./runtime.mjs";import*as t from"./cli.mjs";r.C(t);import*as m from"./vendor.mjs";r.C(m);import*as s from"./cmd/lint.mjs";r.C(s);import*as n from"./cmd/git.mjs";r.C(n),r(r.s=7642);
1
+ import{execa as e,git_hooks_exports as t}from"./git-hooks-qGYGvB8F.mjs";import"./mjs-DvvdnjRs.mjs";import{isReachable as n,lint_exports as r}from"./lint-DcUzslX8.mjs";import{createRequire as i}from"node:module";import{Cheetor as a}from"cheetor";function o(){if(n(`svgo/package.json`)&&n(`svgo-config/package.json`))return{command:`svgo`,describe:"Run `svgo` to optimize `*.svg`",handler({_:[t,n=`./`]}){let r=i(import.meta.url);e(`svgo`,[`-r`,`-q`,`--pretty`,`--indent`,`2`,`--config`,r.resolve(`svgo-config`),`-f`,n]).then(()=>{console.log(`Done: calling svgo`)}).catch(e=>{process.exitCode=1,console.error(`Error:`,e.message)})}}}process.on(`SIGINT`,()=>{}),new a(`../package.json`,import.meta.url).website(`https://www.npmjs.com/org/nice-move`).command(r).command(t).commandSmart(o).setup();
package/dist/cmd/git.mjs CHANGED
@@ -1 +1 @@
1
- import{createRequire as o}from"node:module";export const __webpack_id__=60;export const __webpack_ids__=[60];export const __webpack_modules__={1421:t=>{t.exports=o(import.meta.url)("node:child_process")},1708:t=>{t.exports=o(import.meta.url)("node:process")},3024:t=>{t.exports=o(import.meta.url)("node:fs")},3136:t=>{t.exports=o(import.meta.url)("node:url")},3938:(o,t,r)=>{r.r(t),r.d(t,{builder:()=>n,command:()=>s,description:()=>i});var e=r(3208);const s="git",i="",m=process.cwd();function n(o){o.command("hooks","Set .githooks as git.hooksPath",{},(()=>{(function(){try{return function(){try{return Boolean((0,e.Kc)("git",["--version"],{cwd:m}).stdout)}catch{throw new Error("git is not installed")}}()&&function(){try{return"true"===(0,e.Kc)("git",["rev-parse","--is-inside-work-tree"],{cwd:m}).stdout}catch{throw new Error("not a git repository")}}()}catch(o){return console.error("Fail:",o.message),!1}})()&&(0,e.Ho)("git",["config","core.hooksPath",".githooks"],{cwd:m}).then((()=>{console.log("Done: set .githooks")})).catch((()=>{console.error("Fail:","setting hooks failed"),process.exitCode=1}))})),o.demandCommand(1,"Typing `hooks`")}},4573:t=>{t.exports=o(import.meta.url)("node:buffer")},5317:t=>{t.exports=o(import.meta.url)("child_process")},6193:t=>{t.exports=o(import.meta.url)("node:string_decoder")},6466:t=>{t.exports=o(import.meta.url)("node:stream/promises")},6760:t=>{t.exports=o(import.meta.url)("node:path")},6928:t=>{t.exports=o(import.meta.url)("path")},7066:t=>{t.exports=o(import.meta.url)("node:tty")},7075:t=>{t.exports=o(import.meta.url)("node:stream")},7975:t=>{t.exports=o(import.meta.url)("node:util")},8161:t=>{t.exports=o(import.meta.url)("node:os")},8474:t=>{t.exports=o(import.meta.url)("node:events")},8500:t=>{t.exports=o(import.meta.url)("node:timers/promises")},8877:t=>{t.exports=o(import.meta.url)("node:v8")},9896:t=>{t.exports=o(import.meta.url)("fs")}};import t from"../runtime.mjs";import*as r from"../vendor.mjs";t.C(r);import*as e from"./git.mjs";t.C(e);var s=t(t.s=3938);const i=s.builder,m=s.command,n=s.description;export{i as builder,m as command,n as description};
1
+ import{builder$1 as e,command$1 as t,description$1 as n}from"../git-hooks-qGYGvB8F.mjs";import"../mjs-DvvdnjRs.mjs";export{e as builder,t as command,n as description};
package/dist/cmd/lint.mjs CHANGED
@@ -1 +1 @@
1
- import{createRequire as e}from"node:module";export const __webpack_id__=67;export const __webpack_ids__=[67];export const __webpack_modules__={857:t=>{t.exports=e(import.meta.url)("os")},1421:t=>{t.exports=e(import.meta.url)("node:child_process")},1455:t=>{t.exports=e(import.meta.url)("node:fs/promises")},1708:t=>{t.exports=e(import.meta.url)("node:process")},2018:t=>{t.exports=e(import.meta.url)("tty")},2203:t=>{t.exports=e(import.meta.url)("stream")},3024:t=>{t.exports=e(import.meta.url)("node:fs")},3136:t=>{t.exports=e(import.meta.url)("node:url")},3193:t=>{t.exports=e(import.meta.url)("string_decoder")},3339:t=>{t.exports=e(import.meta.url)("module")},4434:t=>{t.exports=e(import.meta.url)("events")},4573:t=>{t.exports=e(import.meta.url)("node:buffer")},5317:t=>{t.exports=e(import.meta.url)("child_process")},6760:t=>{t.exports=e(import.meta.url)("node:path")},6928:t=>{t.exports=e(import.meta.url)("path")},6982:t=>{t.exports=e(import.meta.url)("crypto")},7016:t=>{t.exports=e(import.meta.url)("url")},7066:t=>{t.exports=e(import.meta.url)("node:tty")},7075:t=>{t.exports=e(import.meta.url)("node:stream")},7975:t=>{t.exports=e(import.meta.url)("node:util")},8161:t=>{t.exports=e(import.meta.url)("node:os")},8500:t=>{t.exports=e(import.meta.url)("node:timers/promises")},9023:t=>{t.exports=e(import.meta.url)("util")},9767:(e,t,r)=>{r.r(t),r.d(t,{builder:()=>c,command:()=>m,description:()=>p});var o=r(1455),s=r(6760);const i={"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"subject-case":[0],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]],"scope-case":[0],"body-case":[0],"header-case":[0]};function a(e){e.command("commit","Lint git commit message",{},(()=>{(async function(){const e=await(0,o.readFile)((0,s.resolve)(process.cwd(),".git/COMMIT_EDITMSG"),"utf8"),t=await r.e(652).then(r.bind(r,652)).then((e=>e.default.default||e.default)),a=await Promise.all([r.e(127),r.e(753)]).then(r.bind(r,2753)).then((e=>e.default.default||e.default)),n=await t(e,i);return{result:n,output:await a({results:[n]})}})().then((({result:e,output:t})=>{e.valid?console.log("Pass."):(console.log("Fail:"),console.log(t),process.exitCode=1)})).catch((e=>{console.error(e),process.exitCode=1}))}))}var n=r(9948);function l({garou:e,stylelint:t,eslint:r,prettier:o}){const s=process.stdin.isTTY?" --color":"";return function(e){const t=Object.entries(e).map((([e,t])=>[e,t.filter(Boolean)])).filter((([e,t])=>t.length));return t.length>0?Object.fromEntries(t):void 0}({"*.{vue,html,htm,md}":[e&&"garou",o&&`prettier -w -u${s}`,t&&`stylelint --fix -- ${s}`,r&&`eslint --fix ${s}`],"*.{ts,tsx,mts,cts}":[e&&"garou",o&&`prettier -w -u${s}`,r&&`eslint --fix ${s}`],"*.{js,jsx,mjs,cjs,wxs,qs}":[e&&"garou",o&&`prettier -w -u${s}`,r&&`eslint --fix ${s}`],"*.{c,sc,le,wx,q,tt,jx,ac}ss":[e&&"garou",o&&`prettier -w -u${s}`,t&&`stylelint --fix -- ${s}`],"*.{json,yml,yaml,svg}":[e&&"garou",o&&`prettier -w -u${s}`],"{*.{jsonc,webmanifest,editorconfig,toml},.{babel,npm}rc}":[o&&`prettier -w -u${s}`],"{*.jenkinsfile,{j,J}enkinsfile}":[o&&`prettier -w -u${s}`],"yarn.lock":[e&&"garou"]})}const m="lint",p="";function c(e){a(e),function(e){e.command("staged","Lint and format git staged files",{},(()=>{(async function(){const{default:e}=await Promise.all([r.e(127),r.e(788)]).then(r.bind(r,3788));return e({allowEmpty:!0,concurrent:!0,config:l(function(){const e=(0,n.t7)("devDependencies");return{garou:"garou"in e,stylelint:"stylelint"in e,eslint:"eslint"in e,prettier:"prettier"in e}}()),cwd:process.cwd(),debug:!1,quiet:!1,relative:!1,shell:!1,stash:!0})})().then((e=>{process.exitCode=e?0:1})).catch((e=>{console.error(e),process.exitCode=1}))}))}(e),e.demandCommand(1,"Typing `commit` or `staged`")}},9896:t=>{t.exports=e(import.meta.url)("fs")}};import t from"../runtime.mjs";import*as r from"../vendor.mjs";t.C(r);import*as o from"./lint.mjs";t.C(o);var s=t(t.s=9767);const i=s.builder,a=s.command,n=s.description;export{i as builder,a as command,n as description};
1
+ import{builder as e,command as t,description as n}from"../lint-DcUzslX8.mjs";export{e as builder,t as command,n as description};
@@ -0,0 +1,34 @@
1
+ import{__commonJSMin as e,__export as t,__require as n,__toESM as r}from"./chunk-CYNyJ7h0.mjs";import{onExit as i}from"./mjs-DvvdnjRs.mjs";import{fileURLToPath as a}from"node:url";import{ChildProcess as o,execFile as s,spawn as c,spawnSync as l}from"node:child_process";import{StringDecoder as u}from"node:string_decoder";import{aborted as d,callbackify as f,debuglog as p,inspect as m,promisify as h,stripVTControlCharacters as g}from"node:util";import _,{execArgv as v,execPath as y,hrtime as b,platform as x}from"node:process";import S from"node:tty";import C from"node:path";import{scheduler as w,setImmediate as ee,setTimeout as te}from"node:timers/promises";import{constants as T}from"node:os";import{EventEmitter as ne,addAbortListener as re,on as ie,once as E,setMaxListeners as ae}from"node:events";import{serialize as oe}from"node:v8";import{appendFileSync as se,createReadStream as ce,createWriteStream as le,readFileSync as ue,statSync as de,writeFileSync as fe}from"node:fs";import{finished as D}from"node:stream/promises";import{Duplex as pe,PassThrough as me,Readable as O,Transform as he,Writable as ge,getDefaultHighWaterMark as _e}from"node:stream";import{Buffer as ve}from"node:buffer";function k(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const ye=(e,t)=>{let n=Se(be(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},be=e=>xe(e)?e.toString():e,xe=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Se=e=>e instanceof URL?a(e):e,Ce=(e,t=[],n={})=>{let r=ye(e,`First argument`),[i,a]=k(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!k(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]},{toString:we}=Object.prototype,Te=e=>we.call(e)===`[object ArrayBuffer]`,A=e=>we.call(e)===`[object Uint8Array]`,j=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ee=new TextEncoder,De=e=>Ee.encode(e),Oe=new TextDecoder,ke=e=>Oe.decode(e),Ae=(e,t)=>{let n=je(e,t);return n.join(``)},je=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new u(t),r=e.map(e=>typeof e==`string`?De(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Me=e=>e.length===1&&A(e[0])?e[0]:Pe(Ne(e)),Ne=e=>e.map(e=>typeof e==`string`?De(e):e),Pe=e=>{let t=new Uint8Array(Fe(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Fe=e=>{let t=0;for(let n of e)t+=n.length;return t},Ie=e=>Array.isArray(e)&&Array.isArray(e.raw),Le=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=Re({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},Re=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=ze(i,e.raw[r]),c=He(n,a,o);if(r===t.length)return c;let l=t[r],u=Array.isArray(l)?l.map(e=>Ue(e)):[Ue(l)];return He(c,u,s)},ze=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=Be.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(Be.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
2
+ `?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=Ve[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},Be=new Set([` `,` `,`\r`,`
3
+ `]),Ve={x:3,u:5},He=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Ue=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(k(e)&&(`stdout`in e||`isMaxBuffer`in e))return We(e);throw e instanceof o||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},We=({stdout:e})=>{if(typeof e==`string`)return e;if(A(e))return ke(e);throw e===void 0?TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):TypeError(`Unexpected "${typeof e}" stdout in template expression`)},M=e=>Ge.includes(e),Ge=[_.stdin,_.stdout,_.stderr],N=[`stdin`,`stdout`,`stderr`],Ke=e=>N[e]??`stdio[${e}]`,qe=e=>{let t={...e};for(let n of ot)t[n]=Je(e,n);return t},Je=(e,t)=>{let n=Array.from({length:Ye(e)+1}),r=Xe(e[t],n,t);return rt(r,t)},Ye=({stdio:e})=>Array.isArray(e)?Math.max(e.length,N.length):N.length,Xe=(e,t,n)=>k(e)?Ze(e,t,n):t.fill(e),Ze=(e,t,n)=>{for(let r of Object.keys(e).sort(Qe))for(let i of et(r,n,t))t[i]=e[r];return t},Qe=(e,t)=>$e(e)<$e(t)?1:-1,$e=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,et=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=tt(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
4
+ It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
5
+ Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},tt=e=>{if(e===`all`)return e;if(N.includes(e))return N.indexOf(e);let t=nt.exec(e);if(t!==null)return Number(t[1])},nt=/^fd(\d+)$/,rt=(e,t)=>e.map(e=>e===void 0?at[t]:e),it=p(`execa`).enabled?`full`:`none`,at={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:it,stripFinalNewline:!0},ot=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],P=(e,t)=>t===`ipc`?e.at(-1):e[t],st=({verbose:e},t)=>ut(e,t)!==`none`,ct=({verbose:e},t)=>![`none`,`short`].includes(ut(e,t)),lt=({verbose:e},t)=>{let n=ut(e,t);return ft(n)?n:void 0},ut=(e,t)=>t===void 0?dt(e):P(e,t),dt=e=>e.find(e=>ft(e))??pt.findLast(t=>e.includes(t)),ft=e=>typeof e==`function`,pt=[`none`,`short`,`full`],mt=(e,t)=>{let n=[e,...t],r=n.join(` `),i=n.map(e=>St(gt(e))).join(` `);return{command:r,escapedCommand:i}},ht=e=>g(e).split(`
6
+ `).map(e=>gt(e)).join(`
7
+ `),gt=e=>e.replaceAll(yt,e=>_t(e)),_t=e=>{let t=bt[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=xt?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},vt=()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},yt=vt(),bt={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},xt=65535,St=e=>Ct.test(e)?e:x===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,Ct=/^[\w./-]+$/;function wt(){let{env:e}=_,{TERM:t,TERM_PROGRAM:n}=e;return _.platform===`win32`?!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask===`{cmd::Cmder}`||n===`Terminus-Sublime`||n===`vscode`||t===`xterm-256color`||t===`alacritty`||t===`rxvt-unicode`||t===`rxvt-unicode-256color`||e.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t!==`linux`}const Tt={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:`╱`},Et={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:`⅒`},Dt={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`},Ot={...Tt,...Et},kt={...Tt,...Dt},At=wt(),jt=At?Ot:kt;var Mt=jt;const Nt=Object.entries(Et),Pt=S?.WriteStream?.prototype?.hasColors?.()??!1,F=(e,t)=>{if(!Pt)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let t=e+``,i=t.indexOf(r);if(i===-1)return n+t+r;let a=n,o=0;for(;i!==-1;)a+=t.slice(o,i)+n,o=i+r.length,i=t.indexOf(r,o);return a+=t.slice(o)+r,a}},Ft=F(0,0),It=F(1,22),Lt=F(2,22),Rt=F(3,23),zt=F(4,24),Bt=F(53,55),Vt=F(7,27),Ht=F(8,28),Ut=F(9,29),Wt=F(30,39),Gt=F(31,39),Kt=F(32,39),qt=F(33,39),Jt=F(34,39),Yt=F(35,39),Xt=F(36,39),Zt=F(37,39),Qt=F(90,39),$t=F(40,49),en=F(41,49),tn=F(42,49),nn=F(43,49),rn=F(44,49),an=F(45,49),on=F(46,49),sn=F(47,49),cn=F(100,49),ln=F(91,39),un=F(92,39),dn=F(93,39),fn=F(94,39),pn=F(95,39),mn=F(96,39),hn=F(97,39),gn=F(101,49),_n=F(102,49),vn=F(103,49),yn=F(104,49),bn=F(105,49),xn=F(106,49),Sn=F(107,49),Cn=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=wn(n),c=Dn[e]({failed:a,reject:o,piped:r}),l=kn[e]({reject:o});return`${Qt(`[${s}]`)} ${Qt(`[${i}]`)} ${l(c)} ${l(t)}`},wn=e=>`${Tn(e.getHours(),2)}:${Tn(e.getMinutes(),2)}:${Tn(e.getSeconds(),2)}.${Tn(e.getMilliseconds(),3)}`,Tn=(e,t)=>String(e).padStart(t,`0`),En=({failed:e,reject:t})=>e?t?Mt.cross:Mt.warning:Mt.tick,Dn={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:En,duration:En},On=e=>e,kn={command:()=>It,output:()=>On,ipc:()=>On,error:({reject:e})=>e?ln:dn,duration:()=>Qt},An=(e,t,n)=>{let r=lt(t,n);return e.map(({verboseLine:e,verboseObject:t})=>jn(e,t,r)).filter(e=>e!==void 0).map(e=>Mn(e)).join(``)},jn=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},Mn=e=>e.endsWith(`
8
+ `)?e:`${e}\n`,Nn=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=Pn({type:e,result:i,verboseInfo:r}),o=Fn(t,a),s=An(o,r,n);s!==``&&console.warn(s.slice(0,-1))},Pn=({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...a}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:t,options:a}),Fn=(e,t)=>e.split(`
9
+ `).map(e=>In({...t,message:e})),In=e=>{let t=Cn(e);return{verboseLine:t,verboseObject:e}},Ln=e=>{let t=typeof e==`string`?e:m(e),n=ht(t);return n.replaceAll(` `,` `.repeat(Rn))},Rn=2,zn=(e,t)=>{st(t)&&Nn({type:`command`,verboseMessage:e,verboseInfo:t})},Bn=(e,t,n)=>{Un(e);let r=Vn(e);return{verbose:e,escapedCommand:t,commandId:r,rawOptions:n}},Vn=e=>st({verbose:e})?Hn++:void 0;let Hn=0n;const Un=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(!pt.includes(t)&&!ft(t)){let e=pt.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},Wn=()=>b.bigint(),Gn=e=>Number(b.bigint()-e)/1e6,Kn=(e,t,n)=>{let r=Wn(),{command:i,escapedCommand:a}=mt(e,t),o=Je(n,`verbose`),s=Bn(o,a,{...n});return zn(a,s),{command:i,escapedCommand:a,startTime:r,verboseInfo:s}};var qn=e((exports,t)=>{t.exports=o,o.sync=s;var r=n(`fs`);function i(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function a(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:i(t,n)}function o(e,t,n){r.stat(e,function(r,i){n(r,r?!1:a(i,e,t))})}function s(e,t){return a(r.statSync(e),e,t)}}),Jn=e((exports,t)=>{t.exports=i,i.sync=a;var r=n(`fs`);function i(e,t,n){r.stat(e,function(e,r){n(e,e?!1:o(r,t))})}function a(e,t){return o(r.statSync(e),t)}function o(e,t){return e.isFile()&&s(e,t)}function s(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=parseInt(`100`,8),c=parseInt(`010`,8),l=parseInt(`001`,8),u=s|c,d=n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0;return d}}),Yn=e((exports,t)=>{var r=n(`fs`),i;i=process.platform===`win32`||global.TESTING_WINDOWS?qn():Jn(),t.exports=a,a.sync=o;function a(e,t,n){if(typeof t==`function`&&(n=t,t={}),!n){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,r){a(e,t||{},function(e,t){e?r(e):n(t)})})}i(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function o(e,t){try{return i.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}}),Xn=e((exports,t)=>{let r=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,i=n(`path`),a=r?`;`:`:`,o=Yn(),s=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),c=(e,t)=>{let n=t.colon||a,i=e.match(/\//)||r&&e.match(/\\/)?[``]:[...r?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(n)],o=r?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=r?o.split(n):[``];return r&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:i,pathExt:s,pathExtExe:o}},l=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:r,pathExt:a,pathExtExe:l}=c(e,t),u=[],d=n=>new Promise((a,o)=>{if(n===r.length)return t.all&&u.length?a(u):o(s(e));let c=r[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=i.join(l,e),p=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;a(f(p,n,0))}),f=(e,n,r)=>new Promise((i,s)=>{if(r===a.length)return i(d(n+1));let c=a[r];o(e+c,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+c);else return i(e+c);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)},u=(e,t)=>{t||={};let{pathEnv:n,pathExt:r,pathExtExe:a}=c(e,t),l=[];for(let s=0;s<n.length;s++){let c=n[s],u=/^".*"$/.test(c)?c.slice(1,-1):c,d=i.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<r.length;e++){let n=f+r[e];try{let e=o.sync(n,{pathExt:a});if(e)if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw s(e)};t.exports=l,l.sync=u}),Zn=e((exports,t)=>{let n=(e={})=>{let t=e.env||process.env,n=e.platform||process.platform;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n}),Qn=e((exports,t)=>{let r=n(`path`),i=Xn(),a=Zn();function o(e,t){let n=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=i.sync(e.command,{path:n[a({env:n})],pathExt:t?r.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=r.resolve(s?e.options.cwd:``,l),l}function s(e){return o(e)||o(e,!0)}t.exports=s}),$n=e((exports,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i}),er=e((exports,t)=>{t.exports=/^#!(.*)/}),tr=e((exports,t)=>{let n=er();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}}),nr=e((exports,t)=>{let r=n(`fs`),i=tr();function a(e){let t=150,n=Buffer.alloc(t),a;try{a=r.openSync(e,`r`),r.readSync(a,n,0,t,0),r.closeSync(a)}catch{}return i(n.toString())}t.exports=a}),rr=e((exports,t)=>{let r=n(`path`),i=Qn(),a=$n(),o=nr(),s=process.platform===`win32`,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function u(e){e.file=i(e);let t=e.file&&o(e.file);return t?(e.args.unshift(e.file),e.command=t,i(e)):e.file}function d(e){if(!s)return e;let t=u(e),n=!c.test(t);if(e.options.forceShell||n){let n=l.test(t);e.command=r.normalize(e.command),e.command=a.command(e.command),e.args=e.args.map(e=>a.argument(e,n));let i=[e.command].concat(e.args).join(` `);e.args=[`/d`,`/s`,`/c`,`"${i}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function f(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:d(r)}t.exports=f}),ir=e((exports,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}}),ar=e((exports,t)=>{let r=n(`child_process`),i=rr(),a=ir();function o(e,t,n){let o=i(e,t,n),s=r.spawn(o.command,o.args,o.options);return a.hookChildProcess(s,o),s}function s(e,t,n){let o=i(e,t,n),s=r.spawnSync(o.command,o.args,o.options);return s.error=s.error||a.verifyENOENTSync(s.status,o),s}t.exports=o,t.exports.spawn=o,t.exports.sync=s,t.exports._parse=i,t.exports._enoent=a});function or(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`}const sr=h(s);function cr(e){return e instanceof URL?a(e):e}function lr(e){return{*[Symbol.iterator](){let t=C.resolve(cr(e)),n;for(;n!==t;)yield t,n=t,t=C.resolve(t,`..`)}}}const ur=10*1024*1024,dr=({cwd:e=_.cwd(),path:t=_.env[or()],preferLocal:n=!0,execPath:r=_.execPath,addExecPath:i=!0}={})=>{let a=C.resolve(cr(e)),o=[],s=t.split(C.delimiter);return n&&fr(o,s,a),i&&pr(o,s,r,a),t===``||t===C.delimiter?`${o.join(C.delimiter)}${t}`:[...o,t].join(C.delimiter)},fr=(e,t,n)=>{for(let r of lr(n)){let n=C.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},pr=(e,t,n,r)=>{let i=C.resolve(r,cr(n),`..`);t.includes(i)||e.push(i)},mr=({env:e=_.env,...t}={})=>{e={...e};let n=or({env:e});return t.path=e[n],e[n]=dr(t),e},hr=(e,t,n)=>{let r=n?xr:br,i=e instanceof I?{}:{cause:e};return new r(t,i)};var I=class extends Error{};const gr=(e,t)=>{Object.defineProperty(e.prototype,`name`,{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,vr,{value:!0,writable:!1,enumerable:!1,configurable:!1})},_r=e=>yr(e)&&vr in e,vr=Symbol(`isExecaError`),yr=e=>Object.prototype.toString.call(e)===`[object Error]`;var br=class extends Error{};gr(br,br.name);var xr=class extends Error{};gr(xr,xr.name);const Sr=()=>{let e=Tr-wr+1;return Array.from({length:e},Cr)},Cr=(e,t)=>({name:`SIGRT${t+1}`,number:wr+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),wr=34,Tr=64,Er=[{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`}],Dr=()=>{let e=Sr(),t=[...Er,...e].map(Or);return t},Or=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=T,s=o!==void 0,c=s?o:t;return{name:e,number:c,description:n,supported:s,action:r,forced:i,standard:a}},kr=()=>{let e=Dr();return Object.fromEntries(e.map(Ar))},Ar=({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}],jr=kr(),Mr=()=>{let e=Dr(),t=Tr+1,n=Array.from({length:t},(t,n)=>Nr(n,e));return Object.assign({},...n)},Nr=(e,t)=>{let n=Pr(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}}},Pr=(e,t)=>{let n=t.find(({name:t})=>T.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n},Fr=Mr(),Ir=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Rr(e,t)},Lr=e=>e===0?e:Rr(e,"`subprocess.kill()`'s argument"),Rr=(e,t)=>{if(Number.isInteger(e))return zr(e,t);if(typeof e==`string`)return Hr(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${Ur()}`)},zr=(e,t)=>{if(Vr.has(e))return Vr.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${Ur()}`)},Br=()=>new Map(Object.entries(T.signals).reverse().map(([e,t])=>[t,e])),Vr=Br(),Hr=(e,t)=>{if(e in T.signals)return e;throw e.toUpperCase()in T.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${Ur()}`)},Ur=()=>`Available signal names: ${Wr()}.
10
+ Available signal numbers: ${Gr()}.`,Wr=()=>Object.keys(T.signals).sort().map(e=>`'${e}'`).join(`, `),Gr=()=>[...new Set(Object.values(T.signals).sort((e,t)=>e-t))].join(`, `),Kr=e=>jr[e].description,qr=e=>{if(e===!1)return e;if(e===!0)return Jr;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Jr=1e3*5,Yr=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Xr(o,s,n);Zr(l,r);let u=e(c);return Qr({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Xr=(e,t,n)=>{let[r=n,i]=yr(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&&!yr(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Lr(r),error:i}},Zr=(e,t)=>{e!==void 0&&t.reject(e)},Qr=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&$r({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},$r=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await te(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??=!0)}catch{}},ei=async(e,t)=>{e.aborted||await E(e,`abort`,{signal:t})},ti=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},ni=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[ri(e,t,r,i)],ri=async(e,t,n,{signal:r})=>{throw await ei(t,r),n.terminationReason??=`cancel`,e.kill(),t.reason},ii=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{ai(e,t,n),oi(e,t,r)},ai=(e,t,n)=>{if(!n)throw Error(`${L(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},oi=(e,t,n)=>{if(!n)throw Error(`${L(e,t)} cannot be used: the ${R(t)} has already exited or disconnected.`)},si=e=>{throw Error(`${L(`getOneMessage`,e)} could not complete: the ${R(e)} exited or disconnected.`)},ci=e=>{throw Error(`${L(`sendMessage`,e)} failed: the ${R(e)} is sending a message too, instead of listening to incoming messages.
11
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
12
+
13
+ const [receivedMessage] = await Promise.all([
14
+ ${L(`getOneMessage`,e)},
15
+ ${L(`sendMessage`,e,`message, {strict: true}`)},
16
+ ]);`)},li=(e,t)=>Error(`${L(`sendMessage`,t)} failed when sending an acknowledgment response to the ${R(t)}.`,{cause:e}),ui=e=>{throw Error(`${L(`sendMessage`,e)} failed: the ${R(e)} is not listening to incoming messages.`)},di=e=>{throw Error(`${L(`sendMessage`,e)} failed: the ${R(e)} exited without listening to incoming messages.`)},fi=()=>Error(`\`cancelSignal\` aborted: the ${R(!0)} disconnected.`),pi=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},mi=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${L(t,n)} cannot be used: the ${R(n)} is disconnecting.`,{cause:e})},hi=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(gi(e))throw Error(`${L(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},gi=({code:e,message:t})=>_i.has(e)||vi.some(e=>t.includes(e)),_i=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),vi=[`could not be cloned`,`circular structure`,`call stack size exceeded`],L=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${yi(t)}${e}(${n})`,yi=e=>e?``:`subprocess.`,R=e=>e?`parent process`:`subprocess`,bi=e=>{e.connected&&e.disconnect()},z=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},xi=(e,t=`stdin`)=>{let n=!0,{options:r,fileDescriptors:i}=B.get(e),a=Ci(i,t,n),o=e.stdio[a];if(o===null)throw TypeError(Ei(a,t,r,n));return o},Si=(e,t=`stdout`)=>{let n=!1,{options:r,fileDescriptors:i}=B.get(e),a=Ci(i,t,n),o=a===`all`?e.all:e.stdio[a];if(o==null)throw TypeError(Ei(a,t,r,n));return o},B=new WeakMap,Ci=(e,t,n)=>{let r=wi(t,n);return Ti(r,t,n,e),r},wi=(e,t)=>{let n=tt(e);if(n!==void 0)return n;let{validOptions:r,defaultValue:i}=t?{validOptions:`"stdin"`,defaultValue:`stdin`}:{validOptions:`"stdout", "stderr", "all"`,defaultValue:`stdout`};throw TypeError(`"${ki(t)}" must not be "${e}".
17
+ It must be ${r} or "fd3", "fd4" (and so on).
18
+ It is optional and defaults to "${i}".`)},Ti=(e,t,n,r)=>{let i=r[Oi(e)];if(i===void 0)throw TypeError(`"${ki(n)}" must not be ${t}. That file descriptor does not exist.
19
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction===`input`&&!n)throw TypeError(`"${ki(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${ki(n)}" must not be ${t}. It must be a writable stream, not readable.`)},Ei=(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}=Di(e,n);return`The "${i}: ${Ai(a)}" option is incompatible with using "${ki(r)}: ${Ai(t)}".
20
+ Please set this option with "pipe" instead.`},Di=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=Oi(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]}},Oi=e=>e===`all`?1:e,ki=e=>e?`to`:`from`,Ai=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,ji=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),re(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},Mi=(e,t)=>{t&&Ni(e)},Ni=e=>{e.refCounted()},Pi=(e,t)=>{t&&Fi(e)},Fi=e=>{e.unrefCounted()},Ii=(e,t)=>{t&&(Fi(e),Fi(e))},Li=(e,t)=>{t&&(Ni(e),Ni(e))},Ri=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(Yi(i)||ha(i))return;Bi.has(e)||Bi.set(e,[]);let a=Bi.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await ra(e,r,i),await w.yield();let o=await Ji({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},zi=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{_a();let a=Bi.get(e);for(;a?.length>0;)await E(r,`message:done`);e.removeListener(`message`,i),Li(t,n),r.connected=!1,r.emit(`disconnect`)},Bi=new WeakMap,Vi=(e,t,n)=>{if(Hi.has(e))return Hi.get(e);let r=new ne;return r.connected=!0,Hi.set(e,r),Ui({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},Hi=new WeakMap,Ui=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Ri.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,zi.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Ii(n,r)},Wi=e=>{let t=Hi.get(e);return t===void 0?e.channel!==null:t.connected},Gi=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=Vi(e,t,n),o=ia(e,a);return{id:Ki++,type:$i,message:r,hasListeners:o}};let Ki=0n;const qi=(e,t)=>{if(!(t?.type!==$i||t.hasListeners))for(let{id:t}of e)t!==void 0&&Zi[t].resolve({isDeadlock:!0,hasListeners:!1})},Ji=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==$i||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:ea,message:ia(t,i)};try{await oa({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},Yi=e=>{if(e?.type!==ea)return!1;let{id:t,message:n}=e;return Zi[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},Xi=async(e,t,n)=>{if(e?.type!==$i)return;let r=z();Zi[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,Qi(t,n,i)]);e&&ci(n),a||ui(n)}finally{i.abort(),delete Zi[e.id]}},Zi={},Qi=async(e,t,{signal:n})=>{ji(e,1,n),await E(e,`disconnect`,{signal:n}),di(t)},$i=`execa:ipc:request`,ea=`execa:ipc:response`,ta=(e,t,n)=>{V.has(e)||V.set(e,new Set);let r=V.get(e),i=z(),a=n?t.id:void 0,o={onMessageSent:i,id:a};return r.add(o),{outgoingMessages:r,outgoingMessage:o}},na=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},ra=async(e,t,n)=>{for(;!ia(e,t)&&V.get(e)?.size>0;){let t=[...V.get(e)];qi(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},V=new WeakMap,ia=(e,t)=>t.listenerCount(`message`)>aa(e),aa=e=>B.has(e)&&!P(B.get(e).options.buffer,`ipc`)?1:0,oa=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return ii({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),sa({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},sa=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=Gi({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=ta(e,o,a);try{await ca({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw bi(e),t}finally{na(s)}},ca=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=la(e);try{await Promise.all([Xi(r,e,n),a(r)])}catch(e){throw mi({error:e,methodName:t,isSubprocess:n}),hi({error:e,methodName:t,isSubprocess:n,message:i}),e}},la=e=>{if(ua.has(e))return ua.get(e);let t=h(e.send.bind(e));return ua.set(e,t),t},ua=new WeakMap,da=(e,t)=>{let n=`cancelSignal`;return oi(n,!1,e.connected),ca({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:ga,message:t},message:t})},fa=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await pa({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),va.signal),pa=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!ma){if(ma=!0,!r){pi();return}if(t===null){_a();return}Vi(e,t,n),await w.yield()}};let ma=!1;const ha=e=>e?.type===ga?(va.abort(e.message),!0):!1,ga=`execa:ipc:cancel`,_a=()=>{va.abort(fi())},va=new AbortController,ya=({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.")}},ba=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[xa({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],xa=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await ei(t,i);let a=Sa(t);throw await da(e,a),$r({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??=`gracefulCancel`,t.reason},Sa=({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},Ca=({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})`)},wa=(e,t,n,r)=>t===0||t===void 0?[]:[Ta(e,t,n,r)],Ta=async(e,t,n,{signal:r})=>{throw await te(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e.kill(),new I},Ea=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Da=(e,t,{node:n=!1,nodePath:r=y,nodeOptions:i=v.filter(e=>!e.startsWith(`--inspect`)),cwd:a,execPath:o,...s})=>{if(o!==void 0)throw TypeError(`The "execPath" option has been removed. Please use the "nodePath" option instead.`);let c=ye(r,`The "nodePath" option`),l=C.resolve(a,c),u={...s,nodePath:l,node:n,cwd:a};if(!n)return[e,t,u];if(C.basename(e,`.exe`)===`node`)throw TypeError(`When the "node" option is true, the first argument does not need to be "node".`);return[l,[...i,e,...t],{ipc:!0,...u,shell:!1}]},Oa=({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`.");ja[n](e)}},ka=e=>{try{oe(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},Aa=e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},ja={advanced:ka,json:Aa},Ma=async(e,t)=>{t!==void 0&&await e.sendMessage(t)},Na=({encoding:e})=>{if(Fa.has(e))return;let t=Ia(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${Ra(e)}\`.
21
+ Please rename it to ${Ra(t)}.`);let n=[...Fa].map(e=>Ra(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${Ra(e)}\`.
22
+ Please rename it to one of: ${n}.`)},Pa=new Set([`utf8`,`utf16le`]),H=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),Fa=new Set([...Pa,...H]),Ia=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in La)return La[t];if(Fa.has(t))return t},La={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Ra=e=>typeof e==`string`?`"${e}"`:String(e),za=(e=Ba())=>{let t=ye(e,`The "cwd" option`);return C.resolve(t)},Ba=()=>{try{return _.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},Va=(e,t)=>{if(t===Ba())return e;let n;try{n=de(t)}catch(n){return`The "cwd" option is invalid: ${t}.\n${n.message}\n${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`};var Ha=r(ar(),1);const Ua=(e,t,n)=>{n.cwd=za(n.cwd);let[r,i,a]=Da(e,t,n),{command:o,args:s,options:c}=Ha.default._parse(r,i,a),l=qe(c),u=Wa(l);return Ca(u),Na(u),Oa(u),ti(u),ya(u),u.shell=Se(u.shell),u.env=Ga(u),u.killSignal=Ir(u.killSignal),u.forceKillAfterDelay=qr(u.forceKillAfterDelay),u.lines=u.lines.map((e,t)=>e&&!H.has(u.encoding)&&u.buffer[t]),_.platform===`win32`&&C.basename(o,`.exe`)===`cmd`&&s.unshift(`/q`),{file:o,commandArguments:s,options:u}},Wa=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i=`utf8`,reject:a=!0,cleanup:o=!0,all:s=!1,windowsHide:c=!0,killSignal:l=`SIGTERM`,forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m=`advanced`,...h})=>({...h,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:a,cleanup:o,all:s,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),Ga=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{..._.env,...e}:e;return n||r?mr({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o},Ka=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function qa(e){if(typeof e==`string`)return Ja(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return Ya(e)}const Ja=e=>e.at(-1)===Xa?e.slice(0,e.at(-2)===Qa?-2:-1):e,Ya=e=>e.at(-1)===Za?e.subarray(0,e.at(-2)===$a?-2:-1):e,Xa=`
23
+ `,Za=Xa.codePointAt(0),Qa=`\r`,$a=Qa.codePointAt(0);function U(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 eo(e,{checkOpen:t=!0}={}){return U(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 to(e,{checkOpen:t=!0}={}){return U(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 no(e,t){return eo(e,t)&&to(e,t)}const ro=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var io=class{#t;#n;#r=!1;#e=void 0;constructor(e,t){this.#t=e,this.#n=t}next(){let e=()=>this.#s();return this.#e=this.#e?this.#e.then(e,e):e(),this.#e}return(e){let t=()=>this.#i(e);return this.#e?this.#e.then(t,t):t()}async#s(){if(this.#r)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(e){throw this.#e=void 0,this.#r=!0,this.#t.releaseLock(),e}return e.done&&(this.#e=void 0,this.#r=!0,this.#t.releaseLock()),e}async#i(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#n){let t=this.#t.cancel(e);return this.#t.releaseLock(),await t,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}};const ao=Symbol();function oo(){return this[ao].next()}Object.defineProperty(oo,`name`,{value:`next`});function so(e){return this[ao].return(e)}Object.defineProperty(so,`name`,{value:`return`});const co=Object.create(ro,{next:{enumerable:!0,configurable:!0,writable:!0,value:oo},return:{enumerable:!0,configurable:!0,writable:!0,value:so}});function lo({preventCancel:e=!1}={}){let t=this.getReader(),n=new io(t,e),r=Object.create(co);return r[ao]=n,r}const uo=e=>{if(to(e,{checkOpen:!1})&&ho.on!==void 0)return po(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(fo.call(e)===`[object ReadableStream]`)return lo.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:fo}=Object.prototype,po=async function*(e){let t=new AbortController,n={};mo(e,t,n);try{for await(let[n]of ho.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()}},mo=async(e,t,n)=>{try{await ho.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},ho={},go=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=uo(e),u=t();u.length=0;try{for await(let e of l){let t=bo(e),o=n[t](e,u);vo({convertedChunk:o,state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c})}return _o({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}},_o=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&vo({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},vo=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){yo(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&yo(c,t,i,a),new So},yo=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},bo=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=xo.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&xo.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:xo}=Object.prototype;var So=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const W=e=>e,Co=()=>void 0,wo=({contents:e})=>e,To=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},Eo=e=>e.length;async function Do(e,t){return go(e,jo,t)}const Oo=()=>({contents:[]}),ko=()=>1,Ao=(e,{contents:t})=>(t.push(e),t),jo={init:Oo,convertChunk:{string:W,buffer:W,arrayBuffer:W,dataView:W,typedArray:W,others:W},getSize:ko,truncateChunk:Co,addChunk:Ao,getFinalChunk:Co,finalize:wo};async function Mo(e,t){return go(e,Ko,t)}const No=()=>({contents:new ArrayBuffer(0)}),Po=e=>Fo.encode(e),Fo=new TextEncoder,Io=e=>new Uint8Array(e),Lo=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ro=(e,t)=>e.slice(0,t),zo=(e,{contents:t,length:n},r)=>{let i=Go()?Vo(t,r):Bo(t,r);return new Uint8Array(i).set(e,n),i},Bo=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Ho(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Vo=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Ho(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},Ho=e=>Uo**Math.ceil(Math.log(e)/Math.log(Uo)),Uo=2,Wo=({contents:e,length:t})=>Go()?e:e.slice(0,t),Go=()=>`resize`in ArrayBuffer.prototype,Ko={init:No,convertChunk:{string:Po,buffer:Io,arrayBuffer:Io,dataView:Lo,typedArray:Lo,others:To},getSize:Eo,truncateChunk:Ro,addChunk:zo,getFinalChunk:Co,finalize:Wo};async function qo(e,t){return go(e,$o,t)}const Jo=()=>({contents:``,textDecoder:new TextDecoder}),Yo=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Xo=(e,{contents:t})=>t+e,Zo=(e,t)=>e.slice(0,t),Qo=({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},$o={init:Jo,convertChunk:{string:W,buffer:Yo,arrayBuffer:Yo,dataView:Yo,typedArray:Yo,others:To},getSize:Eo,truncateChunk:Zo,addChunk:Xo,getFinalChunk:Qo,finalize:wo},es=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof So))throw e;if(a===`all`)return e;let o=ts(n,r,i);throw e.maxBufferInfo={fdNumber:a,unit:o},t.destroy(),e},ts=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,ns=(e,t,n)=>{if(t.length!==n)return;let r=new So;throw r.maxBufferInfo={fdNumber:`ipc`},r},rs=(e,t)=>{let{streamName:n,threshold:r,unit:i}=os(e,t);return`Command's ${n} was larger than ${r} ${i}`},os=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:`output`,threshold:t[1],unit:`bytes`};let{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;let i=P(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:Ke(n),threshold:i,unit:r}},ss=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>ls(n)),cs=(e,t,n)=>{if(!t)return e;let r=ls(n);return e.length>r?e.slice(0,r):e},ls=([,e])=>e,us=({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=ds({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=ps(r,_),x=b===void 0?``:`\n${b}`,S=`${y}: ${s}${x}`,C=t===void 0?[e[2],e[1]]:[t],w=[S,...C,...e.slice(3),n.map(e=>ms(e)).join(`
24
+ `)].map(e=>ht(qa(hs(e)))).filter(Boolean).join(`
25
+
26
+ `);return{originalMessage:b,shortMessage:S,message:w}},ds=({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=fs(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?`${rs(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${Kr(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}`},fs=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,ps=(e,t)=>{if(e instanceof I)return;let n=_r(e)?e.originalMessage:String(e?.message??e),r=ht(Va(n,t));return r===``?void 0:r},ms=e=>typeof e==`string`?e:m(e),hs=e=>Array.isArray(e)?e.map(e=>qa(gs(e))).filter(Boolean).join(`
27
+ `):gs(e),gs=e=>typeof e==`string`?e:A(e)?ke(e):``,_s=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>xs({command:e,escapedCommand:t,cwd:a,durationMs:Gn(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:[]}),vs=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>ys({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}),ys=({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}=Ss(l,u),{originalMessage:w,shortMessage:ee,message:te}=us({stdio:d,all:f,ipcOutput:p,originalError:e,signal:S,signalDescription:C,exitCode:x,escapedCommand:n,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:_,maxBuffer:y,timeout:h,cwd:v}),T=hr(e,te,b);return Object.assign(T,bs({error:T,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:x,signal:S,signalDescription:C,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:w,shortMessage:ee})),T},bs=({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:_})=>xs({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:Gn(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:[]}),xs=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),Ss=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t,i=r===void 0?void 0:Kr(t);return{exitCode:n,signal:r,signalDescription:i}},Cs=e=>Number.isFinite(e)?e:0;function ws(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(Cs(e*1e3)%1e3),nanoseconds:Math.trunc(Cs(e*1e6)%1e3)}}function Ts(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 Es(e){switch(typeof e){case`number`:if(Number.isFinite(e))return ws(e);break;case`bigint`:return Ts(e)}throw TypeError(`Expected a finite number or bigint`)}const Ds=e=>e===0||e===0n,Os=(e,t)=>t===1||t===1n?e:`${e}s`,ks=1e-7,As=24n*60n*60n*1000n;function js(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+ks),r=Math.round(n)/10**t;return r.toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&Ds(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?` `+Os(n,e):r;i.push(a)}},s=Es(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){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=e>=1?Math.round(e):Math.ceil(e),c=a?e.toFixed(a):s;o(Number.parseFloat(c),`millisecond`,`ms`,c)}}else{let r=(n?Number(e%As):e)/1e3%60,i=typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1,s=a(r,i),c=t.keepDecimalsOnWholeSeconds?s:s.replace(/\.0+$/,``);o(Number.parseFloat(c),`second`,`s`,c)}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 Ms=(e,t)=>{e.failed&&Nn({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},Ns=(e,t)=>{st(t)&&(Ms(e,t),Ps(e,t))},Ps=(e,t)=>{let n=`(done in ${js(e.durationMs)})`;Nn({type:`duration`,verboseMessage:n,verboseInfo:t,result:e})},Fs=(e,t,{reject:n})=>{if(Ns(e,t),e.failed&&n)throw e;return e},Is=(e,t)=>G(e)?`asyncGenerator`:Gs(e)?`generator`:qs(e)?`fileUrl`:Ys(e)?`filePath`:nc(e)?`webStream`:U(e,{checkOpen:!1})?`native`:A(e)?`uint8Array`:ic(e)?`asyncIterable`:ac(e)?`iterable`:rc(e)?zs({transform:e},t):Ks(e)?Ls(e,t):`native`,Ls=(e,t)=>no(e.transform,{checkOpen:!1})?Rs(e,t):rc(e.transform)?zs(e,t):Hs(e,t),Rs=(e,t)=>(Bs(e,t,`Duplex stream`),`duplex`),zs=(e,t)=>(Bs(e,t,`web TransformStream`),`webTransform`),Bs=({final:e,binary:t,objectMode:n},r,i)=>{Vs(e,`${r}.final`,i),Vs(t,`${r}.binary`,i),Us(n,`${r}.objectMode`)},Vs=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Hs=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!Ws(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(no(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(rc(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Ws(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return Us(n,`${i}.binary`),Us(r,`${i}.objectMode`),G(e)||G(t)?`asyncGenerator`:`generator`},Us=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},Ws=e=>G(e)||Gs(e),G=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Gs=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Ks=e=>k(e)&&(e.transform!==void 0||e.final!==void 0),qs=e=>Object.prototype.toString.call(e)===`[object URL]`,Js=e=>qs(e)&&e.protocol!==`file:`,Ys=e=>k(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>Xs.has(e))&&Zs(e.file),Xs=new Set([`file`,`append`]),Zs=e=>typeof e==`string`,Qs=(e,t)=>e===`native`&&typeof t==`string`&&!$s.has(t),$s=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),ec=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,tc=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,nc=e=>ec(e)||tc(e),rc=e=>ec(e?.readable)&&tc(e?.writable),ic=e=>oc(e)&&typeof e[Symbol.asyncIterator]==`function`,ac=e=>oc(e)&&typeof e[Symbol.iterator]==`function`,oc=e=>typeof e==`object`&&!!e,K=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),sc=new Set([`fileUrl`,`filePath`,`fileNumber`]),cc=new Set([`fileUrl`,`filePath`]),lc=new Set([...cc,`webStream`,`nodeStream`]),uc=new Set([`webTransform`,`duplex`]),dc={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`},fc=(e,t,n,r)=>r===`output`?pc(e,t,n):mc(e,t,n),pc=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode,i=e??r;return{writableObjectMode:r,readableObjectMode:i}},mc=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode,i=t!==n.length-1&&(e??r);return{writableObjectMode:r,readableObjectMode:i}},hc=(e,t)=>{let n=e.findLast(({type:e})=>K.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},gc=(e,t,n,r)=>[...e.filter(({type:e})=>!K.has(e)),..._c(e,t,n,r)],_c=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>K.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=vc({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return Sc(a,n)},vc=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?yc({stdioItem:e,optionName:i}):t===`webTransform`?bc({stdioItem:e,index:n,newTransforms:r,direction:a}):xc({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),yc=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:a})=>{if(i&&!r)throw TypeError(`The \`${a}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw TypeError(`The \`${a}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},bc=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=k(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=fc(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},xc=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:a})=>{let{transform:o,final:s,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=k(t)?t:{transform:t},d=c||H.has(a),{writableObjectMode:f,readableObjectMode:p}=fc(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Sc=(e,t)=>t===`input`?e.reverse():e,Cc=(e,t,n)=>{let r=e.map(e=>wc(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)??kc},wc=({type:e,value:t},n)=>Tc[n]??Dc[e](t),Tc=[`input`,`output`,`output`],q=()=>void 0,Ec=()=>`input`,Dc={generator:q,asyncGenerator:q,fileUrl:q,filePath:q,iterable:Ec,asyncIterable:Ec,uint8Array:Ec,webStream:e=>tc(e)?`output`:`input`,nodeStream(e){return to(e,{checkOpen:!1})?eo(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:q,duplex:q,native(e){let t=Oc(e);if(t!==void 0)return t;if(U(e,{checkOpen:!1}))return Dc.nodeStream(e)}},Oc=e=>{if([0,_.stdin].includes(e))return`input`;if([1,2,_.stdout,_.stderr].includes(e))return`output`},kc=`output`,Ac=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e,jc=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=Mc(e,r).map((e,t)=>Pc(e,t));return a?Fc(o,n,i):Ac(o,t)},Mc=(e,t)=>{if(e===void 0)return N.map(e=>t[e]);if(Nc(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${N.map(e=>`\`${e}\``).join(`, `)}`);if(typeof e==`string`)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let n=Math.max(e.length,N.length);return Array.from({length:n},(t,n)=>e[n])},Nc=e=>N.some(t=>e[t]!==void 0),Pc=(e,t)=>Array.isArray(e)?e.map(e=>Pc(e,t)):e??(t>=N.length?`ignore`:`pipe`),Fc=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!ct(n,r)&&Ic(e)?`ignore`:e),Ic=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`),Lc=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?Rc({stdioItem:e,fdNumber:r,direction:i}):Vc({stdioItem:e,fdNumber:r}),Rc=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=zc({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(U(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},zc=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=Bc(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(S.isatty(i))throw TypeError(`The \`${t}: ${Ai(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:j(ue(i)),optionName:t}}},Bc=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Ge.indexOf(e);if(n!==-1)return n},Vc=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:Hc(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:Hc(t,t,n),optionName:n}:U(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,Hc=(e,t,n)=>{let r=Ge[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},Uc=({input:e,inputFile:t},n)=>n===0?[...Wc(e),...Kc(t)]:[],Wc=e=>e===void 0?[]:[{type:Gc(e),value:e,optionName:`input`}],Gc=e=>{if(to(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(A(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Kc=e=>e===void 0?[]:[{...qc(e),optionName:`inputFile`}],qc=e=>{if(qs(e))return{type:`fileUrl`,value:e};if(Zs(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},Jc=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),Yc=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=Xc(i,e);if(o.length!==0){if(a){Zc({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(lc.has(e))return Qc({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});uc.has(e)&&el({otherStdioItems:o,type:e,value:t,optionName:n})}},Xc=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map(t=>({...t,direction:e}))),Zc=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{cc.has(t)&&Qc({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},Qc=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>$c(e,n));if(a.length===0)return;let o=a.find(e=>e.direction!==i);return tl(o,r,t),i===`output`?a[0].stream:void 0},$c=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,el=({otherStdioItems:e,type:t,value:n,optionName:r})=>{let i=e.find(({value:{transform:e}})=>e===n.transform);tl(i,r,t)},tl=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${dc[n]} that is the same.`)},nl=(e,t,n,r)=>{let i=jc(t,n,r),a=i.map((e,n)=>rl({stdioOption:e,fdNumber:n,options:t,isSync:r})),o=dl({initialFileDescriptors:a,addProperties:e,options:t,isSync:r});return t.stdio=o.map(({stdioItems:e})=>hl(e)),o},rl=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Ke(t),{stdioItems:a,isStdioArray:o}=il({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=Cc(a,t,i),c=a.map(e=>Lc({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),l=gc(c,i,s,n),u=hc(l,s);return ul(l,u),{direction:s,objectMode:u,stdioItems:l}},il=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=Array.isArray(e)?e:[e],a=[...i.map(e=>al(e,r)),...Uc(n,t)],o=Jc(a),s=o.length>1;return ol(o,s,r),cl(o),{stdioItems:o,isStdioArray:s}},al=(e,t)=>({type:Is(e,t),value:e,optionName:t}),ol=(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(sl.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},sl=new Set([`ignore`,`ipc`]),cl=e=>{for(let t of e)ll(t)},ll=({type:e,value:t,optionName:n})=>{if(Js(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
28
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Qs(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},ul=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>sc.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},dl=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(fl({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw ml(i),e}},fl=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>{let s=n.map(t=>pl({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}));return{direction:e,objectMode:t,stdioItems:s}},pl=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=Yc({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},ml=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!M(e)&&e.destroy()},hl=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`},gl=(e,t)=>nl(bl,e,t,!0),J=({type:e,optionName:t})=>{vl(t,dc[e])},_l=({optionName:e,value:t})=>((t===`ipc`||t===`overlapped`)&&vl(e,`"${t}"`),{}),vl=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},yl={generator(){},asyncGenerator:J,webStream:J,nodeStream:J,webTransform:J,duplex:J,asyncIterable:J,native:_l},bl={input:{...yl,fileUrl:({value:e})=>({contents:[j(ue(e))]}),filePath:({value:{file:e}})=>({contents:[j(ue(e))]}),fileNumber:J,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...yl,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:J,string:J,uint8Array:J}},Y=(e,{stripFinalNewline:t},n)=>xl(t,n)&&e!==void 0&&!Array.isArray(e)?qa(e):e,xl=(e,t)=>t===`all`?e[1]||e[2]:e[t],Sl=(e,t,n,r)=>e||n?void 0:Tl(t,r),Cl=(e,t,n)=>n?e.flatMap(e=>wl(e,t)):wl(e,t),wl=(e,t)=>{let{transform:n,final:r}=Tl(t,{});return[...n(e),...r()]},Tl=(e,t)=>(t.previousChunks=``,{transform:El.bind(void 0,t,e),final:Ol.bind(void 0,t)}),El=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]===`
29
+ `){let o=Dl(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=jl(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=jl(r,n.slice(i+1))),e.previousChunks=r},Dl=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),Ol=function*({previousChunks:e}){e.length>0&&(yield e)},kl=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:Al.bind(void 0,r)},Al=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?Ml:Pl;if(t.at(-1)===i){yield t;return}let o=e?r:n;yield a(t,o)},jl=(e,t)=>`${e}${t}`,Ml={windowsNewline:`\r
30
+ `,unixNewline:`
31
+ `,LF:`
32
+ `,concatBytes:jl},Nl=(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},Pl={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Nl},Fl=(e,t)=>e?void 0:Il.bind(void 0,t),Il=function*(e,t){if(typeof t!=`string`&&!A(t)&&!ve.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Ll=(e,t)=>e?Rl.bind(void 0,t):zl.bind(void 0,t),Rl=function*(e,t){Bl(e,t),yield t},zl=function*(e,t){if(Bl(e,t),typeof t!=`string`&&!A(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Bl=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
33
+ Instead, \`yield\` should either be called with a value, or not be called at all. For example:
34
+ if (condition) { yield value; }`)},Vl=(e,t,n)=>{if(n)return;if(e)return{transform:Hl.bind(void 0,new TextEncoder)};let r=new u(t);return{transform:Ul.bind(void 0,r),final:Wl.bind(void 0,r)}},Hl=function*(e,t){ve.isBuffer(t)?yield j(t):typeof t==`string`?yield e.encode(t):yield t},Ul=function*(e,t){yield A(t)?e.write(t):t},Wl=function*(e){let t=e.end();t!==``&&(yield t)},Gl=f(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),Kl=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Xl}=t[n];for await(let i of r(e))yield*Kl(i,t,n+1)},ql=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Jl(n,Number(t),e)},Jl=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Kl(r,n,t+1)},Yl=f(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Xl=function*(e){yield e},Zl=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},Ql=(e,t)=>[...t.flatMap(t=>[...X(t,e,0)]),...$l(e)],X=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=tu}=t[n];for(let i of r(e))yield*X(i,t,n+1)},$l=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*eu(n,Number(t),e)},eu=function*(e,t,n){if(e!==void 0)for(let r of e())yield*X(r,n,t+1)},tu=function*(e){yield e},nu=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=iu(e,o,a),l=G(t),u=G(n),d=l?Gl.bind(void 0,Kl,s):Zl.bind(void 0,X),f=l||u?Gl.bind(void 0,ql,s):Zl.bind(void 0,$l),p=l||u?Yl.bind(void 0,s):void 0,m=new he({writableObjectMode:r,writableHighWaterMark:_e(r),readableObjectMode:i,readableHighWaterMark:_e(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p});return{stream:m}},ru=(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=iu(t,n,r);e=Ql(i,e)}return e},iu=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:Fl(r,s)},Vl(n,o,r),Sl(n,a,r,c),{transform:e,final:t},{transform:Ll(i,s)},kl({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},au=(e,t)=>{for(let n of ou(e))su(e,n,t)},ou=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),su=(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 ${dc[e]} with synchronous methods.`)}let a=i.map(({contents:e})=>e),o=a.map(e=>cu(e,r));n.input=Me(o)},cu=(e,t)=>{let n=ru(e,t,`utf8`,!0);return lu(n),Me(n)},lu=e=>{let t=e.find(e=>typeof e!=`string`&&!A(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},uu=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&ct(n,r)&&!H.has(t)&&du(r)&&(e.some(({type:e,value:t})=>e===`native`&&fu.has(t))||e.every(({type:e})=>K.has(e))),du=e=>e===1||e===2,fu=new Set([`pipe`,`overlapped`]),pu=async(e,t,n,r)=>{for await(let i of e)hu(t)||gu(i,n,r)},mu=(e,t,n)=>{for(let r of e)gu(r,t,n)},hu=e=>e._readableState.pipes.length>0,gu=(e,t,n)=>{let r=Ln(e);Nn({type:`output`,verboseMessage:r,fdNumber:t,verboseInfo:n})},_u=({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([]),s=t.map((t,s)=>vu({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n));return{output:s,...a}},vu=({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=cs(e,a,d),p=j(f),{stdioItems:m,objectMode:h}=t[n],g=yu([p],m,c,r),{serializedResult:_,finalResult:v=_}=bu({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});xu({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&&Su(_,m,i),y}catch(e){return r.error=e,y}},yu=(e,t,n,r)=>{try{return ru(e,t,n,!1)}catch(t){return r.error=t,e}},bu=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:Me(e)};let o=Ae(e,n);return r[a]?{serializedResult:o,finalResult:Cl(o,!i[a],t)}:{serializedResult:o}},xu=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!uu({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=Cl(e,!1,o);try{mu(s,t,r)}catch(e){n.error??=e}},Su=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>sc.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?se(r,e):(n.add(t),fe(r,e))}},Cu=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Y(t,n,`all`)]:Array.isArray(t)?[Y(e,n,`all`),...t]:A(e)&&A(t)?Pe([e,t]):`${e}${t}`},wu=async(e,t)=>{let[n,r]=await Tu(e);return t.isForcefullyTerminated??=!1,[n,r]},Tu=async e=>{let[t,n]=await Promise.allSettled([E(e,`spawn`),E(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Eu(e):n.value},Eu=async e=>{try{return await E(e,`exit`)}catch{return Eu(e)}},Du=async e=>{let[t,n]=await e;if(!Ou(t,n)&&ku(t,n))throw new I;return[t,n]},Ou=(e,t)=>e===void 0&&t===void 0,ku=(e,t)=>e!==0||t!==null,Au=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=ju(e,t,n),o=a?.code===`ETIMEDOUT`,s=ss(a,r,i);return{resultError:a,exitCode:t,signal:n,timedOut:o,isMaxBuffer:s}},ju=(e,t,n)=>e===void 0?ku(t,n)?new I:void 0:e,Mu=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=Nu(e,t,n),d=Lu({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s});return Fs(d,c,l)},Nu=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Kn(e,t,n),s=Pu(n),{file:c,commandArguments:l,options:u}=Ua(e,t,s);Fu(u);let d=gl(u,o);return{file:c,commandArguments:l,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:d}},Pu=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,Fu=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Iu(`ipcInput`),e&&Iu(`ipc: true`),n&&Iu(`detached: true`),r&&Iu(`cancelSignal`)},Iu=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Lu=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=Ru({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}=_u({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a}),g=m.map((e,t)=>Y(e,n,t)),_=Y(Cu(m,n),n,`all`);return Bu({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:n,command:r,escapedCommand:i,startTime:s})},Ru=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{au(a,n);let r=zu(n);return l(...Ka(e,t,r))}catch(e){return vs({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},zu=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:ls(t)}),Bu=({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?_s({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):ys({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}),Vu=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(ii({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Wi(e)}),Hu({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),Hu=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Mi(t,i);let a=Vi(e,t,n),o=new AbortController;try{return await Promise.race([Uu(a,r,o),Wu(a,n,o),Gu(a,n,o)])}catch(t){throw bi(e),t}finally{o.abort(),Pi(t,i)}},Uu=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await E(e,`message`,{signal:n});return t}for await(let[r]of ie(e,`message`,{signal:n}))if(t(r))return r},Wu=async(e,t,{signal:n})=>{await E(e,`disconnect`,{signal:n}),si(t)},Gu=async(e,t,{signal:n})=>{let[r]=await E(e,`strict:error`,{signal:n});throw li(r,t)},Ku=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>qu({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),qu=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{ii({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:Wi(e)}),Mi(t,a);let o=Vi(e,t,n),s=new AbortController,c={};return Ju(e,o,s),Yu({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),Xu({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},Ju=async(e,t,n)=>{try{await E(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},Yu=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await E(e,`strict:error`,{signal:n.signal});r.error=li(i,t),n.abort()}catch{}},Xu=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of ie(n,`message`,{signal:a.signal}))Zu(o),yield e}catch{Zu(o)}finally{a.abort(),Pi(t,s),r||bi(e),i&&await e}},Zu=({error:e})=>{if(e)throw e},Qu=(e,{ipc:t})=>{Object.assign(e,ed(e,!1,t))},$u=()=>{let e=_,t=!0,n=_.channel!==void 0;return{...ed(e,t,n),getCancelSignal:fa.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}},ed=(e,t,n)=>({sendMessage:oa.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:Vu.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:Ku.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),td=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:s})=>{ml(r);let c=new o;nd(c,r),Object.assign(c,{readable:rd,writable:id,duplex:ad});let l=vs({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1}),u=od(l,s,i);return{subprocess:c,promise:u}},nd=(e,t)=>{let n=Z(),r=Z(),i=Z(),a=Array.from({length:t.length-3},Z),o=Z(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},Z=()=>{let e=new me;return e.end(),e},rd=()=>new O({read(){}}),id=()=>new ge({write(){}}),ad=()=>new pe({read(){},write(){}}),od=async(e,t,n)=>Fs(e,t,n),sd=(e,t)=>nl(ld,e,t,!1),Q=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${dc[e]}.`)},cd={fileNumber:Q,generator:nu,asyncGenerator:nu,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n,i=pe.fromWeb(e,{objectMode:r});return{stream:i}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},ld={input:{...cd,fileUrl:({value:e})=>({stream:ce(e)}),filePath:({value:{file:e}})=>({stream:ce(e)}),webStream:({value:e})=>({stream:O.fromWeb(e)}),iterable:({value:e})=>({stream:O.from(e)}),asyncIterable:({value:e})=>({stream:O.from(e)}),string:({value:e})=>({stream:O.from(e)}),uint8Array:({value:e})=>({stream:O.from(ve.from(e))})},output:{...cd,fileUrl:({value:e})=>({stream:le(e)}),filePath:({value:{file:e,append:t}})=>({stream:le(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:ge.fromWeb(e)}),iterable:Q,asyncIterable:Q,string:Q,uint8Array:Q}};function ud(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)gd(t);let t=e.some(({readableObjectMode:e})=>e),n=dd(e,t),r=new fd({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const dd=(e,t)=>{if(e.length===0)return _e(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)};var fd=class extends me{#streams=new Set([]);#ended=new Set([]);#aborted=new Set([]);#onFinished;#unpipeEvent=Symbol(`unpipe`);#streamPromises=new WeakMap;add(e){if(gd(e),this.#streams.has(e))return;this.#streams.add(e),this.#onFinished??=pd(this,this.#streams,this.#unpipeEvent);let t=_d({passThroughStream:this,stream:e,streams:this.#streams,ended:this.#ended,aborted:this.#aborted,onFinished:this.#onFinished,unpipeEvent:this.#unpipeEvent});this.#streamPromises.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(gd(e),!this.#streams.has(e))return!1;let t=this.#streamPromises.get(e);return t===void 0?!1:(this.#streamPromises.delete(e),e.unpipe(this),await t,!0)}};const pd=async(e,t,n)=>{Dd(e,Od);let r=new AbortController;try{await Promise.race([md(e,r),hd(e,t,n,r)])}finally{r.abort(),Dd(e,-Od)}},md=async(e,{signal:t})=>{try{await D(e,{signal:t,cleanup:!0})}catch(t){throw Sd(e,t),t}},hd=async(e,t,n,{signal:r})=>{for await(let[i]of ie(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},gd=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},_d=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{Dd(e,kd);let s=new AbortController;try{await Promise.race([vd(a,t,s),yd({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),bd({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),Dd(e,-kd)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?wd(e):xd(e))},vd=async(e,t,{signal:n})=>{try{await e,n.aborted||wd(t)}catch(e){n.aborted||Sd(t,e)}},yd=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await D(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;Cd(r)?i.add(t):Td(e,r)}},bd=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await E(e,i,{signal:a}),!e.readable)return E(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},xd=e=>{e.writable&&e.end()},Sd=(e,t)=>{Cd(t)?wd(e):Td(e,t)},Cd=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,wd=e=>{(e.readable||e.writable)&&e.destroy()},Td=(e,t)=>{e.destroyed||(e.once(`error`,Ed),e.destroy(t))},Ed=()=>{},Dd=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},Od=2,kd=1,Ad=(e,t)=>{e.pipe(t),jd(e,t),Nd(e,t)},jd=async(e,t)=>{if(!(M(e)||M(t))){try{await D(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Md(t)}},Md=e=>{e.writable&&e.end()},Nd=async(e,t)=>{if(!(M(e)||M(t))){try{await D(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Pd(e)}},Pd=e=>{e.readable&&e.destroy()},Fd=(e,t,n)=>{let r=new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){for(let{stream:t}of a.filter(({type:e})=>K.has(e)))Id(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!K.has(e)))Rd({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries()){let n=t.length===1?t[0]:ud(t);Ad(n,e)}},Id=(e,t,n,r)=>{n===`output`?Ad(e.stdio[r],t):Ad(t,e.stdio[r]);let i=Ld[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},Ld=[`stdin`,`stdout`,`stderr`],Rd=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;zd(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},zd=(e,{signal:t})=>{M(e)&&ji(e,Bd,t)},Bd=2,Vd=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let a=i(()=>{e.kill()});re(r,()=>{a()})},Hd=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=Wn(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=Ud(n,r,i),{sourceStream:d,sourceError:f}=Kd(e,l),{options:p,fileDescriptors:m}=B.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},Ud=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=Wd(e,t,...n),s=xi(r,a);return{destination:r,destinationStream:s,from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},Wd=(e,t,n,...r)=>{if(Array.isArray(n)){let i=t(Gd,e)(n,...r);return{destination:i,pipeOptions:e}}if(typeof n==`string`||n instanceof URL||xe(n)){if(Object.keys(e).length>0)throw TypeError(`Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).`);let[i,a,o]=Ce(n,...r),s=t(Gd)(i,a,o);return{destination:s,pipeOptions:o}}if(B.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}`)},Gd=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),Kd=(e,t)=>{try{let n=Si(e,t);return{sourceStream:n}}catch(e){return{sourceError:e}}},qd=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=Jd({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw Yd({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},Jd=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return Pd(e),r;if(t!==void 0)return Md(n),t},Yd=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>vs({error:e,command:Xd,escapedCommand:Xd,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Xd=`source.pipe(destination)`,Zd=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},Qd=(e,t,n)=>{let r=nf.has(t)?ef(e,t):$d(e,t);return ji(e,rf,n.signal),ji(t,af,n.signal),tf(t),r},$d=(e,t)=>{let n=ud([e]);return Ad(n,t),nf.set(t,n),n},ef=(e,t)=>{let n=nf.get(t);return n.add(e),n},tf=async e=>{try{await D(e,{cleanup:!0,readable:!1,writable:!0})}catch{}nf.delete(e)},nf=new WeakMap,rf=2,af=1,sf=(e,t)=>e===void 0?[]:[cf(e,t)],cf=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{await d(e,t),await n.remove(t);let o=Error("Pipe canceled by `unpipeSignal` option.");throw Yd({error:o,fileDescriptors:r,sourceOptions:i,startTime:a})},lf=(e,...t)=>{if(k(t[0]))return lf.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=Hd(e,...t),i=uf({...r,destination:n});return i.pipe=lf.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},uf=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=df(e,i);qd({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=Qd(t,a,d);return await Promise.race([Zd(u),...sf(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},df=(e,t)=>Promise.allSettled([e,t]),ff=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return pf(t,o),gf({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},pf=async(e,t)=>{try{await e}catch{}finally{t.abort()}},mf=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;hf(t,o,e);let s=e.readableObjectMode&&!a;return gf({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},hf=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},gf=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>{let s=ie(e,`data`,{signal:t.signal,highWaterMark:vf,highWatermark:vf});return yf({onStdoutChunk:s,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})},_f=_e(!0),vf=_f,yf=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=bf({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*X(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*$l(s)}},bf=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Vl(e,n,!t),Sl(e,i,!r,{})].filter(Boolean),xf=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=Sf({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([Cf(e),d]);return}let f=xl(c,n),p=mf({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:f,allMixed:s}),[m]=await Promise.all([wf({stream:e,iterable:p,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return m},Sf=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{if(!uu({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n}))return;let s=mf({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await pu(s,e,n,a)},Cf=async e=>{await ee(),e.readableFlowing===null&&e.resume()},wf=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await Do(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await Mo(n,{maxBuffer:a})):await qo(n,{maxBuffer:a})}catch(n){return Ef(es({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},Tf=async e=>{try{return await e}catch(e){return Ef(e)}},Ef=({bufferedData:e})=>Te(e)?new Uint8Array(e):e,Df=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=Of(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],D(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||jf(e,t,n,r)}finally{o.abort()}},Of=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&kf(e,n,r),r},kf=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{Af(t,n),r.call(e,...i)}},Af=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},jf=(e,t,n,r)=>{if(!Mf(e,t,n,r))throw e},Mf=(e,t,n,r=!0)=>n.propagating?Ff(e)||Pf(e):(n.propagating=!0,Nf(n,t)===r?Ff(e):Pf(e)),Nf=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,Pf=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Ff=e=>e?.code===`EPIPE`,If=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>Lf({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),Lf=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=Df(e,t,l);if(Nf(l,t)){await u;return}let[d]=await Promise.all([xf({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},Rf=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?ud([e,t].filter(Boolean)):void 0,zf=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>Lf({...Bf(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Vf(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),Bf=({stdout:e,stderr:t,all:n},[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},Vf=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,Hf=e=>ct(e,`ipc`),Uf=(e,t)=>{let n=Ln(e);Nn({type:`ipc`,verboseMessage:n,fdNumber:`ipc`,verboseInfo:t})},Wf=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Hf(a),s=P(t,`ipc`),c=P(n,`ipc`);for await(let t of qu({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(ns(e,i,c),i.push(t)),o&&Uf(t,a);return i},Gf=async(e,t)=>(await Promise.allSettled([e]),t),Kf=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:a,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:_})=>{let v=wu(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=If({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=zf({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),S=[],C=Wf({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:S,verboseInfo:p}),w=qf(h,e,y),ee=Jf(m,y);try{return await Promise.race([Promise.all([{},Du(v),Promise.all(b),x,C,Ma(e,d),...w,...ee]),g,Yf(e,_),...wa(e,a,f,_),...ni({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...ba({subprocess:e,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,context:f,controller:_})])}catch(e){return f.terminationReason??=`other`,Promise.all([{error:e},v,Promise.all(b.map(e=>Tf(e))),Tf(x),Gf(C,S),Promise.allSettled(w),Promise.allSettled(ee)])}},qf=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:Df(e,r,n)),Jf=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>U(t,{checkOpen:!1})&&!M(t)).map(({type:e,value:r,stream:i=r})=>Df(i,n,t,{isSameDirection:K.has(e),stopOnExit:e===`native`}))),Yf=async(e,{signal:t})=>{let[n]=await E(e,`error`,{signal:t});throw n},Xf=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Zf=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=z();i.push(a);let o=a.resolve.bind(a);return{resolve:o,promises:i}},Qf=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},$f=async e=>{if(e!==void 0)try{await tp(e)}catch{}},ep=async e=>{if(e!==void 0)try{await np(e)}catch{}},tp=async e=>{await D(e,{cleanup:!0,readable:!1,writable:!0})},np=async e=>{await D(e,{cleanup:!0,readable:!0,writable:!1})},rp=async(e,t)=>{if(await e,t)throw t},ip=(e,t,n)=>{n&&!Pf(n)?e.destroy(n):t&&e.destroy()},ap=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||H.has(n),{subprocessStdout:s,waitReadableDestroy:c}=op(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=sp(s,o),{read:p,onStdoutDataDone:m}=cp({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),h=new O({read:p,destroy:f(dp.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return up({subprocessStdout:s,onStdoutDataDone:m,readable:h,subprocess:e}),h},op=(e,t,n)=>{let r=Si(e,t),i=Zf(n,r,`readableDestroy`);return{subprocessStdout:r,waitReadableDestroy:i}},sp=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:_f},cp=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=z(),o=ff({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){lp(this,o,a)},onStdoutDataDone:a}},lp=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},up=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await np(e),await r,await $f(i),await t,n.readable&&n.push(null)}catch(e){await $f(i),fp(n,e)}},dp=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Qf(n,t)&&(fp(e,r),await rp(t,r))},fp=(e,t)=>{ip(e,e.readable,t)},pp=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=mp(e,n,t),o=new ge({...hp(r,e,i),destroy:f(yp.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return vp(r,o),o},mp=(e,t,n)=>{let r=xi(e,t),i=Zf(n,r,`writableFinal`),a=Zf(n,r,`writableDestroy`);return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}},hp=(e,t,n)=>({write:gp.bind(void 0,e),final:f(_p.bind(void 0,e,t,n))}),gp=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},_p=async(e,t,n)=>{await Qf(n,t)&&(e.writable&&e.end(),await t)},vp=async(e,t,n)=>{try{await tp(e),t.writable&&t.end()}catch(e){await ep(n),bp(t,e)}},yp=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Qf(n,t),await Qf(r,t)&&(bp(e,i),await rp(t,i))},bp=(e,t)=>{ip(e,e.writable,t)},xp=({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}=op(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:p}=mp(e,i,t),{readableEncoding:m,readableObjectMode:h,readableHighWaterMark:g}=sp(c,s),{read:_,onStdoutDataDone:v}=cp({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),y=new pe({read:_,...hp(u,e,d),destroy:f(Sp.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:p})),readableHighWaterMark:g,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:m});return up({subprocessStdout:c,onStdoutDataDone:v,readable:y,subprocess:e,subprocessStdin:u}),vp(u,y,c),y},Sp=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([dp({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),yp({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},Cp=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||H.has(t),o=Si(e,n),s=ff({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i});return wp(s,o,e)},wp=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},Tp=(e,{encoding:t})=>{let n=Xf();e.readable=ap.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=pp.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=xp.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=Cp.bind(void 0,e,t),e[Symbol.asyncIterator]=Cp.bind(void 0,e,t,{})},Ep=(e,t)=>{for(let[n,r]of Op){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Dp=(async()=>{})().constructor.prototype,Op=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Dp,e)]),kp=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Ap(e,t,n),{subprocess:f,promise:p}=Mp({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=lf.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Ep(f,p),B.set(f,{options:u,fileDescriptors:d}),f},Ap=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Kn(e,t,n),{file:s,commandArguments:c,options:l}=Ua(e,t,n),u=jp(l),d=sd(u,o);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:d}},jp=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},Mp=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let l;try{l=c(...Ka(e,t,n))}catch(e){return td({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let u=new AbortController;ae(1/0,u.signal);let d=[...l.stdio];Fd(l,s,u),Vd(l,n,u);let f={},p=z();l.kill=Yr.bind(void 0,{kill:l.kill.bind(l),options:n,onInternalError:p,context:f,controller:u}),l.all=Rf(l,n),Tp(l,n),Qu(l,n);let m=Np({subprocess:l,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:d,command:a,escapedCommand:o,context:f,onInternalError:p,controller:u});return{subprocess:l,promise:m}},Np=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:a,command:o,escapedCommand:s,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await Kf({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});u.abort(),l.resolve();let _=m.map((e,n)=>Y(e,t,n)),v=Y(h,t,`all`),y=Pp({errorInfo:d,exitCode:f,signal:p,stdio:_,all:v,ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n});return Fs(y,r,t)},Pp=({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?ys({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 So,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):_s({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),Fp=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,Ip(t,e[t],n)]));return{...e,...n}},Ip=(e,t,n)=>Lp.has(e)&&k(t)&&k(n)?{...t,...n}:n,Lp=new Set([`env`,...ot]),$=(e,t,n,r)=>{let i=(e,t,r)=>$(e,t,n,r),a=(...a)=>Rp({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},Rp=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(k(a))return i(e,Fp(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=zp({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?Mu(s,c,l):kp(s,c,l,i)},zp=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let a=Ie(t)?Le(t,n):[t,...n],[o,s,c]=Ce(...a),l=Fp(Fp(r,i),c),{file:u=o,commandArguments:d=s,options:f=l,isSync:p=!1}=e({file:o,commandArguments:s,options:l});return{file:u,commandArguments:d,options:f,isSync:p}},Bp=({file:e,commandArguments:t})=>Hp(e,t),Vp=({file:e,commandArguments:t})=>({...Hp(e,t),isSync:!0}),Hp=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[n,...r]=Up(e);return{file:n,commandArguments:r}},Up=e=>{if(typeof e!=`string`)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t===``)return[];let n=[];for(let e of t.split(Wp)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Wp=/ +/g,Gp=(e,t,n)=>{e.sync=t(qp,n),e.s=e.sync},Kp=({options:e})=>Jp(e),qp=({options:e})=>({...Jp(e),isSync:!0}),Jp=e=>({options:{...Yp(e),...e}}),Yp=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},Xp={preferLocal:!0},Zp=$(()=>({})),Qp=$(()=>({isSync:!0})),$p=$(Bp),em=$(Vp),tm=$(Ea),nm=$(Kp,{},Xp,Gp),{sendMessage:rm,getOneMessage:im,getEachMessage:am,getCancelSignal:om}=$u();var sm={};t(sm,{builder:()=>hm,command:()=>cm,description:()=>lm});const cm=`git`,lm=``,um=process.cwd();function dm(){try{return!!Qp(`git`,[`--version`],{cwd:um}).stdout}catch{throw Error(`git is not installed`)}}function fm(){try{return Qp(`git`,[`rev-parse`,`--is-inside-work-tree`],{cwd:um}).stdout===`true`}catch{throw Error(`not a git repository`)}}function pm(){return Zp(`git`,[`config`,`core.hooksPath`,`.githooks`],{cwd:um})}function mm(){try{return dm()&&fm()}catch(e){return console.error(`Fail:`,e.message),!1}}function hm(e){e.command(`hooks`,`Set .githooks as git.hooksPath`,{},()=>{mm()&&pm().then(()=>{console.log(`Done: set .githooks`)}).catch(()=>{console.error(`Fail:`,`setting hooks failed`),process.exitCode=1})}),e.demandCommand(1,"Typing `hooks`")}export{hm as builder$1,cm as command$1,lm as description$1,Zp as execa,sm as git_hooks_exports};
@@ -0,0 +1,2 @@
1
+ import{source_default as e}from"./source-CzrP3otD.mjs";const t=[` `,`⚠`,`✖`],n=[`white`,`yellow`,`red`];function r(e={},t={}){let{results:n=[]}=e,r=e=>i(e,t),o=e=>a(e,t);return n.filter(e=>Array.isArray(e.warnings)||Array.isArray(e.errors)).map(e=>[...r(e),...o(e)]).reduce((e,t)=>Array.isArray(t)?[...e,...t]:[...e,t],[]).join(`
2
+ `)}function i(t,n={}){let{color:r=!0}=n,{errors:i=[],warnings:a=[],input:o=``}=t;if(!o)return[``];let s=`⧗`,c=r?e.gray(s):s,l=r?e.bold(o):o,u=i.length>0||a.length>0;return n.verbose||u?[`${c} input: ${l}`]:[]}function a(r={},i={}){let{signs:a=t,colors:o=n,color:l=!0}=i,{errors:u=[],warnings:d=[]}=r,f=[...u,...d].map(t=>{let n=a[t.level]||``,r=o[t.level]||`white`,i=l?e[r](n):n,s=l?e.grey(`[${t.name}]`):`[${t.name}]`;return`${i} ${t.message} ${s}`}),p=s(r),m=c(r),h=l?e[m](p):p,g=u.length,_=d.length,v=f.length>0,y=i.verbose||v?`${h} found ${g} problems, ${_} warnings`:void 0,b=l&&typeof y==`string`?e.bold(y):y,x=v&&i.helpUrl?`ⓘ Get help: ${i.helpUrl}`:void 0;return[...f,v?``:void 0,b,x,v?``:void 0].filter(e=>typeof e==`string`)}var o=r;function s(e){return(e.errors||[]).length>0?`✖`:(e.warnings||[]).length?`⚠`:`✔`}function c(e){return(e.errors||[]).length>0?`red`:(e.warnings||[]).length?`yellow`:`green`}export{o as default};