@nice-move/init 0.8.33 → 0.8.35
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./cli.mjs";import{createRequire as r}from"node:module";import i,{isAbsolute as a,join as o,parse as s,resolve as c}from"node:path";import{fileURLToPath as l}from"node:url";import u,{execArgv as d,execPath as f,hrtime as p,platform as m}from"node:process";import h,{constants as g,type as _}from"node:os";import v from"node:tty";import y,{ChildProcess as b,execFile as x,execSync as S,spawn as C,spawnSync as w}from"node:child_process";import{appendFileSync as T,createReadStream as E,createWriteStream as ee,readFileSync as te,readdirSync as ne,statSync as re,writeFileSync as ie}from"node:fs";import{aborted as ae,callbackify as oe,debuglog as se,inspect as ce,promisify as le,stripVTControlCharacters as ue}from"node:util";import{StringDecoder as de}from"node:string_decoder";import{scheduler as fe,setImmediate as pe,setTimeout as me}from"node:timers/promises";import{EventEmitter as he,addAbortListener as ge,on as _e,once as D,setMaxListeners as ve}from"node:events";import{serialize as ye}from"node:v8";import{finished as
|
|
2
|
-
GFS4: `),console.error(e)}),r[c]||(d(r,global[c]||[]),r.close=(function(e){function t(t,n){return e.call(r,t,function(e){e||g(),typeof n==`function`&&n.apply(this,arguments)})}return Object.defineProperty(t,l,{value:e}),t})(r.close),r.closeSync=(function(e){function t(t){e.apply(r,arguments),g()}return Object.defineProperty(t,l,{value:e}),t})(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&process.on(`exit`,function(){f(r[c]),e(`assert`).equal(r[c].length,0)})),global[c]||d(global,r[c]),n.exports=p(o(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(n.exports=p(r),r.__patched=!0);function p(e){i(e),e.gracefulify=p,e.createReadStream=T,e.createWriteStream=E;var t=e.readFile;e.readFile=n;function n(e,n,r){return typeof n==`function`&&(r=n,n=null),i(e,n,r);function i(e,n,r,a){return t(e,n,function(t){t&&(t.code===`EMFILE`||t.code===`ENFILE`)?m([i,[e,n,r],t,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=o;function o(e,t,n,i){return typeof n==`function`&&(i=n,n=null),a(e,t,n,i);function a(e,t,n,i,o){return r(e,t,n,function(r){r&&(r.code===`EMFILE`||r.code===`ENFILE`)?m([a,[e,t,n,i],r,o||Date.now(),Date.now()]):typeof i==`function`&&i.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=c);function c(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return s(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var l=e.copyFile;l&&(e.copyFile=u);function u(e,t,n,r){return typeof n==`function`&&(r=n,n=0),i(e,t,n,r);function i(e,t,n,r,a){return l(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var d=e.readdir;e.readdir=h;var f=/^v[0-5]\./;function h(e,t,n){typeof t==`function`&&(n=t,t=null);var r=f.test(process.version)?function(e,t,n,r){return d(e,i(e,t,n,r))}:function(e,t,n,r){return d(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(a,o){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?m([r,[e,t,n],a,i||Date.now(),Date.now()]):(o&&o.sort&&o.sort(),typeof n==`function`&&n.call(this,a,o))}}}if(process.version.substr(0,4)===`v0.8`){var g=a(e);x=g.ReadStream,C=g.WriteStream}var _=e.ReadStream;_&&(x.prototype=Object.create(_.prototype),x.prototype.open=S);var v=e.WriteStream;v&&(C.prototype=Object.create(v.prototype),C.prototype.open=w),Object.defineProperty(e,`ReadStream`,{get:function(){return x},set:function(e){x=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,`WriteStream`,{get:function(){return C},set:function(e){C=e},enumerable:!0,configurable:!0});var y=x;Object.defineProperty(e,`FileReadStream`,{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var b=C;Object.defineProperty(e,`FileWriteStream`,{get:function(){return b},set:function(e){b=e},enumerable:!0,configurable:!0});function x(e,t){return this instanceof x?(_.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function S(){var e=this;te(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n),e.read())})}function C(e,t){return this instanceof C?(v.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function w(){var e=this;te(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function T(t,n){return new e.ReadStream(t,n)}function E(t,n){return new e.WriteStream(t,n)}var ee=e.open;e.open=te;function te(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return ee(e,t,n,function(o,s){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}return e}function m(e){f(`ENQUEUE`,e[0].name,e[1]),r[c].push(e),_()}var h;function g(){for(var e=Date.now(),t=0;t<r[c].length;++t)r[c][t].length>2&&(r[c][t][3]=e,r[c][t][4]=e);_()}function _(){if(clearTimeout(h),h=void 0,r[c].length!==0){var e=r[c].shift(),t=e[0],n=e[1],i=e[2],a=e[3],o=e[4];if(a===void 0)f(`RETRY`,t.name,n),t.apply(null,n);else if(Date.now()-a>=6e4){f(`TIMEOUT`,t.name,n);var s=n.pop();typeof s==`function`&&s.call(null,i)}else{var l=Date.now()-o,u=Math.max(o-a,1);l>=Math.min(u*1.2,100)?(f(`RETRY`,t.name,n),t.apply(null,n.concat([a]))):r[c].push(e)}h===void 0&&(h=setTimeout(_,0))}}})),A=n((e=>{let t=k().fromCallback,n=Ae(),r=`access.appendFile.chmod.chown.close.copyFile.cp.fchmod.fchown.fdatasync.fstat.fsync.ftruncate.futimes.glob.lchmod.lchown.lutimes.link.lstat.mkdir.mkdtemp.open.opendir.readdir.readFile.readlink.realpath.rename.rm.rmdir.stat.statfs.symlink.truncate.unlink.utimes.writeFile`.split(`.`).filter(e=>typeof n[e]==`function`);Object.assign(e,n),r.forEach(r=>{e[r]=t(n[r])}),e.exists=function(e,t){return typeof t==`function`?n.exists(e,t):new Promise(t=>n.exists(e,t))},e.read=function(e,t,r,i,a,o){return typeof o==`function`?n.read(e,t,r,i,a,o):new Promise((o,s)=>{n.read(e,t,r,i,a,(e,t,n)=>{if(e)return s(e);o({bytesRead:t,buffer:n})})})},e.write=function(e,t,...r){return typeof r[r.length-1]==`function`?n.write(e,t,...r):new Promise((i,a)=>{n.write(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffer:n})})})},e.readv=function(e,t,...r){return typeof r[r.length-1]==`function`?n.readv(e,t,...r):new Promise((i,a)=>{n.readv(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesRead:t,buffers:n})})})},e.writev=function(e,t,...r){return typeof r[r.length-1]==`function`?n.writev(e,t,...r):new Promise((i,a)=>{n.writev(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffers:n})})})},typeof n.realpath.native==`function`?e.realpath.native=t(n.realpath.native):process.emitWarning(`fs.realpath.native is not a function. Is fs being monkey-patched?`,`Warning`,`fs-extra-WARN0003`)})),je=n(((t,n)=>{let r=e(`path`);n.exports.checkPath=function(e){if(process.platform===`win32`&&/[<>:"|?*]/.test(e.replace(r.parse(e).root,``))){let t=Error(`Path contains invalid characters: ${e}`);throw t.code=`EINVAL`,t}}})),Me=n(((e,t)=>{let n=A(),{checkPath:r}=je(),i=e=>typeof e==`number`?e:{mode:511,...e}.mode;t.exports.makeDir=async(e,t)=>(r(e),n.mkdir(e,{mode:i(t),recursive:!0})),t.exports.makeDirSync=(e,t)=>(r(e),n.mkdirSync(e,{mode:i(t),recursive:!0}))})),j=n(((e,t)=>{let n=k().fromPromise,{makeDir:r,makeDirSync:i}=Me(),a=n(r);t.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}})),Ne=n(((e,t)=>{let n=k().fromPromise,r=A();function i(e){return r.access(e).then(()=>!0).catch(()=>!1)}t.exports={pathExists:n(i),pathExistsSync:r.existsSync}})),Pe=n(((e,t)=>{let n=A(),r=k().fromPromise;async function i(e,t,r){let i=await n.open(e,`r+`),a=null;try{await n.futimes(i,t,r)}finally{try{await n.close(i)}catch(e){a=e}}if(a)throw a}function a(e,t,r){let i=n.openSync(e,`r+`);return n.futimesSync(i,t,r),n.closeSync(i)}t.exports={utimesMillis:r(i),utimesMillisSync:a}})),Fe=n(((t,n)=>{let r=A(),i=e(`path`),a=k().fromPromise;function o(e,t,n){let i=n.dereference?e=>r.stat(e,{bigint:!0}):e=>r.lstat(e,{bigint:!0});return Promise.all([i(e),i(t).catch(e=>{if(e.code===`ENOENT`)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}function s(e,t,n){let i,a=n.dereference?e=>r.statSync(e,{bigint:!0}):e=>r.lstatSync(e,{bigint:!0}),o=a(e);try{i=a(t)}catch(e){if(e.code===`ENOENT`)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:i}}async function c(e,t,n,r){let{srcStat:a,destStat:s}=await o(e,t,r);if(s){if(f(a,s)){let r=i.basename(e),o=i.basename(t);if(n===`move`&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:a,destStat:s,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!s.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&s.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&p(e,t))throw Error(m(e,t,n));return{srcStat:a,destStat:s}}function l(e,t,n,r){let{srcStat:a,destStat:o}=s(e,t,r);if(o){if(f(a,o)){let r=i.basename(e),s=i.basename(t);if(n===`move`&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:a,destStat:o,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!o.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&o.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&p(e,t))throw Error(m(e,t,n));return{srcStat:a,destStat:o}}async function u(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=await r.stat(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(f(t,c))throw Error(m(e,n,a));return u(e,t,s,a)}function d(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=r.statSync(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(f(t,c))throw Error(m(e,n,a));return d(e,t,s,a)}function f(e,t){return t.ino!==void 0&&t.dev!==void 0&&t.ino===e.ino&&t.dev===e.dev}function p(e,t){let n=i.resolve(e).split(i.sep).filter(e=>e),r=i.resolve(t).split(i.sep).filter(e=>e);return n.every((e,t)=>r[t]===e)}function m(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}n.exports={checkPaths:a(c),checkPathsSync:l,checkParentPaths:a(u),checkParentPathsSync:d,isSrcSubdir:p,areIdentical:f}})),Ie=n(((e,t)=>{async function n(e,t){let n=[];for await(let r of e)n.push(t(r).then(()=>null,e=>e??Error(`unknown error`)));await Promise.all(n.map(e=>e.then(e=>{if(e!==null)throw e})))}t.exports={asyncIteratorConcurrentProcess:n}})),Le=n(((t,n)=>{let r=A(),i=e(`path`),{mkdirs:a}=j(),{pathExists:o}=Ne(),{utimesMillis:s}=Pe(),c=Fe(),{asyncIteratorConcurrentProcess:l}=Ie();async function u(e,t,n={}){typeof n==`function`&&(n={filter:n}),n.clobber=`clobber`in n?!!n.clobber:!0,n.overwrite=`overwrite`in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
1
|
+
import{n as e,r as t,t as n}from"./cli.mjs";import{createRequire as r}from"node:module";import i,{isAbsolute as a,join as o,parse as s,resolve as c}from"node:path";import{fileURLToPath as l}from"node:url";import u,{execArgv as d,execPath as f,hrtime as p,platform as m}from"node:process";import h,{constants as g,type as _}from"node:os";import v from"node:tty";import y,{ChildProcess as b,execFile as x,execSync as S,spawn as C,spawnSync as w}from"node:child_process";import{appendFileSync as T,createReadStream as E,createWriteStream as ee,readFileSync as te,readdirSync as ne,statSync as re,writeFileSync as ie}from"node:fs";import{aborted as ae,callbackify as oe,debuglog as se,inspect as ce,promisify as le,stripVTControlCharacters as ue}from"node:util";import{StringDecoder as de}from"node:string_decoder";import{scheduler as fe,setImmediate as pe,setTimeout as me}from"node:timers/promises";import{EventEmitter as he,addAbortListener as ge,on as _e,once as D,setMaxListeners as ve}from"node:events";import{serialize as ye}from"node:v8";import{finished as be}from"node:stream/promises";import{Duplex as xe,PassThrough as Se,Readable as Ce,Transform as we,Writable as Te,getDefaultHighWaterMark as Ee}from"node:stream";import{Buffer as De}from"node:buffer";var O=n((e=>{e.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]==`function`)e.apply(this,t);else return new Promise((n,r)=>{t.push((e,t)=>e==null?n(t):r(e)),e.apply(this,t)})},`name`,{value:e.name})},e.fromPromise=function(e){return Object.defineProperty(function(...t){let n=t[t.length-1];if(typeof n!=`function`)return e.apply(this,t);t.pop(),e.apply(this,t).then(e=>n(null,e),n)},`name`,{value:e.name})}})),Oe=n(((t,n)=>{var r=e(`constants`),i=process.cwd,a=null,o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return a||=i.call(process),a};try{process.cwd()}catch{}if(typeof process.chdir==`function`){var s=process.chdir;process.chdir=function(e){a=null,s.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s)}n.exports=c;function c(e){r.hasOwnProperty(`O_SYMLINK`)&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=c(e.chownSync),e.fchownSync=c(e.fchownSync),e.lchownSync=c(e.lchownSync),e.chmodSync=a(e.chmodSync),e.fchmodSync=a(e.fchmodSync),e.lchmodSync=a(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){}),o===`win32`&&(e.rename=typeof e.rename==`function`?(function(t){function n(n,r,i){var a=Date.now(),o=0;t(n,r,function s(c){if(c&&(c.code===`EACCES`||c.code===`EPERM`||c.code===`EBUSY`)&&Date.now()-a<6e4){setTimeout(function(){e.stat(r,function(e,a){e&&e.code===`ENOENT`?t(n,r,s):i(c)})},o),o<100&&(o+=10);return}i&&i(c)})}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.rename):e.rename),e.read=typeof e.read==`function`?(function(t){function n(n,r,i,a,o,s){var c;if(s&&typeof s==`function`){var l=0;c=function(u,d,f){if(u&&u.code===`EAGAIN`&&l<10)return l++,t.call(e,n,r,i,a,o,c);s.apply(this,arguments)}}return t.call(e,n,r,i,a,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.read):e.read,e.readSync=typeof e.readSync==`function`?(function(t){return function(n,r,i,a,o){for(var s=0;;)try{return t.call(e,n,r,i,a,o)}catch(e){if(e.code===`EAGAIN`&&s<10){s++;continue}throw e}}})(e.readSync):e.readSync;function t(e){e.lchmod=function(t,n,i){e.open(t,r.O_WRONLY|r.O_SYMLINK,n,function(t,r){if(t){i&&i(t);return}e.fchmod(r,n,function(t){e.close(r,function(e){i&&i(t||e)})})})},e.lchmodSync=function(t,n){var i=e.openSync(t,r.O_WRONLY|r.O_SYMLINK,n),a=!0,o;try{o=e.fchmodSync(i,n),a=!1}finally{if(a)try{e.closeSync(i)}catch{}else e.closeSync(i)}return o}}function n(e){r.hasOwnProperty(`O_SYMLINK`)&&e.futimes?(e.lutimes=function(t,n,i,a){e.open(t,r.O_SYMLINK,function(t,r){if(t){a&&a(t);return}e.futimes(r,n,i,function(t){e.close(r,function(e){a&&a(t||e)})})})},e.lutimesSync=function(t,n,i){var a=e.openSync(t,r.O_SYMLINK),o,s=!0;try{o=e.futimesSync(a,n,i),s=!1}finally{if(s)try{e.closeSync(a)}catch{}else e.closeSync(a)}return o}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}function i(t){return t&&function(n,r,i){return t.call(e,n,r,function(e){d(e)&&(e=null),i&&i.apply(this,arguments)})}}function a(t){return t&&function(n,r){try{return t.call(e,n,r)}catch(e){if(!d(e))throw e}}}function s(t){return t&&function(n,r,i,a){return t.call(e,n,r,i,function(e){d(e)&&(e=null),a&&a.apply(this,arguments)})}}function c(t){return t&&function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!d(e))throw e}}}function l(t){return t&&function(n,r,i){typeof r==`function`&&(i=r,r=null);function a(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return r?t.call(e,n,r,a):t.call(e,n,a)}}function u(t){return t&&function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}}function d(e){return!e||e.code===`ENOSYS`||(!process.getuid||process.getuid()!==0)&&(e.code===`EINVAL`||e.code===`EPERM`)}}})),ke=n(((t,n)=>{var r=e(`stream`).Stream;n.exports=i;function i(e){return{ReadStream:t,WriteStream:n};function t(n,i){if(!(this instanceof t))return new t(n,i);r.call(this);var a=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags=`r`,this.mode=438,this.bufferSize=64*1024,i||={};for(var o=Object.keys(i),s=0,c=o.length;s<c;s++){var l=o[s];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!=`number`)throw TypeError(`start must be a Number`);if(this.end===void 0)this.end=1/0;else if(typeof this.end!=`number`)throw TypeError(`end must be a Number`);if(this.start>this.end)throw Error(`start must be <= end`);this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(e,t){if(e){a.emit(`error`,e),a.readable=!1;return}a.fd=t,a.emit(`open`,t),a._read()})}function n(t,i){if(!(this instanceof n))return new n(t,i);r.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags=`w`,this.encoding=`binary`,this.mode=438,this.bytesWritten=0,i||={};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var c=a[o];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!=`number`)throw TypeError(`start must be a Number`);if(this.start<0)throw Error(`start must be >= zero`);this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}})),Ae=n(((e,t)=>{t.exports=r;var n=Object.getPrototypeOf||function(e){return e.__proto__};function r(e){if(typeof e!=`object`||!e)return e;if(e instanceof Object)var t={__proto__:n(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}})),je=n(((t,n)=>{var r=e(`fs`),i=Oe(),a=ke(),o=Ae(),s=e(`util`),c,l;typeof Symbol==`function`&&typeof Symbol.for==`function`?(c=Symbol.for(`graceful-fs.queue`),l=Symbol.for(`graceful-fs.previous`)):(c=`___graceful-fs.queue`,l=`___graceful-fs.previous`);function u(){}function d(e,t){Object.defineProperty(e,c,{get:function(){return t}})}var f=u;s.debuglog?f=s.debuglog(`gfs4`):/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&(f=function(){var e=s.format.apply(s,arguments);e=`GFS4: `+e.split(/\n/).join(`
|
|
2
|
+
GFS4: `),console.error(e)}),r[c]||(d(r,global[c]||[]),r.close=(function(e){function t(t,n){return e.call(r,t,function(e){e||g(),typeof n==`function`&&n.apply(this,arguments)})}return Object.defineProperty(t,l,{value:e}),t})(r.close),r.closeSync=(function(e){function t(t){e.apply(r,arguments),g()}return Object.defineProperty(t,l,{value:e}),t})(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&process.on(`exit`,function(){f(r[c]),e(`assert`).equal(r[c].length,0)})),global[c]||d(global,r[c]),n.exports=p(o(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(n.exports=p(r),r.__patched=!0);function p(e){i(e),e.gracefulify=p,e.createReadStream=T,e.createWriteStream=E;var t=e.readFile;e.readFile=n;function n(e,n,r){return typeof n==`function`&&(r=n,n=null),i(e,n,r);function i(e,n,r,a){return t(e,n,function(t){t&&(t.code===`EMFILE`||t.code===`ENFILE`)?m([i,[e,n,r],t,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=o;function o(e,t,n,i){return typeof n==`function`&&(i=n,n=null),a(e,t,n,i);function a(e,t,n,i,o){return r(e,t,n,function(r){r&&(r.code===`EMFILE`||r.code===`ENFILE`)?m([a,[e,t,n,i],r,o||Date.now(),Date.now()]):typeof i==`function`&&i.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=c);function c(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return s(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var l=e.copyFile;l&&(e.copyFile=u);function u(e,t,n,r){return typeof n==`function`&&(r=n,n=0),i(e,t,n,r);function i(e,t,n,r,a){return l(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var d=e.readdir;e.readdir=h;var f=/^v[0-5]\./;function h(e,t,n){typeof t==`function`&&(n=t,t=null);var r=f.test(process.version)?function(e,t,n,r){return d(e,i(e,t,n,r))}:function(e,t,n,r){return d(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(a,o){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?m([r,[e,t,n],a,i||Date.now(),Date.now()]):(o&&o.sort&&o.sort(),typeof n==`function`&&n.call(this,a,o))}}}if(process.version.substr(0,4)===`v0.8`){var g=a(e);x=g.ReadStream,C=g.WriteStream}var _=e.ReadStream;_&&(x.prototype=Object.create(_.prototype),x.prototype.open=S);var v=e.WriteStream;v&&(C.prototype=Object.create(v.prototype),C.prototype.open=w),Object.defineProperty(e,`ReadStream`,{get:function(){return x},set:function(e){x=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,`WriteStream`,{get:function(){return C},set:function(e){C=e},enumerable:!0,configurable:!0});var y=x;Object.defineProperty(e,`FileReadStream`,{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var b=C;Object.defineProperty(e,`FileWriteStream`,{get:function(){return b},set:function(e){b=e},enumerable:!0,configurable:!0});function x(e,t){return this instanceof x?(_.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function S(){var e=this;te(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n),e.read())})}function C(e,t){return this instanceof C?(v.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function w(){var e=this;te(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function T(t,n){return new e.ReadStream(t,n)}function E(t,n){return new e.WriteStream(t,n)}var ee=e.open;e.open=te;function te(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return ee(e,t,n,function(o,s){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}return e}function m(e){f(`ENQUEUE`,e[0].name,e[1]),r[c].push(e),_()}var h;function g(){for(var e=Date.now(),t=0;t<r[c].length;++t)r[c][t].length>2&&(r[c][t][3]=e,r[c][t][4]=e);_()}function _(){if(clearTimeout(h),h=void 0,r[c].length!==0){var e=r[c].shift(),t=e[0],n=e[1],i=e[2],a=e[3],o=e[4];if(a===void 0)f(`RETRY`,t.name,n),t.apply(null,n);else if(Date.now()-a>=6e4){f(`TIMEOUT`,t.name,n);var s=n.pop();typeof s==`function`&&s.call(null,i)}else{var l=Date.now()-o,u=Math.max(o-a,1);l>=Math.min(u*1.2,100)?(f(`RETRY`,t.name,n),t.apply(null,n.concat([a]))):r[c].push(e)}h===void 0&&(h=setTimeout(_,0))}}})),k=n((e=>{let t=O().fromCallback,n=je(),r=`access.appendFile.chmod.chown.close.copyFile.cp.fchmod.fchown.fdatasync.fstat.fsync.ftruncate.futimes.glob.lchmod.lchown.lutimes.link.lstat.mkdir.mkdtemp.open.opendir.readdir.readFile.readlink.realpath.rename.rm.rmdir.stat.statfs.symlink.truncate.unlink.utimes.writeFile`.split(`.`).filter(e=>typeof n[e]==`function`);Object.assign(e,n),r.forEach(r=>{e[r]=t(n[r])}),e.exists=function(e,t){return typeof t==`function`?n.exists(e,t):new Promise(t=>n.exists(e,t))},e.read=function(e,t,r,i,a,o){return typeof o==`function`?n.read(e,t,r,i,a,o):new Promise((o,s)=>{n.read(e,t,r,i,a,(e,t,n)=>{if(e)return s(e);o({bytesRead:t,buffer:n})})})},e.write=function(e,t,...r){return typeof r[r.length-1]==`function`?n.write(e,t,...r):new Promise((i,a)=>{n.write(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffer:n})})})},e.readv=function(e,t,...r){return typeof r[r.length-1]==`function`?n.readv(e,t,...r):new Promise((i,a)=>{n.readv(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesRead:t,buffers:n})})})},e.writev=function(e,t,...r){return typeof r[r.length-1]==`function`?n.writev(e,t,...r):new Promise((i,a)=>{n.writev(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffers:n})})})},typeof n.realpath.native==`function`?e.realpath.native=t(n.realpath.native):process.emitWarning(`fs.realpath.native is not a function. Is fs being monkey-patched?`,`Warning`,`fs-extra-WARN0003`)})),Me=n(((t,n)=>{let r=e(`path`);n.exports.checkPath=function(e){if(process.platform===`win32`&&/[<>:"|?*]/.test(e.replace(r.parse(e).root,``))){let t=Error(`Path contains invalid characters: ${e}`);throw t.code=`EINVAL`,t}}})),Ne=n(((e,t)=>{let n=k(),{checkPath:r}=Me(),i=e=>typeof e==`number`?e:{mode:511,...e}.mode;t.exports.makeDir=async(e,t)=>(r(e),n.mkdir(e,{mode:i(t),recursive:!0})),t.exports.makeDirSync=(e,t)=>(r(e),n.mkdirSync(e,{mode:i(t),recursive:!0}))})),A=n(((e,t)=>{let n=O().fromPromise,{makeDir:r,makeDirSync:i}=Ne(),a=n(r);t.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}})),Pe=n(((e,t)=>{let n=O().fromPromise,r=k();function i(e){return r.access(e).then(()=>!0).catch(()=>!1)}t.exports={pathExists:n(i),pathExistsSync:r.existsSync}})),Fe=n(((e,t)=>{let n=k(),r=O().fromPromise;async function i(e,t,r){let i=await n.open(e,`r+`),a=null;try{await n.futimes(i,t,r)}finally{try{await n.close(i)}catch(e){a=e}}if(a)throw a}function a(e,t,r){let i=n.openSync(e,`r+`);return n.futimesSync(i,t,r),n.closeSync(i)}t.exports={utimesMillis:r(i),utimesMillisSync:a}})),Ie=n(((t,n)=>{let r=k(),i=e(`path`),a=O().fromPromise;function o(e,t,n){let i=n.dereference?e=>r.stat(e,{bigint:!0}):e=>r.lstat(e,{bigint:!0});return Promise.all([i(e),i(t).catch(e=>{if(e.code===`ENOENT`)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}function s(e,t,n){let i,a=n.dereference?e=>r.statSync(e,{bigint:!0}):e=>r.lstatSync(e,{bigint:!0}),o=a(e);try{i=a(t)}catch(e){if(e.code===`ENOENT`)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:i}}async function c(e,t,n,r){let{srcStat:a,destStat:s}=await o(e,t,r);if(s){if(f(a,s)){let r=i.basename(e),o=i.basename(t);if(n===`move`&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:a,destStat:s,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!s.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&s.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&p(e,t))throw Error(m(e,t,n));return{srcStat:a,destStat:s}}function l(e,t,n,r){let{srcStat:a,destStat:o}=s(e,t,r);if(o){if(f(a,o)){let r=i.basename(e),s=i.basename(t);if(n===`move`&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:a,destStat:o,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!o.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&o.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&p(e,t))throw Error(m(e,t,n));return{srcStat:a,destStat:o}}async function u(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=await r.stat(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(f(t,c))throw Error(m(e,n,a));return u(e,t,s,a)}function d(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=r.statSync(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(f(t,c))throw Error(m(e,n,a));return d(e,t,s,a)}function f(e,t){return t.ino!==void 0&&t.dev!==void 0&&t.ino===e.ino&&t.dev===e.dev}function p(e,t){let n=i.resolve(e).split(i.sep).filter(e=>e),r=i.resolve(t).split(i.sep).filter(e=>e);return n.every((e,t)=>r[t]===e)}function m(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}n.exports={checkPaths:a(c),checkPathsSync:l,checkParentPaths:a(u),checkParentPathsSync:d,isSrcSubdir:p,areIdentical:f}})),Le=n(((e,t)=>{async function n(e,t){let n=[];for await(let r of e)n.push(t(r).then(()=>null,e=>e??Error(`unknown error`)));await Promise.all(n.map(e=>e.then(e=>{if(e!==null)throw e})))}t.exports={asyncIteratorConcurrentProcess:n}})),Re=n(((t,n)=>{let r=k(),i=e(`path`),{mkdirs:a}=A(),{pathExists:o}=Pe(),{utimesMillis:s}=Fe(),c=Ie(),{asyncIteratorConcurrentProcess:l}=Le();async function u(e,t,n={}){typeof n==`function`&&(n={filter:n}),n.clobber=`clobber`in n?!!n.clobber:!0,n.overwrite=`overwrite`in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
3
3
|
|
|
4
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0001`);let{srcStat:r,destStat:s}=await c.checkPaths(e,t,`copy`,n);if(await c.checkParentPaths(e,r,t,`copy`),!await d(e,t,n))return;let l=i.dirname(t);await o(l)||await a(l),await f(s,e,t,n)}async function d(e,t,n){return n.filter?n.filter(e,t):!0}async function f(e,t,n,i){let a=await(i.dereference?r.stat:r.lstat)(t);if(a.isDirectory())return _(a,e,t,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return p(a,e,t,n,i);if(a.isSymbolicLink())return v(e,t,n,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}async function p(e,t,n,i,a){if(!t)return m(e,n,i,a);if(a.overwrite)return await r.unlink(i),m(e,n,i,a);if(a.errorOnExist)throw Error(`'${i}' already exists`)}async function m(e,t,n,i){if(await r.copyFile(t,n),i.preserveTimestamps){h(e.mode)&&await g(n,e.mode);let i=await r.stat(t);await s(n,i.atime,i.mtime)}return r.chmod(n,e.mode)}function h(e){return(e&128)==0}function g(e,t){return r.chmod(e,t|128)}async function _(e,t,n,a,o){t||await r.mkdir(a),await l(await r.opendir(n),async e=>{let t=i.join(n,e.name),r=i.join(a,e.name);if(await d(t,r,o)){let{destStat:e}=await c.checkPaths(t,r,`copy`,o);await f(e,t,r,o)}}),t||await r.chmod(a,e.mode)}async function v(e,t,n,a){let o=await r.readlink(t);if(a.dereference&&(o=i.resolve(process.cwd(),o)),!e)return r.symlink(o,n);let s=null;try{s=await r.readlink(n)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return r.symlink(o,n);throw e}if(a.dereference&&(s=i.resolve(process.cwd(),s)),c.isSrcSubdir(o,s))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(c.isSrcSubdir(s,o))throw Error(`Cannot overwrite '${s}' with '${o}'.`);return await r.unlink(n),r.symlink(o,n)}n.exports=u})),
|
|
4
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0001`);let{srcStat:r,destStat:s}=await c.checkPaths(e,t,`copy`,n);if(await c.checkParentPaths(e,r,t,`copy`),!await d(e,t,n))return;let l=i.dirname(t);await o(l)||await a(l),await f(s,e,t,n)}async function d(e,t,n){return n.filter?n.filter(e,t):!0}async function f(e,t,n,i){let a=await(i.dereference?r.stat:r.lstat)(t);if(a.isDirectory())return _(a,e,t,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return p(a,e,t,n,i);if(a.isSymbolicLink())return v(e,t,n,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}async function p(e,t,n,i,a){if(!t)return m(e,n,i,a);if(a.overwrite)return await r.unlink(i),m(e,n,i,a);if(a.errorOnExist)throw Error(`'${i}' already exists`)}async function m(e,t,n,i){if(await r.copyFile(t,n),i.preserveTimestamps){h(e.mode)&&await g(n,e.mode);let i=await r.stat(t);await s(n,i.atime,i.mtime)}return r.chmod(n,e.mode)}function h(e){return(e&128)==0}function g(e,t){return r.chmod(e,t|128)}async function _(e,t,n,a,o){t||await r.mkdir(a),await l(await r.opendir(n),async e=>{let t=i.join(n,e.name),r=i.join(a,e.name);if(await d(t,r,o)){let{destStat:e}=await c.checkPaths(t,r,`copy`,o);await f(e,t,r,o)}}),t||await r.chmod(a,e.mode)}async function v(e,t,n,a){let o=await r.readlink(t);if(a.dereference&&(o=i.resolve(process.cwd(),o)),!e)return r.symlink(o,n);let s=null;try{s=await r.readlink(n)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return r.symlink(o,n);throw e}if(a.dereference&&(s=i.resolve(process.cwd(),s)),c.isSrcSubdir(o,s))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(c.isSrcSubdir(s,o))throw Error(`Cannot overwrite '${s}' with '${o}'.`);return await r.unlink(n),r.symlink(o,n)}n.exports=u})),ze=n(((t,n)=>{let r=je(),i=e(`path`),a=A().mkdirsSync,o=Fe().utimesMillisSync,s=Ie();function c(e,t,n){typeof n==`function`&&(n={filter:n}),n||={},n.clobber=`clobber`in n?!!n.clobber:!0,n.overwrite=`overwrite`in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
5
5
|
|
|
6
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0002`);let{srcStat:o,destStat:c}=s.checkPathsSync(e,t,`copy`,n);if(s.checkParentPathsSync(e,o,t,`copy`),n.filter&&!n.filter(e,t))return;let u=i.dirname(t);return r.existsSync(u)||a(u),l(c,e,t,n)}function l(e,t,n,i){let a=(i.dereference?r.statSync:r.lstatSync)(t);if(a.isDirectory())return v(a,e,t,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return u(a,e,t,n,i);if(a.isSymbolicLink())return S(e,t,n,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}function u(e,t,n,r,i){return t?d(e,n,r,i):f(e,n,r,i)}function d(e,t,n,i){if(i.overwrite)return r.unlinkSync(n),f(e,t,n,i);if(i.errorOnExist)throw Error(`'${n}' already exists`)}function f(e,t,n,i){return r.copyFileSync(t,n),i.preserveTimestamps&&p(e.mode,t,n),g(n,e.mode)}function p(e,t,n){return m(e)&&h(n,e),_(t,n)}function m(e){return(e&128)==0}function h(e,t){return g(e,t|128)}function g(e,t){return r.chmodSync(e,t)}function _(e,t){let n=r.statSync(e);return o(t,n.atime,n.mtime)}function v(e,t,n,r,i){return t?b(n,r,i):y(e.mode,n,r,i)}function y(e,t,n,i){return r.mkdirSync(n),b(t,n,i),g(n,e)}function b(e,t,n){let i=r.opendirSync(e);try{let r;for(;(r=i.readSync())!==null;)x(r.name,e,t,n)}finally{i.closeSync()}}function x(e,t,n,r){let a=i.join(t,e),o=i.join(n,e);if(r.filter&&!r.filter(a,o))return;let{destStat:c}=s.checkPathsSync(a,o,`copy`,r);return l(c,a,o,r)}function S(e,t,n,a){let o=r.readlinkSync(t);if(a.dereference&&(o=i.resolve(process.cwd(),o)),e){let e;try{e=r.readlinkSync(n)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return r.symlinkSync(o,n);throw e}if(a.dereference&&(e=i.resolve(process.cwd(),e)),s.isSrcSubdir(o,e))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${e}'.`);if(s.isSrcSubdir(e,o))throw Error(`Cannot overwrite '${e}' with '${o}'.`);return C(o,n)}else return r.symlinkSync(o,n)}function C(e,t){return r.unlinkSync(t),r.symlinkSync(e,t)}n.exports=c})),
|
|
7
|
-
`,finalEOL:n=!0,replacer:r=null,spaces:i}={}){let a=n?t:``;return JSON.stringify(e,r,i).replace(/\n/g,t)+a}function r(e){return Buffer.isBuffer(e)&&(e=e.toString(`utf8`)),e.replace(/^\uFEFF/,``)}t.exports={stringify:n,stripBom:r}})),
|
|
6
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0002`);let{srcStat:o,destStat:c}=s.checkPathsSync(e,t,`copy`,n);if(s.checkParentPathsSync(e,o,t,`copy`),n.filter&&!n.filter(e,t))return;let u=i.dirname(t);return r.existsSync(u)||a(u),l(c,e,t,n)}function l(e,t,n,i){let a=(i.dereference?r.statSync:r.lstatSync)(t);if(a.isDirectory())return v(a,e,t,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return u(a,e,t,n,i);if(a.isSymbolicLink())return S(e,t,n,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}function u(e,t,n,r,i){return t?d(e,n,r,i):f(e,n,r,i)}function d(e,t,n,i){if(i.overwrite)return r.unlinkSync(n),f(e,t,n,i);if(i.errorOnExist)throw Error(`'${n}' already exists`)}function f(e,t,n,i){return r.copyFileSync(t,n),i.preserveTimestamps&&p(e.mode,t,n),g(n,e.mode)}function p(e,t,n){return m(e)&&h(n,e),_(t,n)}function m(e){return(e&128)==0}function h(e,t){return g(e,t|128)}function g(e,t){return r.chmodSync(e,t)}function _(e,t){let n=r.statSync(e);return o(t,n.atime,n.mtime)}function v(e,t,n,r,i){return t?b(n,r,i):y(e.mode,n,r,i)}function y(e,t,n,i){return r.mkdirSync(n),b(t,n,i),g(n,e)}function b(e,t,n){let i=r.opendirSync(e);try{let r;for(;(r=i.readSync())!==null;)x(r.name,e,t,n)}finally{i.closeSync()}}function x(e,t,n,r){let a=i.join(t,e),o=i.join(n,e);if(r.filter&&!r.filter(a,o))return;let{destStat:c}=s.checkPathsSync(a,o,`copy`,r);return l(c,a,o,r)}function S(e,t,n,a){let o=r.readlinkSync(t);if(a.dereference&&(o=i.resolve(process.cwd(),o)),e){let e;try{e=r.readlinkSync(n)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return r.symlinkSync(o,n);throw e}if(a.dereference&&(e=i.resolve(process.cwd(),e)),s.isSrcSubdir(o,e))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${e}'.`);if(s.isSrcSubdir(e,o))throw Error(`Cannot overwrite '${e}' with '${o}'.`);return C(o,n)}else return r.symlinkSync(o,n)}function C(e,t){return r.unlinkSync(t),r.symlinkSync(e,t)}n.exports=c})),Be=n(((e,t)=>{let n=O().fromPromise;t.exports={copy:n(Re()),copySync:ze()}})),Ve=n(((e,t)=>{let n=je(),r=O().fromCallback;function i(e,t){n.rm(e,{recursive:!0,force:!0},t)}function a(e){n.rmSync(e,{recursive:!0,force:!0})}t.exports={remove:r(i),removeSync:a}})),He=n(((t,n)=>{let r=O().fromPromise,i=k(),a=e(`path`),o=A(),s=Ve(),c=r(async function(e){let t;try{t=await i.readdir(e)}catch{return o.mkdirs(e)}return Promise.all(t.map(t=>s.remove(a.join(e,t))))});function l(e){let t;try{t=i.readdirSync(e)}catch{return o.mkdirsSync(e)}t.forEach(t=>{t=a.join(e,t),s.removeSync(t)})}n.exports={emptyDirSync:l,emptydirSync:l,emptyDir:c,emptydir:c}})),Ue=n(((t,n)=>{let r=O().fromPromise,i=e(`path`),a=k(),o=A();async function s(e){let t;try{t=await a.stat(e)}catch{}if(t&&t.isFile())return;let n=i.dirname(e),r=null;try{r=await a.stat(n)}catch(t){if(t.code===`ENOENT`){await o.mkdirs(n),await a.writeFile(e,``);return}else throw t}r.isDirectory()?await a.writeFile(e,``):await a.readdir(n)}function c(e){let t;try{t=a.statSync(e)}catch{}if(t&&t.isFile())return;let n=i.dirname(e);try{a.statSync(n).isDirectory()||a.readdirSync(n)}catch(e){if(e&&e.code===`ENOENT`)o.mkdirsSync(n);else throw e}a.writeFileSync(e,``)}n.exports={createFile:r(s),createFileSync:c}})),We=n(((t,n)=>{let r=O().fromPromise,i=e(`path`),a=k(),o=A(),{pathExists:s}=Pe(),{areIdentical:c}=Ie();async function l(e,t){let n;try{n=await a.lstat(t)}catch{}let r;try{r=await a.lstat(e)}catch(e){throw e.message=e.message.replace(`lstat`,`ensureLink`),e}if(n&&c(r,n))return;let l=i.dirname(t);await s(l)||await o.mkdirs(l),await a.link(e,t)}function u(e,t){let n;try{n=a.lstatSync(t)}catch{}try{let t=a.lstatSync(e);if(n&&c(t,n))return}catch(e){throw e.message=e.message.replace(`lstat`,`ensureLink`),e}let r=i.dirname(t);return a.existsSync(r)||o.mkdirsSync(r),a.linkSync(e,t)}n.exports={createLink:r(l),createLinkSync:u}})),Ge=n(((t,n)=>{let r=e(`path`),i=k(),{pathExists:a}=Pe(),o=O().fromPromise;async function s(e,t){if(r.isAbsolute(e)){try{await i.lstat(e)}catch(e){throw e.message=e.message.replace(`lstat`,`ensureSymlink`),e}return{toCwd:e,toDst:e}}let n=r.dirname(t),o=r.join(n,e);if(await a(o))return{toCwd:o,toDst:e};try{await i.lstat(e)}catch(e){throw e.message=e.message.replace(`lstat`,`ensureSymlink`),e}return{toCwd:e,toDst:r.relative(n,e)}}function c(e,t){if(r.isAbsolute(e)){if(!i.existsSync(e))throw Error(`absolute srcpath does not exist`);return{toCwd:e,toDst:e}}let n=r.dirname(t),a=r.join(n,e);if(i.existsSync(a))return{toCwd:a,toDst:e};if(!i.existsSync(e))throw Error(`relative srcpath does not exist`);return{toCwd:e,toDst:r.relative(n,e)}}n.exports={symlinkPaths:o(s),symlinkPathsSync:c}})),Ke=n(((e,t)=>{let n=k(),r=O().fromPromise;async function i(e,t){if(t)return t;let r;try{r=await n.lstat(e)}catch{return`file`}return r&&r.isDirectory()?`dir`:`file`}function a(e,t){if(t)return t;let r;try{r=n.lstatSync(e)}catch{return`file`}return r&&r.isDirectory()?`dir`:`file`}t.exports={symlinkType:r(i),symlinkTypeSync:a}})),qe=n(((t,n)=>{let r=O().fromPromise,i=e(`path`),a=k(),{mkdirs:o,mkdirsSync:s}=A(),{symlinkPaths:c,symlinkPathsSync:l}=Ge(),{symlinkType:u,symlinkTypeSync:d}=Ke(),{pathExists:f}=Pe(),{areIdentical:p}=Ie();async function m(e,t,n){let r;try{r=await a.lstat(t)}catch{}if(r&&r.isSymbolicLink()){let[n,r]=await Promise.all([a.stat(e),a.stat(t)]);if(p(n,r))return}let s=await c(e,t);e=s.toDst;let l=await u(s.toCwd,n),d=i.dirname(t);return await f(d)||await o(d),a.symlink(e,t,l)}function h(e,t,n){let r;try{r=a.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()&&p(a.statSync(e),a.statSync(t)))return;let o=l(e,t);e=o.toDst,n=d(o.toCwd,n);let c=i.dirname(t);return a.existsSync(c)||s(c),a.symlinkSync(e,t,n)}n.exports={createSymlink:r(m),createSymlinkSync:h}})),Je=n(((e,t)=>{let{createFile:n,createFileSync:r}=Ue(),{createLink:i,createLinkSync:a}=We(),{createSymlink:o,createSymlinkSync:s}=qe();t.exports={createFile:n,createFileSync:r,ensureFile:n,ensureFileSync:r,createLink:i,createLinkSync:a,ensureLink:i,ensureLinkSync:a,createSymlink:o,createSymlinkSync:s,ensureSymlink:o,ensureSymlinkSync:s}})),Ye=n(((e,t)=>{function n(e,{EOL:t=`
|
|
7
|
+
`,finalEOL:n=!0,replacer:r=null,spaces:i}={}){let a=n?t:``;return JSON.stringify(e,r,i).replace(/\n/g,t)+a}function r(e){return Buffer.isBuffer(e)&&(e=e.toString(`utf8`)),e.replace(/^\uFEFF/,``)}t.exports={stringify:n,stripBom:r}})),Xe=n(((t,n)=>{let r;try{r=je()}catch{r=e(`fs`)}let i=O(),{stringify:a,stripBom:o}=Ye();async function s(e,t={}){typeof t==`string`&&(t={encoding:t});let n=t.fs||r,a=`throws`in t?t.throws:!0,s=await i.fromCallback(n.readFile)(e,t);s=o(s);let c;try{c=JSON.parse(s,t?t.reviver:null)}catch(t){if(a)throw t.message=`${e}: ${t.message}`,t;return null}return c}let c=i.fromPromise(s);function l(e,t={}){typeof t==`string`&&(t={encoding:t});let n=t.fs||r,i=`throws`in t?t.throws:!0;try{let r=n.readFileSync(e,t);return r=o(r),JSON.parse(r,t.reviver)}catch(t){if(i)throw t.message=`${e}: ${t.message}`,t;return null}}async function u(e,t,n={}){let o=n.fs||r,s=a(t,n);await i.fromCallback(o.writeFile)(e,s,n)}let d=i.fromPromise(u);function f(e,t,n={}){let i=n.fs||r,o=a(t,n);return i.writeFileSync(e,o,n)}n.exports={readFile:c,readFileSync:l,writeFile:d,writeFileSync:f}})),Ze=n(((e,t)=>{let n=Xe();t.exports={readJson:n.readFile,readJsonSync:n.readFileSync,writeJson:n.writeFile,writeJsonSync:n.writeFileSync}})),Qe=n(((t,n)=>{let r=O().fromPromise,i=k(),a=e(`path`),o=A(),s=Pe().pathExists;async function c(e,t,n=`utf-8`){let r=a.dirname(e);return await s(r)||await o.mkdirs(r),i.writeFile(e,t,n)}function l(e,...t){let n=a.dirname(e);i.existsSync(n)||o.mkdirsSync(n),i.writeFileSync(e,...t)}n.exports={outputFile:r(c),outputFileSync:l}})),$e=n(((e,t)=>{let{stringify:n}=Ye(),{outputFile:r}=Qe();async function i(e,t,i={}){await r(e,n(t,i),i)}t.exports=i})),et=n(((e,t)=>{let{stringify:n}=Ye(),{outputFileSync:r}=Qe();function i(e,t,i){r(e,n(t,i),i)}t.exports=i})),tt=n(((e,t)=>{let n=O().fromPromise,r=Ze();r.outputJson=n($e()),r.outputJsonSync=et(),r.outputJSON=r.outputJson,r.outputJSONSync=r.outputJsonSync,r.writeJSON=r.writeJson,r.writeJSONSync=r.writeJsonSync,r.readJSON=r.readJson,r.readJSONSync=r.readJsonSync,t.exports=r})),nt=n(((t,n)=>{let r=k(),i=e(`path`),{copy:a}=Be(),{remove:o}=Ve(),{mkdirp:s}=A(),{pathExists:c}=Pe(),l=Ie();async function u(e,t,n={}){let r=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:o=!1}=await l.checkPaths(e,t,`move`,n);await l.checkParentPaths(e,a,t,`move`);let c=i.dirname(t);return i.parse(c).root!==c&&await s(c),d(e,t,r,o)}async function d(e,t,n,i){if(!i){if(n)await o(t);else if(await c(t))throw Error(`dest already exists.`)}try{await r.rename(e,t)}catch(r){if(r.code!==`EXDEV`)throw r;await f(e,t,n)}}async function f(e,t,n){return await a(e,t,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),o(e)}n.exports=u})),rt=n(((t,n)=>{let r=je(),i=e(`path`),a=Be().copySync,o=Ve().removeSync,s=A().mkdirpSync,c=Ie();function l(e,t,n){n||={};let r=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:o=!1}=c.checkPathsSync(e,t,`move`,n);return c.checkParentPathsSync(e,a,t,`move`),u(t)||s(i.dirname(t)),d(e,t,r,o)}function u(e){let t=i.dirname(e);return i.parse(t).root===t}function d(e,t,n,i){if(i)return f(e,t,n);if(n)return o(t),f(e,t,n);if(r.existsSync(t))throw Error(`dest already exists.`);return f(e,t,n)}function f(e,t,n){try{r.renameSync(e,t)}catch(r){if(r.code!==`EXDEV`)throw r;return p(e,t,n)}}function p(e,t,n){return a(e,t,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),o(e)}n.exports=l})),it=n(((e,t)=>{let n=O().fromPromise;t.exports={move:n(nt()),moveSync:rt()}})),at=t(n(((e,t)=>{t.exports={...k(),...Be(),...He(),...Je(),...tt(),...A(),...it(),...Qe(),...Pe(),...Ve()}}))(),1);const ot=(e=0)=>t=>`\u001B[${t+e}m`,st=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,ct=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,j={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(j.modifier);const lt=Object.keys(j.color),ut=Object.keys(j.bgColor);[...lt,...ut];function dt(){let e=new Map;for(let[t,n]of Object.entries(j)){for(let[t,r]of Object.entries(n))j[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=j[t],e.set(r[0],r[1]);Object.defineProperty(j,t,{value:n,enumerable:!1})}return Object.defineProperty(j,`codes`,{value:e,enumerable:!1}),j.color.close=`\x1B[39m`,j.bgColor.close=`\x1B[49m`,j.color.ansi=ot(),j.color.ansi256=st(),j.color.ansi16m=ct(),j.bgColor.ansi=ot(10),j.bgColor.ansi256=st(10),j.bgColor.ansi16m=ct(10),Object.defineProperties(j,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>j.rgbToAnsi256(...j.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>j.ansi256ToAnsi(j.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>j.ansi256ToAnsi(j.hexToAnsi256(e)),enumerable:!1}}),j}var M=dt();function N(e,t=globalThis.Deno?globalThis.Deno.args:u.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:P}=u;let ft;N(`no-color`)||N(`no-colors`)||N(`color=false`)||N(`color=never`)?ft=0:(N(`color`)||N(`colors`)||N(`color=true`)||N(`color=always`))&&(ft=1);function pt(){if(`FORCE_COLOR`in P)return P.FORCE_COLOR===`true`?1:P.FORCE_COLOR===`false`?0:P.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(P.FORCE_COLOR,10),3)}function mt(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ht(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=pt();r!==void 0&&(ft=r);let i=n?ft:r;if(i===0)return 0;if(n){if(N(`color=16m`)||N(`color=full`)||N(`color=truecolor`))return 3;if(N(`color=256`))return 2}if(`TF_BUILD`in P&&`AGENT_NAME`in P)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(P.TERM===`dumb`)return a;if(u.platform===`win32`){let e=h.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in P)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in P)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in P)||P.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in P)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(P.TEAMCITY_VERSION)?1:0;if(P.COLORTERM===`truecolor`||P.TERM===`xterm-kitty`||P.TERM===`xterm-ghostty`||P.TERM===`wezterm`)return 3;if(`TERM_PROGRAM`in P){let e=Number.parseInt((P.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(P.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(P.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(P.TERM)||`COLORTERM`in P?1:a}function gt(e,t={}){return mt(ht(e,{streamIsTTY:e&&e.isTTY,...t}))}var _t={stdout:gt({isTTY:v.isatty(1)}),stderr:gt({isTTY:v.isatty(2)})};function vt(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function yt(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
|
|
8
8
|
`:`
|
|
9
9
|
`)+n,i=r+1,r=e.indexOf(`
|
|
10
|
-
`,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:
|
|
11
|
-
`);return a!==-1&&(t=
|
|
10
|
+
`,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:bt,stderr:xt}=_t,St=Symbol(`GENERATOR`),Ct=Symbol(`STYLER`),wt=Symbol(`IS_EMPTY`),Tt=[`ansi`,`ansi`,`ansi256`,`ansi16m`],Et=Object.create(null),Dt=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=bt?bt.level:0;e.level=t.level===void 0?n:t.level},Ot=e=>{let t=(...e)=>e.join(` `);return Dt(t,e),Object.setPrototypeOf(t,kt.prototype),t};function kt(e){return Ot(e)}Object.setPrototypeOf(kt.prototype,Function.prototype);for(let[e,t]of Object.entries(M))Et[e]={get(){let n=Nt(this,Mt(t.open,t.close,this[Ct]),this[wt]);return Object.defineProperty(this,e,{value:n}),n}};Et.visible={get(){let e=Nt(this,this[Ct],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const At=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?M[n].ansi16m(...r):t===`ansi256`?M[n].ansi256(M.rgbToAnsi256(...r)):M[n].ansi(M.rgbToAnsi(...r)):e===`hex`?At(`rgb`,t,n,...M.hexToRgb(...r)):M[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){Et[e]={get(){let{level:t}=this;return function(...n){let r=Mt(At(e,Tt[t],`color`,...n),M.color.close,this[Ct]);return Nt(this,r,this[wt])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);Et[t]={get(){let{level:t}=this;return function(...n){let r=Mt(At(e,Tt[t],`bgColor`,...n),M.bgColor.close,this[Ct]);return Nt(this,r,this[wt])}}}}const jt=Object.defineProperties(()=>{},{...Et,level:{enumerable:!0,get(){return this[St].level},set(e){this[St].level=e}}}),Mt=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},Nt=(e,t,n)=>{let r=(...e)=>Pt(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,jt),r[St]=e,r[Ct]=t,r[wt]=n,r},Pt=(e,t)=>{if(e.level<=0||!t)return e[wt]?``:t;let n=e[Ct];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=vt(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
|
|
11
|
+
`);return a!==-1&&(t=yt(t,i,r,a)),r+t+i};Object.defineProperties(kt.prototype,Et);const Ft=kt();kt({level:xt?xt.level:0});var It=Ft;const Lt=r(`${process.cwd()}/`);function Rt(e){return e.startsWith(`file:`)?l(e):e}function zt(e,t=process.cwd()){if(e.startsWith(`~`))return Lt.resolve(e.replace(/^~/,``));let n=Rt(e);return a(n)?n:c(Rt(t),n)}var Bt=class{constructor(){this.action=Promise.resolve()}onDone(e=e=>e){return this.action=this.action.then(e=>(this.temp=e,e)).then(e),this}onFail(e=()=>this.temp){return this.action=this.action.then(e=>(this.temp=e,e)).catch(e),this}then(e){return this.action.then(e)}catch(e){return this.action.catch(e)}finally(e){return this.action.finally(e)}};const Vt=new class{okay(...e){console.log(It.green(`✔`),...e)}fail(...e){console.log(It.red(`✘`),...e)}};function Ht({read:e,write:t}){return class extends Bt{constructor(e){super(),e&&(this.root=e)}config(e){return e!==void 0&&(this.option=e),this}source(t,n=this.root){if(!t)throw Error(`path cannot be empty`);return this.action=this.action.then(()=>{this.source=zt(t,n)}).then(()=>e(this.source)),this}output(e,n=this.root){return this.action=this.action.then(r=>{let i=zt(e===void 0?this.source:e,n);if(!i)throw Error(`path cannot be empty`);return this.source=i,t(i,r,this.option).then(()=>r)}),this}logger(...e){if(e.length===0)throw Error(`message cannot be empty`);return this.action=this.action.then(t=>(Vt.okay(...e),t),t=>{throw Vt.fail(...e),t}),this}}}const{readFile:Ut,readJson:Wt,outputFile:Gt,outputJson:Kt}=at.default,qt={spaces:2,replacer:null};function Jt(e){return Ut(e,{encoding:`utf8`})}function Yt(e,t){return Gt(e,t,{encoding:`utf8`})}function Xt(e,t,{pretty:n=!1}={}){return Kt(e,t,n?qt:void 0)}const F=Ht({read:Jt,write:Yt}),Zt=Ht({read:Wt,write:Xt});Ht({read:Jt,write:Xt}),Ht({read:Wt,write:Yt});const{cyan:Qt,red:$t,green:en}=It;var tn=`# Created by nice-move
|
|
12
12
|
root = true
|
|
13
13
|
|
|
14
14
|
[*]
|
|
@@ -21,16 +21,16 @@ max_line_length = 80
|
|
|
21
21
|
quote_type = single
|
|
22
22
|
tab_width = 2
|
|
23
23
|
trim_trailing_whitespace = true
|
|
24
|
-
`;function tn(){return new I().onDone(()=>en).output(`.editorconfig`).logger(`Create/Overwrite`,Zt(`.editorconfig`)).catch(console.warn)}const nn=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!rn(i,a)&&r||Object.defineProperty(e,n,a)},rn=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},an=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},on=(e,t)=>`/* Wrapped ${e}*/\n${t}`,sn=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),cn=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),ln=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=on.bind(null,r,t.toString());Object.defineProperty(i,`name`,cn);let{writable:a,enumerable:o,configurable:s}=sn;Object.defineProperty(e,`toString`,{value:i,writable:a,enumerable:o,configurable:s})};function un(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))nn(e,t,r,n);return an(e,t),ln(e,t,r),e}const dn=new WeakMap,fn=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let n,r=0,i=e.displayName||e.name||`<anonymous>`,a=function(...o){if(dn.set(a,++r),r===1)n=e.apply(this,o),e=void 0;else if(t.throw===!0)throw Error(`Function \`${i}\` can only be called once`);return n};return un(a,e),dn.set(a,r),a};fn.callCount=e=>{if(!dn.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return dn.get(e)};var pn=fn;const mn=[];mn.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&mn.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&mn.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const hn=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,gn=Symbol.for(`signal-exit emitter`),_n=globalThis,vn=Object.defineProperty.bind(Object);var yn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(_n[gn])return _n[gn];vn(_n,gn,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},bn=class{};const xn=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var Sn=class extends bn{onExit(){return()=>{}}load(){}unload(){}},Cn=class extends bn{#e=wn.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new yn;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of mn)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!hn(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of mn)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,mn.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return hn(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&hn(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}else return n.call(this.#n,e,...t)}};const wn=globalThis.process,{onExit:Tn,load:En,unload:Dn}=xn(hn(wn)?new Cn(wn):new Sn),On=u.stderr.isTTY?u.stderr:u.stdout.isTTY?u.stdout:void 0;var kn=On?pn(()=>{Tn(()=>{On.write(`\x1B[?25h`)},{alwaysLast:!0})}):()=>{};let An=!1;const jn={};jn.show=(e=u.stderr)=>{e.isTTY&&(An=!1,e.write(`\x1B[?25h`))},jn.hide=(e=u.stderr)=>{e.isTTY&&(kn(),An=!0,e.write(`\x1B[?25l`))},jn.toggle=(e,t)=>{e!==void 0&&(An=e),An?jn.show(t):jn.hide(t)};var Mn=jn,Nn={dots:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`]},dots2:{interval:80,frames:[`⣾`,`⣽`,`⣻`,`⢿`,`⡿`,`⣟`,`⣯`,`⣷`]},dots3:{interval:80,frames:[`⠋`,`⠙`,`⠚`,`⠞`,`⠖`,`⠦`,`⠴`,`⠲`,`⠳`,`⠓`]},dots4:{interval:80,frames:[`⠄`,`⠆`,`⠇`,`⠋`,`⠙`,`⠸`,`⠰`,`⠠`,`⠰`,`⠸`,`⠙`,`⠋`,`⠇`,`⠆`]},dots5:{interval:80,frames:[`⠋`,`⠙`,`⠚`,`⠒`,`⠂`,`⠂`,`⠒`,`⠲`,`⠴`,`⠦`,`⠖`,`⠒`,`⠐`,`⠐`,`⠒`,`⠓`,`⠋`]},dots6:{interval:80,frames:[`⠁`,`⠉`,`⠙`,`⠚`,`⠒`,`⠂`,`⠂`,`⠒`,`⠲`,`⠴`,`⠤`,`⠄`,`⠄`,`⠤`,`⠴`,`⠲`,`⠒`,`⠂`,`⠂`,`⠒`,`⠚`,`⠙`,`⠉`,`⠁`]},dots7:{interval:80,frames:[`⠈`,`⠉`,`⠋`,`⠓`,`⠒`,`⠐`,`⠐`,`⠒`,`⠖`,`⠦`,`⠤`,`⠠`,`⠠`,`⠤`,`⠦`,`⠖`,`⠒`,`⠐`,`⠐`,`⠒`,`⠓`,`⠋`,`⠉`,`⠈`]},dots8:{interval:80,frames:`⠁.⠁.⠉.⠙.⠚.⠒.⠂.⠂.⠒.⠲.⠴.⠤.⠄.⠄.⠤.⠠.⠠.⠤.⠦.⠖.⠒.⠐.⠐.⠒.⠓.⠋.⠉.⠈.⠈`.split(`.`)},dots9:{interval:80,frames:[`⢹`,`⢺`,`⢼`,`⣸`,`⣇`,`⡧`,`⡗`,`⡏`]},dots10:{interval:80,frames:[`⢄`,`⢂`,`⢁`,`⡁`,`⡈`,`⡐`,`⡠`]},dots11:{interval:100,frames:[`⠁`,`⠂`,`⠄`,`⡀`,`⢀`,`⠠`,`⠐`,`⠈`]},dots12:{interval:80,frames:`⢀⠀.⡀⠀.⠄⠀.⢂⠀.⡂⠀.⠅⠀.⢃⠀.⡃⠀.⠍⠀.⢋⠀.⡋⠀.⠍⠁.⢋⠁.⡋⠁.⠍⠉.⠋⠉.⠋⠉.⠉⠙.⠉⠙.⠉⠩.⠈⢙.⠈⡙.⢈⠩.⡀⢙.⠄⡙.⢂⠩.⡂⢘.⠅⡘.⢃⠨.⡃⢐.⠍⡐.⢋⠠.⡋⢀.⠍⡁.⢋⠁.⡋⠁.⠍⠉.⠋⠉.⠋⠉.⠉⠙.⠉⠙.⠉⠩.⠈⢙.⠈⡙.⠈⠩.⠀⢙.⠀⡙.⠀⠩.⠀⢘.⠀⡘.⠀⠨.⠀⢐.⠀⡐.⠀⠠.⠀⢀.⠀⡀`.split(`.`)},dots13:{interval:80,frames:[`⣼`,`⣹`,`⢻`,`⠿`,`⡟`,`⣏`,`⣧`,`⣶`]},dots14:{interval:80,frames:[`⠉⠉`,`⠈⠙`,`⠀⠹`,`⠀⢸`,`⠀⣰`,`⢀⣠`,`⣀⣀`,`⣄⡀`,`⣆⠀`,`⡇⠀`,`⠏⠀`,`⠋⠁`]},dots8Bit:{interval:80,frames:`⠀.⠁.⠂.⠃.⠄.⠅.⠆.⠇.⡀.⡁.⡂.⡃.⡄.⡅.⡆.⡇.⠈.⠉.⠊.⠋.⠌.⠍.⠎.⠏.⡈.⡉.⡊.⡋.⡌.⡍.⡎.⡏.⠐.⠑.⠒.⠓.⠔.⠕.⠖.⠗.⡐.⡑.⡒.⡓.⡔.⡕.⡖.⡗.⠘.⠙.⠚.⠛.⠜.⠝.⠞.⠟.⡘.⡙.⡚.⡛.⡜.⡝.⡞.⡟.⠠.⠡.⠢.⠣.⠤.⠥.⠦.⠧.⡠.⡡.⡢.⡣.⡤.⡥.⡦.⡧.⠨.⠩.⠪.⠫.⠬.⠭.⠮.⠯.⡨.⡩.⡪.⡫.⡬.⡭.⡮.⡯.⠰.⠱.⠲.⠳.⠴.⠵.⠶.⠷.⡰.⡱.⡲.⡳.⡴.⡵.⡶.⡷.⠸.⠹.⠺.⠻.⠼.⠽.⠾.⠿.⡸.⡹.⡺.⡻.⡼.⡽.⡾.⡿.⢀.⢁.⢂.⢃.⢄.⢅.⢆.⢇.⣀.⣁.⣂.⣃.⣄.⣅.⣆.⣇.⢈.⢉.⢊.⢋.⢌.⢍.⢎.⢏.⣈.⣉.⣊.⣋.⣌.⣍.⣎.⣏.⢐.⢑.⢒.⢓.⢔.⢕.⢖.⢗.⣐.⣑.⣒.⣓.⣔.⣕.⣖.⣗.⢘.⢙.⢚.⢛.⢜.⢝.⢞.⢟.⣘.⣙.⣚.⣛.⣜.⣝.⣞.⣟.⢠.⢡.⢢.⢣.⢤.⢥.⢦.⢧.⣠.⣡.⣢.⣣.⣤.⣥.⣦.⣧.⢨.⢩.⢪.⢫.⢬.⢭.⢮.⢯.⣨.⣩.⣪.⣫.⣬.⣭.⣮.⣯.⢰.⢱.⢲.⢳.⢴.⢵.⢶.⢷.⣰.⣱.⣲.⣳.⣴.⣵.⣶.⣷.⢸.⢹.⢺.⢻.⢼.⢽.⢾.⢿.⣸.⣹.⣺.⣻.⣼.⣽.⣾.⣿`.split(`.`)},dotsCircle:{interval:80,frames:[`⢎ `,`⠎⠁`,`⠊⠑`,`⠈⠱`,` ⡱`,`⢀⡰`,`⢄⡠`,`⢆⡀`]},sand:{interval:80,frames:`⠁.⠂.⠄.⡀.⡈.⡐.⡠.⣀.⣁.⣂.⣄.⣌.⣔.⣤.⣥.⣦.⣮.⣶.⣷.⣿.⡿.⠿.⢟.⠟.⡛.⠛.⠫.⢋.⠋.⠍.⡉.⠉.⠑.⠡.⢁`.split(`.`)},line:{interval:130,frames:[`-`,`\\`,`|`,`/`]},line2:{interval:100,frames:[`⠂`,`-`,`–`,`—`,`–`,`-`]},rollingLine:{interval:80,frames:[`/ `,` - `,` \\ `,` |`,` |`,` \\ `,` - `,`/ `]},pipe:{interval:100,frames:[`┤`,`┘`,`┴`,`└`,`├`,`┌`,`┬`,`┐`]},simpleDots:{interval:400,frames:[`. `,`.. `,`...`,` `]},simpleDotsScrolling:{interval:200,frames:[`. `,`.. `,`...`,` ..`,` .`,` `]},star:{interval:70,frames:[`✶`,`✸`,`✹`,`✺`,`✹`,`✷`]},star2:{interval:80,frames:[`+`,`x`,`*`]},flip:{interval:70,frames:[`_`,`_`,`_`,`-`,"`","`",`'`,`´`,`-`,`_`,`_`,`_`]},hamburger:{interval:100,frames:[`☱`,`☲`,`☴`]},growVertical:{interval:120,frames:[`▁`,`▃`,`▄`,`▅`,`▆`,`▇`,`▆`,`▅`,`▄`,`▃`]},growHorizontal:{interval:120,frames:[`▏`,`▎`,`▍`,`▌`,`▋`,`▊`,`▉`,`▊`,`▋`,`▌`,`▍`,`▎`]},balloon:{interval:140,frames:[` `,`.`,`o`,`O`,`@`,`*`,` `]},balloon2:{interval:120,frames:[`.`,`o`,`O`,`°`,`O`,`o`,`.`]},noise:{interval:100,frames:[`▓`,`▒`,`░`]},bounce:{interval:120,frames:[`⠁`,`⠂`,`⠄`,`⠂`]},boxBounce:{interval:120,frames:[`▖`,`▘`,`▝`,`▗`]},boxBounce2:{interval:100,frames:[`▌`,`▀`,`▐`,`▄`]},triangle:{interval:50,frames:[`◢`,`◣`,`◤`,`◥`]},binary:{interval:80,frames:[`010010`,`001100`,`100101`,`111010`,`111101`,`010111`,`101011`,`111000`,`110011`,`110101`]},arc:{interval:100,frames:[`◜`,`◠`,`◝`,`◞`,`◡`,`◟`]},circle:{interval:120,frames:[`◡`,`⊙`,`◠`]},squareCorners:{interval:180,frames:[`◰`,`◳`,`◲`,`◱`]},circleQuarters:{interval:120,frames:[`◴`,`◷`,`◶`,`◵`]},circleHalves:{interval:50,frames:[`◐`,`◓`,`◑`,`◒`]},squish:{interval:100,frames:[`╫`,`╪`]},toggle:{interval:250,frames:[`⊶`,`⊷`]},toggle2:{interval:80,frames:[`▫`,`▪`]},toggle3:{interval:120,frames:[`□`,`■`]},toggle4:{interval:100,frames:[`■`,`□`,`▪`,`▫`]},toggle5:{interval:100,frames:[`▮`,`▯`]},toggle6:{interval:300,frames:[`ဝ`,`၀`]},toggle7:{interval:80,frames:[`⦾`,`⦿`]},toggle8:{interval:100,frames:[`◍`,`◌`]},toggle9:{interval:100,frames:[`◉`,`◎`]},toggle10:{interval:100,frames:[`㊂`,`㊀`,`㊁`]},toggle11:{interval:50,frames:[`⧇`,`⧆`]},toggle12:{interval:120,frames:[`☗`,`☖`]},toggle13:{interval:80,frames:[`=`,`*`,`-`]},arrow:{interval:100,frames:[`←`,`↖`,`↑`,`↗`,`→`,`↘`,`↓`,`↙`]},arrow2:{interval:80,frames:[`⬆️ `,`↗️ `,`➡️ `,`↘️ `,`⬇️ `,`↙️ `,`⬅️ `,`↖️ `]},arrow3:{interval:120,frames:[`▹▹▹▹▹`,`▸▹▹▹▹`,`▹▸▹▹▹`,`▹▹▸▹▹`,`▹▹▹▸▹`,`▹▹▹▹▸`]},bouncingBar:{interval:80,frames:[`[ ]`,`[= ]`,`[== ]`,`[=== ]`,`[====]`,`[ ===]`,`[ ==]`,`[ =]`,`[ ]`,`[ =]`,`[ ==]`,`[ ===]`,`[====]`,`[=== ]`,`[== ]`,`[= ]`]},bouncingBall:{interval:80,frames:[`( ● )`,`( ● )`,`( ● )`,`( ● )`,`( ●)`,`( ● )`,`( ● )`,`( ● )`,`( ● )`,`(● )`]},smiley:{interval:200,frames:[`😄 `,`😝 `]},monkey:{interval:300,frames:[`🙈 `,`🙈 `,`🙉 `,`🙊 `]},hearts:{interval:100,frames:[`💛 `,`💙 `,`💜 `,`💚 `,`💗 `]},clock:{interval:100,frames:[`🕛 `,`🕐 `,`🕑 `,`🕒 `,`🕓 `,`🕔 `,`🕕 `,`🕖 `,`🕗 `,`🕘 `,`🕙 `,`🕚 `]},earth:{interval:180,frames:[`🌍 `,`🌎 `,`🌏 `]},material:{interval:17,frames:`█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁.███████▁▁▁▁▁▁▁▁▁▁▁▁▁.████████▁▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.██████████▁▁▁▁▁▁▁▁▁▁.███████████▁▁▁▁▁▁▁▁▁.█████████████▁▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁▁██████████████▁▁▁▁.▁▁▁██████████████▁▁▁.▁▁▁▁█████████████▁▁▁.▁▁▁▁██████████████▁▁.▁▁▁▁██████████████▁▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁▁██████████████.▁▁▁▁▁▁██████████████.▁▁▁▁▁▁▁█████████████.▁▁▁▁▁▁▁█████████████.▁▁▁▁▁▁▁▁████████████.▁▁▁▁▁▁▁▁████████████.▁▁▁▁▁▁▁▁▁███████████.▁▁▁▁▁▁▁▁▁███████████.▁▁▁▁▁▁▁▁▁▁██████████.▁▁▁▁▁▁▁▁▁▁██████████.▁▁▁▁▁▁▁▁▁▁▁▁████████.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.██████▁▁▁▁▁▁▁▁▁▁▁▁▁█.████████▁▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.███████████▁▁▁▁▁▁▁▁▁.████████████▁▁▁▁▁▁▁▁.████████████▁▁▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁▁▁█████████████▁▁▁▁.▁▁▁▁▁████████████▁▁▁.▁▁▁▁▁████████████▁▁▁.▁▁▁▁▁▁███████████▁▁▁.▁▁▁▁▁▁▁▁█████████▁▁▁.▁▁▁▁▁▁▁▁█████████▁▁▁.▁▁▁▁▁▁▁▁▁█████████▁▁.▁▁▁▁▁▁▁▁▁█████████▁▁.▁▁▁▁▁▁▁▁▁▁█████████▁.▁▁▁▁▁▁▁▁▁▁▁████████▁.▁▁▁▁▁▁▁▁▁▁▁████████▁.▁▁▁▁▁▁▁▁▁▁▁▁███████▁.▁▁▁▁▁▁▁▁▁▁▁▁███████▁.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁`.split(`.`)},moon:{interval:80,frames:[`🌑 `,`🌒 `,`🌓 `,`🌔 `,`🌕 `,`🌖 `,`🌗 `,`🌘 `]},runner:{interval:140,frames:[`🚶 `,`🏃 `]},pong:{interval:80,frames:`▐⠂ ▌.▐⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂▌.▐ ⠠▌.▐ ⡀▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐⠠ ▌`.split(`.`)},shark:{interval:120,frames:`▐|\\____________▌.▐_|\\___________▌.▐__|\\__________▌.▐___|\\_________▌.▐____|\\________▌.▐_____|\\_______▌.▐______|\\______▌.▐_______|\\_____▌.▐________|\\____▌.▐_________|\\___▌.▐__________|\\__▌.▐___________|\\_▌.▐____________|\\▌.▐____________/|▌.▐___________/|_▌.▐__________/|__▌.▐_________/|___▌.▐________/|____▌.▐_______/|_____▌.▐______/|______▌.▐_____/|_______▌.▐____/|________▌.▐___/|_________▌.▐__/|__________▌.▐_/|___________▌.▐/|____________▌`.split(`.`)},dqpb:{interval:100,frames:[`d`,`q`,`p`,`b`]},weather:{interval:100,frames:[`☀️ `,`☀️ `,`☀️ `,`🌤 `,`⛅️ `,`🌥 `,`☁️ `,`🌧 `,`🌨 `,`🌧 `,`🌨 `,`🌧 `,`🌨 `,`⛈ `,`🌨 `,`🌧 `,`🌨 `,`☁️ `,`🌥 `,`⛅️ `,`🌤 `,`☀️ `,`☀️ `]},christmas:{interval:400,frames:[`🌲`,`🎄`]},grenade:{interval:80,frames:[`، `,`′ `,` ´ `,` ‾ `,` ⸌`,` ⸊`,` |`,` ⁎`,` ⁕`,` ෴ `,` ⁓`,` `,` `,` `]},point:{interval:125,frames:[`∙∙∙`,`●∙∙`,`∙●∙`,`∙∙●`,`∙∙∙`]},layer:{interval:150,frames:[`-`,`=`,`≡`]},betaWave:{interval:80,frames:[`ρββββββ`,`βρβββββ`,`ββρββββ`,`βββρβββ`,`ββββρββ`,`βββββρβ`,`ββββββρ`]},fingerDance:{interval:160,frames:[`🤘 `,`🤟 `,`🖖 `,`✋ `,`🤚 `,`👆 `]},fistBump:{interval:80,frames:[`🤜 🤛 `,`🤜 🤛 `,`🤜 🤛 `,` 🤜 🤛 `,` 🤜🤛 `,` 🤜✨🤛 `,`🤜 ✨ 🤛 `]},soccerHeader:{interval:80,frames:[` 🧑⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `]},mindblown:{interval:160,frames:[`😐 `,`😐 `,`😮 `,`😮 `,`😦 `,`😦 `,`😧 `,`😧 `,`🤯 `,`💥 `,`✨ `,` `,` `,` `]},speaker:{interval:160,frames:[`🔈 `,`🔉 `,`🔊 `,`🔉 `]},orangePulse:{interval:100,frames:[`🔸 `,`🔶 `,`🟠 `,`🟠 `,`🔶 `]},bluePulse:{interval:100,frames:[`🔹 `,`🔷 `,`🔵 `,`🔵 `,`🔷 `]},orangeBluePulse:{interval:100,frames:[`🔸 `,`🔶 `,`🟠 `,`🟠 `,`🔶 `,`🔹 `,`🔷 `,`🔵 `,`🔵 `,`🔷 `]},timeTravel:{interval:100,frames:[`🕛 `,`🕚 `,`🕙 `,`🕘 `,`🕗 `,`🕖 `,`🕕 `,`🕔 `,`🕓 `,`🕒 `,`🕑 `,`🕐 `]},aesthetic:{interval:80,frames:[`▰▱▱▱▱▱▱`,`▰▰▱▱▱▱▱`,`▰▰▰▱▱▱▱`,`▰▰▰▰▱▱▱`,`▰▰▰▰▰▱▱`,`▰▰▰▰▰▰▱`,`▰▰▰▰▰▰▰`,`▰▱▱▱▱▱▱`]},dwarfFortress:{interval:80,frames:` ██████£££ .☺██████£££ .☺██████£££ .☺▓█████£££ .☺▓█████£££ .☺▒█████£££ .☺▒█████£££ .☺░█████£££ .☺░█████£££ .☺ █████£££ . ☺█████£££ . ☺█████£££ . ☺▓████£££ . ☺▓████£££ . ☺▒████£££ . ☺▒████£££ . ☺░████£££ . ☺░████£££ . ☺ ████£££ . ☺████£££ . ☺████£££ . ☺▓███£££ . ☺▓███£££ . ☺▒███£££ . ☺▒███£££ . ☺░███£££ . ☺░███£££ . ☺ ███£££ . ☺███£££ . ☺███£££ . ☺▓██£££ . ☺▓██£££ . ☺▒██£££ . ☺▒██£££ . ☺░██£££ . ☺░██£££ . ☺ ██£££ . ☺██£££ . ☺██£££ . ☺▓█£££ . ☺▓█£££ . ☺▒█£££ . ☺▒█£££ . ☺░█£££ . ☺░█£££ . ☺ █£££ . ☺█£££ . ☺█£££ . ☺▓£££ . ☺▓£££ . ☺▒£££ . ☺▒£££ . ☺░£££ . ☺░£££ . ☺ £££ . ☺£££ . ☺£££ . ☺▓££ . ☺▓££ . ☺▒££ . ☺▒££ . ☺░££ . ☺░££ . ☺ ££ . ☺££ . ☺££ . ☺▓£ . ☺▓£ . ☺▒£ . ☺▒£ . ☺░£ . ☺░£ . ☺ £ . ☺£ . ☺£ . ☺▓ . ☺▓ . ☺▒ . ☺▒ . ☺░ . ☺░ . ☺ . ☺ &. ☺ ☼&. ☺ ☼ &. ☺☼ &. ☺☼ & . ‼ & . ☺ & . ‼ & . ☺ & . ‼ & . ☺ & .‼ & . & . & . & ░ . & ▒ . & ▓ . & £ . & ░£ . & ▒£ . & ▓£ . & ££ . & ░££ . & ▒££ .& ▓££ .& £££ . ░£££ . ▒£££ . ▓£££ . █£££ . ░█£££ . ▒█£££ . ▓█£££ . ██£££ . ░██£££ . ▒██£££ . ▓██£££ . ███£££ . ░███£££ . ▒███£££ . ▓███£££ . ████£££ . ░████£££ . ▒████£££ . ▓████£££ . █████£££ . ░█████£££ . ▒█████£££ . ▓█████£££ . ██████£££ . ██████£££ `.split(`.`)}};const Pn=v?.WriteStream?.prototype?.hasColors?.()??!1,L=(e,t)=>{if(!Pn)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}};L(0,0);const Fn=L(1,22);L(2,22),L(3,23),L(4,24),L(53,55),L(7,27),L(8,28),L(9,29),L(30,39);const In=L(31,39),Ln=L(32,39),Rn=L(33,39),zn=L(34,39);L(35,39),L(36,39),L(37,39);const Bn=L(90,39);L(40,49),L(41,49),L(42,49),L(43,49),L(44,49),L(45,49),L(46,49),L(47,49),L(100,49);const Vn=L(91,39);L(92,39);const Hn=L(93,39);L(94,39),L(95,39),L(96,39),L(97,39),L(101,49),L(102,49),L(103,49),L(104,49),L(105,49),L(106,49),L(107,49);function Un(){let{env:e}=u,{TERM:t,TERM_PROGRAM:n}=e;return u.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 Wn=Un(),Gn=zn(Wn?`ℹ`:`i`),Kn=Ln(Wn?`✔`:`√`),qn=Rn(Wn?`⚠`:`‼`),Jn=In(Wn?`✖`:`×`);function Yn({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const Xn=Yn();function Zn(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Xn,``)}function Qn(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function $n(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function er(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function tr(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function nr(e,{ambiguousAsWide:t=!1}={}){return tr(e),$n(e)||er(e)||t&&Qn(e)?2:1}const rr=new Intl.Segmenter,ir=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,ar=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,or=/^\p{RGI_Emoji}$/v;function sr(e){return e.replace(ar,``)}function cr(e){return ir.test(e)}function lr(e,t){let n=0;if(e.length>1)for(let r of e.slice(1))r>=``&&r<=``&&(n+=nr(r.codePointAt(0),t));return n}function ur(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(r||(i=Zn(i)),i.length===0)return 0;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of rr.segment(i)){if(cr(e))continue;if(or.test(e)){a+=2;continue}let t=sr(e).codePointAt(0);a+=nr(t,o),a+=lr(e,o)}return a}function dr({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!==`dumb`&&!(`CI`in process.env))}var fr=new class{#e=0;start(){this.#e++,this.#e===1&&this.#t()}stop(){if(this.#e<=0)throw Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#n()}#t(){u.platform===`win32`||!u.stdin.isTTY||(u.stdin.setRawMode(!0),u.stdin.on(`data`,this.#r),u.stdin.resume())}#n(){u.stdin.isTTY&&(u.stdin.off(`data`,this.#r),u.stdin.pause(),u.stdin.setRawMode(!1))}#r(e){e[0]===3&&u.emit(`SIGINT`)}},pr=class{#e=0;#t=!1;#n=0;#r=-1;#i=0;#a=0;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;color;constructor(e){typeof e==`string`&&(e={text:e}),this.#o={color:`cyan`,stream:u.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#o.color,this.spinner=this.#o.spinner,this.#u=this.#o.interval,this.#c=this.#o.stream,this.#d=typeof this.#o.isEnabled==`boolean`?this.#o.isEnabled:dr({stream:this.#c}),this.#f=typeof this.#o.isSilent==`boolean`?this.#o.isSilent:!1,this.text=this.#o.text,this.prefixText=this.#o.prefixText,this.suffixText=this.#o.suffixText,this.indent=this.#o.indent,u.env.NODE_ENV===`test`&&(this._stream=this.#c,this._isEnabled=this.#d,Object.defineProperty(this,`_linesToClear`,{get(){return this.#e},set(e){this.#e=e}}),Object.defineProperty(this,`_frameIndex`,{get(){return this.#r}}),Object.defineProperty(this,`_lineCount`,{get(){return this.#n}}))}get indent(){return this.#p}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#p=e,this.#x()}get interval(){return this.#u??this.#s.interval??100}get spinner(){return this.#s}set spinner(e){if(this.#r=-1,this.#u=void 0,typeof e==`object`){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(e=>typeof e!=`string`))throw Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#s=e}else if(!Un())this.#s=Nn.line;else if(e===void 0)this.#s=Nn.dots;else if(e!==`default`&&Nn[e])this.#s=Nn[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#m}set text(e=``){this.#m=e,this.#x()}get prefixText(){return this.#h}set prefixText(e=``){this.#h=e,this.#x()}get suffixText(){return this.#g}set suffixText(e=``){this.#g=e,this.#x()}get isSpinning(){return this.#l!==void 0}#_(e,t,n=!1){let r=typeof e==`function`?e():e;return typeof r==`string`&&r!==``?n?t+r:r+t:``}#v(e=this.#h,t=` `){return this.#_(e,t,!1)}#y(e=this.#g,t=` `){return this.#_(e,t,!0)}#b(e,t){let n=0;for(let r of Zn(e).split(`
|
|
25
|
-
`))n+=Math.max(1,Math.ceil(
|
|
24
|
+
`;function nn(){return new F().onDone(()=>tn).output(`.editorconfig`).logger(`Create/Overwrite`,Qt(`.editorconfig`)).catch(console.warn)}const rn=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!an(i,a)&&r||Object.defineProperty(e,n,a)},an=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},on=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},sn=(e,t)=>`/* Wrapped ${e}*/\n${t}`,cn=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),ln=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),un=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=sn.bind(null,r,t.toString());Object.defineProperty(i,`name`,ln);let{writable:a,enumerable:o,configurable:s}=cn;Object.defineProperty(e,`toString`,{value:i,writable:a,enumerable:o,configurable:s})};function dn(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))rn(e,t,r,n);return on(e,t),un(e,t,r),e}const fn=new WeakMap,pn=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let n,r=0,i=e.displayName||e.name||`<anonymous>`,a=function(...o){if(fn.set(a,++r),r===1)n=e.apply(this,o),e=void 0;else if(t.throw===!0)throw Error(`Function \`${i}\` can only be called once`);return n};return dn(a,e),fn.set(a,r),a};pn.callCount=e=>{if(!fn.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return fn.get(e)};var mn=pn;const hn=[];hn.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&hn.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&hn.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const gn=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,_n=Symbol.for(`signal-exit emitter`),vn=globalThis,yn=Object.defineProperty.bind(Object);var bn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(vn[_n])return vn[_n];yn(vn,_n,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},xn=class{};const Sn=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var Cn=class extends xn{onExit(){return()=>{}}load(){}unload(){}},wn=class extends xn{#e=Tn.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new bn;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of hn)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!gn(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of hn)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,hn.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return gn(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&gn(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}else return n.call(this.#n,e,...t)}};const Tn=globalThis.process,{onExit:En,load:Dn,unload:On}=Sn(gn(Tn)?new wn(Tn):new Cn),kn=u.stderr.isTTY?u.stderr:u.stdout.isTTY?u.stdout:void 0;var An=kn?mn(()=>{En(()=>{kn.write(`\x1B[?25h`)},{alwaysLast:!0})}):()=>{};let jn=!1;const Mn={};Mn.show=(e=u.stderr)=>{e.isTTY&&(jn=!1,e.write(`\x1B[?25h`))},Mn.hide=(e=u.stderr)=>{e.isTTY&&(An(),jn=!0,e.write(`\x1B[?25l`))},Mn.toggle=(e,t)=>{e!==void 0&&(jn=e),jn?Mn.show(t):Mn.hide(t)};var Nn=Mn,Pn={dots:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`]},dots2:{interval:80,frames:[`⣾`,`⣽`,`⣻`,`⢿`,`⡿`,`⣟`,`⣯`,`⣷`]},dots3:{interval:80,frames:[`⠋`,`⠙`,`⠚`,`⠞`,`⠖`,`⠦`,`⠴`,`⠲`,`⠳`,`⠓`]},dots4:{interval:80,frames:[`⠄`,`⠆`,`⠇`,`⠋`,`⠙`,`⠸`,`⠰`,`⠠`,`⠰`,`⠸`,`⠙`,`⠋`,`⠇`,`⠆`]},dots5:{interval:80,frames:[`⠋`,`⠙`,`⠚`,`⠒`,`⠂`,`⠂`,`⠒`,`⠲`,`⠴`,`⠦`,`⠖`,`⠒`,`⠐`,`⠐`,`⠒`,`⠓`,`⠋`]},dots6:{interval:80,frames:[`⠁`,`⠉`,`⠙`,`⠚`,`⠒`,`⠂`,`⠂`,`⠒`,`⠲`,`⠴`,`⠤`,`⠄`,`⠄`,`⠤`,`⠴`,`⠲`,`⠒`,`⠂`,`⠂`,`⠒`,`⠚`,`⠙`,`⠉`,`⠁`]},dots7:{interval:80,frames:[`⠈`,`⠉`,`⠋`,`⠓`,`⠒`,`⠐`,`⠐`,`⠒`,`⠖`,`⠦`,`⠤`,`⠠`,`⠠`,`⠤`,`⠦`,`⠖`,`⠒`,`⠐`,`⠐`,`⠒`,`⠓`,`⠋`,`⠉`,`⠈`]},dots8:{interval:80,frames:`⠁.⠁.⠉.⠙.⠚.⠒.⠂.⠂.⠒.⠲.⠴.⠤.⠄.⠄.⠤.⠠.⠠.⠤.⠦.⠖.⠒.⠐.⠐.⠒.⠓.⠋.⠉.⠈.⠈`.split(`.`)},dots9:{interval:80,frames:[`⢹`,`⢺`,`⢼`,`⣸`,`⣇`,`⡧`,`⡗`,`⡏`]},dots10:{interval:80,frames:[`⢄`,`⢂`,`⢁`,`⡁`,`⡈`,`⡐`,`⡠`]},dots11:{interval:100,frames:[`⠁`,`⠂`,`⠄`,`⡀`,`⢀`,`⠠`,`⠐`,`⠈`]},dots12:{interval:80,frames:`⢀⠀.⡀⠀.⠄⠀.⢂⠀.⡂⠀.⠅⠀.⢃⠀.⡃⠀.⠍⠀.⢋⠀.⡋⠀.⠍⠁.⢋⠁.⡋⠁.⠍⠉.⠋⠉.⠋⠉.⠉⠙.⠉⠙.⠉⠩.⠈⢙.⠈⡙.⢈⠩.⡀⢙.⠄⡙.⢂⠩.⡂⢘.⠅⡘.⢃⠨.⡃⢐.⠍⡐.⢋⠠.⡋⢀.⠍⡁.⢋⠁.⡋⠁.⠍⠉.⠋⠉.⠋⠉.⠉⠙.⠉⠙.⠉⠩.⠈⢙.⠈⡙.⠈⠩.⠀⢙.⠀⡙.⠀⠩.⠀⢘.⠀⡘.⠀⠨.⠀⢐.⠀⡐.⠀⠠.⠀⢀.⠀⡀`.split(`.`)},dots13:{interval:80,frames:[`⣼`,`⣹`,`⢻`,`⠿`,`⡟`,`⣏`,`⣧`,`⣶`]},dots14:{interval:80,frames:[`⠉⠉`,`⠈⠙`,`⠀⠹`,`⠀⢸`,`⠀⣰`,`⢀⣠`,`⣀⣀`,`⣄⡀`,`⣆⠀`,`⡇⠀`,`⠏⠀`,`⠋⠁`]},dots8Bit:{interval:80,frames:`⠀.⠁.⠂.⠃.⠄.⠅.⠆.⠇.⡀.⡁.⡂.⡃.⡄.⡅.⡆.⡇.⠈.⠉.⠊.⠋.⠌.⠍.⠎.⠏.⡈.⡉.⡊.⡋.⡌.⡍.⡎.⡏.⠐.⠑.⠒.⠓.⠔.⠕.⠖.⠗.⡐.⡑.⡒.⡓.⡔.⡕.⡖.⡗.⠘.⠙.⠚.⠛.⠜.⠝.⠞.⠟.⡘.⡙.⡚.⡛.⡜.⡝.⡞.⡟.⠠.⠡.⠢.⠣.⠤.⠥.⠦.⠧.⡠.⡡.⡢.⡣.⡤.⡥.⡦.⡧.⠨.⠩.⠪.⠫.⠬.⠭.⠮.⠯.⡨.⡩.⡪.⡫.⡬.⡭.⡮.⡯.⠰.⠱.⠲.⠳.⠴.⠵.⠶.⠷.⡰.⡱.⡲.⡳.⡴.⡵.⡶.⡷.⠸.⠹.⠺.⠻.⠼.⠽.⠾.⠿.⡸.⡹.⡺.⡻.⡼.⡽.⡾.⡿.⢀.⢁.⢂.⢃.⢄.⢅.⢆.⢇.⣀.⣁.⣂.⣃.⣄.⣅.⣆.⣇.⢈.⢉.⢊.⢋.⢌.⢍.⢎.⢏.⣈.⣉.⣊.⣋.⣌.⣍.⣎.⣏.⢐.⢑.⢒.⢓.⢔.⢕.⢖.⢗.⣐.⣑.⣒.⣓.⣔.⣕.⣖.⣗.⢘.⢙.⢚.⢛.⢜.⢝.⢞.⢟.⣘.⣙.⣚.⣛.⣜.⣝.⣞.⣟.⢠.⢡.⢢.⢣.⢤.⢥.⢦.⢧.⣠.⣡.⣢.⣣.⣤.⣥.⣦.⣧.⢨.⢩.⢪.⢫.⢬.⢭.⢮.⢯.⣨.⣩.⣪.⣫.⣬.⣭.⣮.⣯.⢰.⢱.⢲.⢳.⢴.⢵.⢶.⢷.⣰.⣱.⣲.⣳.⣴.⣵.⣶.⣷.⢸.⢹.⢺.⢻.⢼.⢽.⢾.⢿.⣸.⣹.⣺.⣻.⣼.⣽.⣾.⣿`.split(`.`)},dotsCircle:{interval:80,frames:[`⢎ `,`⠎⠁`,`⠊⠑`,`⠈⠱`,` ⡱`,`⢀⡰`,`⢄⡠`,`⢆⡀`]},sand:{interval:80,frames:`⠁.⠂.⠄.⡀.⡈.⡐.⡠.⣀.⣁.⣂.⣄.⣌.⣔.⣤.⣥.⣦.⣮.⣶.⣷.⣿.⡿.⠿.⢟.⠟.⡛.⠛.⠫.⢋.⠋.⠍.⡉.⠉.⠑.⠡.⢁`.split(`.`)},line:{interval:130,frames:[`-`,`\\`,`|`,`/`]},line2:{interval:100,frames:[`⠂`,`-`,`–`,`—`,`–`,`-`]},rollingLine:{interval:80,frames:[`/ `,` - `,` \\ `,` |`,` |`,` \\ `,` - `,`/ `]},pipe:{interval:100,frames:[`┤`,`┘`,`┴`,`└`,`├`,`┌`,`┬`,`┐`]},simpleDots:{interval:400,frames:[`. `,`.. `,`...`,` `]},simpleDotsScrolling:{interval:200,frames:[`. `,`.. `,`...`,` ..`,` .`,` `]},star:{interval:70,frames:[`✶`,`✸`,`✹`,`✺`,`✹`,`✷`]},star2:{interval:80,frames:[`+`,`x`,`*`]},flip:{interval:70,frames:[`_`,`_`,`_`,`-`,"`","`",`'`,`´`,`-`,`_`,`_`,`_`]},hamburger:{interval:100,frames:[`☱`,`☲`,`☴`]},growVertical:{interval:120,frames:[`▁`,`▃`,`▄`,`▅`,`▆`,`▇`,`▆`,`▅`,`▄`,`▃`]},growHorizontal:{interval:120,frames:[`▏`,`▎`,`▍`,`▌`,`▋`,`▊`,`▉`,`▊`,`▋`,`▌`,`▍`,`▎`]},balloon:{interval:140,frames:[` `,`.`,`o`,`O`,`@`,`*`,` `]},balloon2:{interval:120,frames:[`.`,`o`,`O`,`°`,`O`,`o`,`.`]},noise:{interval:100,frames:[`▓`,`▒`,`░`]},bounce:{interval:120,frames:[`⠁`,`⠂`,`⠄`,`⠂`]},boxBounce:{interval:120,frames:[`▖`,`▘`,`▝`,`▗`]},boxBounce2:{interval:100,frames:[`▌`,`▀`,`▐`,`▄`]},triangle:{interval:50,frames:[`◢`,`◣`,`◤`,`◥`]},binary:{interval:80,frames:[`010010`,`001100`,`100101`,`111010`,`111101`,`010111`,`101011`,`111000`,`110011`,`110101`]},arc:{interval:100,frames:[`◜`,`◠`,`◝`,`◞`,`◡`,`◟`]},circle:{interval:120,frames:[`◡`,`⊙`,`◠`]},squareCorners:{interval:180,frames:[`◰`,`◳`,`◲`,`◱`]},circleQuarters:{interval:120,frames:[`◴`,`◷`,`◶`,`◵`]},circleHalves:{interval:50,frames:[`◐`,`◓`,`◑`,`◒`]},squish:{interval:100,frames:[`╫`,`╪`]},toggle:{interval:250,frames:[`⊶`,`⊷`]},toggle2:{interval:80,frames:[`▫`,`▪`]},toggle3:{interval:120,frames:[`□`,`■`]},toggle4:{interval:100,frames:[`■`,`□`,`▪`,`▫`]},toggle5:{interval:100,frames:[`▮`,`▯`]},toggle6:{interval:300,frames:[`ဝ`,`၀`]},toggle7:{interval:80,frames:[`⦾`,`⦿`]},toggle8:{interval:100,frames:[`◍`,`◌`]},toggle9:{interval:100,frames:[`◉`,`◎`]},toggle10:{interval:100,frames:[`㊂`,`㊀`,`㊁`]},toggle11:{interval:50,frames:[`⧇`,`⧆`]},toggle12:{interval:120,frames:[`☗`,`☖`]},toggle13:{interval:80,frames:[`=`,`*`,`-`]},arrow:{interval:100,frames:[`←`,`↖`,`↑`,`↗`,`→`,`↘`,`↓`,`↙`]},arrow2:{interval:80,frames:[`⬆️ `,`↗️ `,`➡️ `,`↘️ `,`⬇️ `,`↙️ `,`⬅️ `,`↖️ `]},arrow3:{interval:120,frames:[`▹▹▹▹▹`,`▸▹▹▹▹`,`▹▸▹▹▹`,`▹▹▸▹▹`,`▹▹▹▸▹`,`▹▹▹▹▸`]},bouncingBar:{interval:80,frames:[`[ ]`,`[= ]`,`[== ]`,`[=== ]`,`[====]`,`[ ===]`,`[ ==]`,`[ =]`,`[ ]`,`[ =]`,`[ ==]`,`[ ===]`,`[====]`,`[=== ]`,`[== ]`,`[= ]`]},bouncingBall:{interval:80,frames:[`( ● )`,`( ● )`,`( ● )`,`( ● )`,`( ●)`,`( ● )`,`( ● )`,`( ● )`,`( ● )`,`(● )`]},smiley:{interval:200,frames:[`😄 `,`😝 `]},monkey:{interval:300,frames:[`🙈 `,`🙈 `,`🙉 `,`🙊 `]},hearts:{interval:100,frames:[`💛 `,`💙 `,`💜 `,`💚 `,`💗 `]},clock:{interval:100,frames:[`🕛 `,`🕐 `,`🕑 `,`🕒 `,`🕓 `,`🕔 `,`🕕 `,`🕖 `,`🕗 `,`🕘 `,`🕙 `,`🕚 `]},earth:{interval:180,frames:[`🌍 `,`🌎 `,`🌏 `]},material:{interval:17,frames:`█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁.███████▁▁▁▁▁▁▁▁▁▁▁▁▁.████████▁▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.██████████▁▁▁▁▁▁▁▁▁▁.███████████▁▁▁▁▁▁▁▁▁.█████████████▁▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁▁██████████████▁▁▁▁.▁▁▁██████████████▁▁▁.▁▁▁▁█████████████▁▁▁.▁▁▁▁██████████████▁▁.▁▁▁▁██████████████▁▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁▁██████████████.▁▁▁▁▁▁██████████████.▁▁▁▁▁▁▁█████████████.▁▁▁▁▁▁▁█████████████.▁▁▁▁▁▁▁▁████████████.▁▁▁▁▁▁▁▁████████████.▁▁▁▁▁▁▁▁▁███████████.▁▁▁▁▁▁▁▁▁███████████.▁▁▁▁▁▁▁▁▁▁██████████.▁▁▁▁▁▁▁▁▁▁██████████.▁▁▁▁▁▁▁▁▁▁▁▁████████.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.██████▁▁▁▁▁▁▁▁▁▁▁▁▁█.████████▁▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.███████████▁▁▁▁▁▁▁▁▁.████████████▁▁▁▁▁▁▁▁.████████████▁▁▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁▁▁█████████████▁▁▁▁.▁▁▁▁▁████████████▁▁▁.▁▁▁▁▁████████████▁▁▁.▁▁▁▁▁▁███████████▁▁▁.▁▁▁▁▁▁▁▁█████████▁▁▁.▁▁▁▁▁▁▁▁█████████▁▁▁.▁▁▁▁▁▁▁▁▁█████████▁▁.▁▁▁▁▁▁▁▁▁█████████▁▁.▁▁▁▁▁▁▁▁▁▁█████████▁.▁▁▁▁▁▁▁▁▁▁▁████████▁.▁▁▁▁▁▁▁▁▁▁▁████████▁.▁▁▁▁▁▁▁▁▁▁▁▁███████▁.▁▁▁▁▁▁▁▁▁▁▁▁███████▁.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁`.split(`.`)},moon:{interval:80,frames:[`🌑 `,`🌒 `,`🌓 `,`🌔 `,`🌕 `,`🌖 `,`🌗 `,`🌘 `]},runner:{interval:140,frames:[`🚶 `,`🏃 `]},pong:{interval:80,frames:`▐⠂ ▌.▐⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂▌.▐ ⠠▌.▐ ⡀▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐⠠ ▌`.split(`.`)},shark:{interval:120,frames:`▐|\\____________▌.▐_|\\___________▌.▐__|\\__________▌.▐___|\\_________▌.▐____|\\________▌.▐_____|\\_______▌.▐______|\\______▌.▐_______|\\_____▌.▐________|\\____▌.▐_________|\\___▌.▐__________|\\__▌.▐___________|\\_▌.▐____________|\\▌.▐____________/|▌.▐___________/|_▌.▐__________/|__▌.▐_________/|___▌.▐________/|____▌.▐_______/|_____▌.▐______/|______▌.▐_____/|_______▌.▐____/|________▌.▐___/|_________▌.▐__/|__________▌.▐_/|___________▌.▐/|____________▌`.split(`.`)},dqpb:{interval:100,frames:[`d`,`q`,`p`,`b`]},weather:{interval:100,frames:[`☀️ `,`☀️ `,`☀️ `,`🌤 `,`⛅️ `,`🌥 `,`☁️ `,`🌧 `,`🌨 `,`🌧 `,`🌨 `,`🌧 `,`🌨 `,`⛈ `,`🌨 `,`🌧 `,`🌨 `,`☁️ `,`🌥 `,`⛅️ `,`🌤 `,`☀️ `,`☀️ `]},christmas:{interval:400,frames:[`🌲`,`🎄`]},grenade:{interval:80,frames:[`، `,`′ `,` ´ `,` ‾ `,` ⸌`,` ⸊`,` |`,` ⁎`,` ⁕`,` ෴ `,` ⁓`,` `,` `,` `]},point:{interval:125,frames:[`∙∙∙`,`●∙∙`,`∙●∙`,`∙∙●`,`∙∙∙`]},layer:{interval:150,frames:[`-`,`=`,`≡`]},betaWave:{interval:80,frames:[`ρββββββ`,`βρβββββ`,`ββρββββ`,`βββρβββ`,`ββββρββ`,`βββββρβ`,`ββββββρ`]},fingerDance:{interval:160,frames:[`🤘 `,`🤟 `,`🖖 `,`✋ `,`🤚 `,`👆 `]},fistBump:{interval:80,frames:[`🤜 🤛 `,`🤜 🤛 `,`🤜 🤛 `,` 🤜 🤛 `,` 🤜🤛 `,` 🤜✨🤛 `,`🤜 ✨ 🤛 `]},soccerHeader:{interval:80,frames:[` 🧑⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `]},mindblown:{interval:160,frames:[`😐 `,`😐 `,`😮 `,`😮 `,`😦 `,`😦 `,`😧 `,`😧 `,`🤯 `,`💥 `,`✨ `,` `,` `,` `]},speaker:{interval:160,frames:[`🔈 `,`🔉 `,`🔊 `,`🔉 `]},orangePulse:{interval:100,frames:[`🔸 `,`🔶 `,`🟠 `,`🟠 `,`🔶 `]},bluePulse:{interval:100,frames:[`🔹 `,`🔷 `,`🔵 `,`🔵 `,`🔷 `]},orangeBluePulse:{interval:100,frames:[`🔸 `,`🔶 `,`🟠 `,`🟠 `,`🔶 `,`🔹 `,`🔷 `,`🔵 `,`🔵 `,`🔷 `]},timeTravel:{interval:100,frames:[`🕛 `,`🕚 `,`🕙 `,`🕘 `,`🕗 `,`🕖 `,`🕕 `,`🕔 `,`🕓 `,`🕒 `,`🕑 `,`🕐 `]},aesthetic:{interval:80,frames:[`▰▱▱▱▱▱▱`,`▰▰▱▱▱▱▱`,`▰▰▰▱▱▱▱`,`▰▰▰▰▱▱▱`,`▰▰▰▰▰▱▱`,`▰▰▰▰▰▰▱`,`▰▰▰▰▰▰▰`,`▰▱▱▱▱▱▱`]},dwarfFortress:{interval:80,frames:` ██████£££ .☺██████£££ .☺██████£££ .☺▓█████£££ .☺▓█████£££ .☺▒█████£££ .☺▒█████£££ .☺░█████£££ .☺░█████£££ .☺ █████£££ . ☺█████£££ . ☺█████£££ . ☺▓████£££ . ☺▓████£££ . ☺▒████£££ . ☺▒████£££ . ☺░████£££ . ☺░████£££ . ☺ ████£££ . ☺████£££ . ☺████£££ . ☺▓███£££ . ☺▓███£££ . ☺▒███£££ . ☺▒███£££ . ☺░███£££ . ☺░███£££ . ☺ ███£££ . ☺███£££ . ☺███£££ . ☺▓██£££ . ☺▓██£££ . ☺▒██£££ . ☺▒██£££ . ☺░██£££ . ☺░██£££ . ☺ ██£££ . ☺██£££ . ☺██£££ . ☺▓█£££ . ☺▓█£££ . ☺▒█£££ . ☺▒█£££ . ☺░█£££ . ☺░█£££ . ☺ █£££ . ☺█£££ . ☺█£££ . ☺▓£££ . ☺▓£££ . ☺▒£££ . ☺▒£££ . ☺░£££ . ☺░£££ . ☺ £££ . ☺£££ . ☺£££ . ☺▓££ . ☺▓££ . ☺▒££ . ☺▒££ . ☺░££ . ☺░££ . ☺ ££ . ☺££ . ☺££ . ☺▓£ . ☺▓£ . ☺▒£ . ☺▒£ . ☺░£ . ☺░£ . ☺ £ . ☺£ . ☺£ . ☺▓ . ☺▓ . ☺▒ . ☺▒ . ☺░ . ☺░ . ☺ . ☺ &. ☺ ☼&. ☺ ☼ &. ☺☼ &. ☺☼ & . ‼ & . ☺ & . ‼ & . ☺ & . ‼ & . ☺ & .‼ & . & . & . & ░ . & ▒ . & ▓ . & £ . & ░£ . & ▒£ . & ▓£ . & ££ . & ░££ . & ▒££ .& ▓££ .& £££ . ░£££ . ▒£££ . ▓£££ . █£££ . ░█£££ . ▒█£££ . ▓█£££ . ██£££ . ░██£££ . ▒██£££ . ▓██£££ . ███£££ . ░███£££ . ▒███£££ . ▓███£££ . ████£££ . ░████£££ . ▒████£££ . ▓████£££ . █████£££ . ░█████£££ . ▒█████£££ . ▓█████£££ . ██████£££ . ██████£££ `.split(`.`)}};const Fn=v?.WriteStream?.prototype?.hasColors?.()??!1,I=(e,t)=>{if(!Fn)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}};I(0,0);const In=I(1,22);I(2,22),I(3,23),I(4,24),I(53,55),I(7,27),I(8,28),I(9,29),I(30,39);const Ln=I(31,39),Rn=I(32,39),zn=I(33,39),Bn=I(34,39);I(35,39),I(36,39),I(37,39);const Vn=I(90,39);I(40,49),I(41,49),I(42,49),I(43,49),I(44,49),I(45,49),I(46,49),I(47,49),I(100,49);const Hn=I(91,39);I(92,39);const Un=I(93,39);I(94,39),I(95,39),I(96,39),I(97,39),I(101,49),I(102,49),I(103,49),I(104,49),I(105,49),I(106,49),I(107,49);function Wn(){let{env:e}=u,{TERM:t,TERM_PROGRAM:n}=e;return u.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 Gn=Wn(),Kn=Bn(Gn?`ℹ`:`i`),qn=Rn(Gn?`✔`:`√`),Jn=zn(Gn?`⚠`:`‼`),Yn=Ln(Gn?`✖`:`×`);function Xn({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const Zn=Xn();function Qn(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Zn,``)}function $n(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function er(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function tr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function nr(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function rr(e,{ambiguousAsWide:t=!1}={}){return nr(e),er(e)||tr(e)||t&&$n(e)?2:1}const ir=new Intl.Segmenter,ar=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,or=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,sr=/^\p{RGI_Emoji}$/v;function cr(e){return e.replace(or,``)}function lr(e){return ar.test(e)}function ur(e,t){let n=0;if(e.length>1)for(let r of e.slice(1))r>=``&&r<=``&&(n+=rr(r.codePointAt(0),t));return n}function dr(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(r||(i=Qn(i)),i.length===0)return 0;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of ir.segment(i)){if(lr(e))continue;if(sr.test(e)){a+=2;continue}let t=cr(e).codePointAt(0);a+=rr(t,o),a+=ur(e,o)}return a}function fr({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!==`dumb`&&!(`CI`in process.env))}var pr=new class{#e=0;start(){this.#e++,this.#e===1&&this.#t()}stop(){if(this.#e<=0)throw Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#n()}#t(){u.platform===`win32`||!u.stdin.isTTY||(u.stdin.setRawMode(!0),u.stdin.on(`data`,this.#r),u.stdin.resume())}#n(){u.stdin.isTTY&&(u.stdin.off(`data`,this.#r),u.stdin.pause(),u.stdin.setRawMode(!1))}#r(e){e[0]===3&&u.emit(`SIGINT`)}},mr=class{#e=0;#t=!1;#n=0;#r=-1;#i=0;#a=0;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;color;constructor(e){typeof e==`string`&&(e={text:e}),this.#o={color:`cyan`,stream:u.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#o.color,this.spinner=this.#o.spinner,this.#u=this.#o.interval,this.#c=this.#o.stream,this.#d=typeof this.#o.isEnabled==`boolean`?this.#o.isEnabled:fr({stream:this.#c}),this.#f=typeof this.#o.isSilent==`boolean`?this.#o.isSilent:!1,this.text=this.#o.text,this.prefixText=this.#o.prefixText,this.suffixText=this.#o.suffixText,this.indent=this.#o.indent,u.env.NODE_ENV===`test`&&(this._stream=this.#c,this._isEnabled=this.#d,Object.defineProperty(this,`_linesToClear`,{get(){return this.#e},set(e){this.#e=e}}),Object.defineProperty(this,`_frameIndex`,{get(){return this.#r}}),Object.defineProperty(this,`_lineCount`,{get(){return this.#n}}))}get indent(){return this.#p}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#p=e,this.#x()}get interval(){return this.#u??this.#s.interval??100}get spinner(){return this.#s}set spinner(e){if(this.#r=-1,this.#u=void 0,typeof e==`object`){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(e=>typeof e!=`string`))throw Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#s=e}else if(!Wn())this.#s=Pn.line;else if(e===void 0)this.#s=Pn.dots;else if(e!==`default`&&Pn[e])this.#s=Pn[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#m}set text(e=``){this.#m=e,this.#x()}get prefixText(){return this.#h}set prefixText(e=``){this.#h=e,this.#x()}get suffixText(){return this.#g}set suffixText(e=``){this.#g=e,this.#x()}get isSpinning(){return this.#l!==void 0}#_(e,t,n=!1){let r=typeof e==`function`?e():e;return typeof r==`string`&&r!==``?n?t+r:r+t:``}#v(e=this.#h,t=` `){return this.#_(e,t,!1)}#y(e=this.#g,t=` `){return this.#_(e,t,!0)}#b(e,t){let n=0;for(let r of Qn(e).split(`
|
|
25
|
+
`))n+=Math.max(1,Math.ceil(dr(r)/t));return n}#x(){let e=this.#c.columns??80,t=typeof this.#h==`function`?``:this.#h,n=typeof this.#g==`function`?``:this.#g,r=typeof t==`string`&&t!==``?t+` `:``,i=typeof n==`string`&&n!==``?` `+n:``,a=` `.repeat(this.#p)+r+`-`+(typeof this.#m==`string`?` `+this.#m:``)+i;this.#n=this.#b(a,e)}get isEnabled(){return this.#d&&!this.#f}set isEnabled(e){if(typeof e!=`boolean`)throw TypeError("The `isEnabled` option must be a boolean");this.#d=e}get isSilent(){return this.#f}set isSilent(e){if(typeof e!=`boolean`)throw TypeError("The `isSilent` option must be a boolean");this.#f=e}frame(){let e=Date.now();(this.#r===-1||e-this.#i>=this.interval)&&(this.#r=++this.#r%this.#s.frames.length,this.#i=e);let{frames:t}=this.#s,n=t[this.#r];this.color&&(n=It[this.color](n));let r=this.#v(this.#h,` `),i=typeof this.text==`string`?` `+this.text:``,a=this.#y(this.#g,` `);return r+n+i+a}clear(){if(!this.#d||!this.#c.isTTY)return this;this.#c.cursorTo(0);for(let e=0;e<this.#e;e++)e>0&&this.#c.moveCursor(0,-1),this.#c.clearLine(1);return(this.#p||this.#a!==this.#p)&&this.#c.cursorTo(this.#p),this.#a=this.#p,this.#e=0,this}render(){if(!this.#d||this.#f)return this;this.clear();let e=this.frame(),t=this.#c.columns??80,n=this.#b(e,t),r=this.#c.rows;if(r&&r>1&&n>r){let t=e.split(`
|
|
26
26
|
`),n=r-1;e=[...t.slice(0,n),`... (content truncated to fit terminal)`].join(`
|
|
27
27
|
`)}return this.#c.write(e),this.#e=this.#b(e,t),this}start(e){if(e&&(this.text=e),this.#f)return this;if(!this.#d){let e=` `.repeat(this.#p)+this.#v(this.#h,` `)+(this.text?`- ${this.text}`:``)+this.#y(this.#g,` `);return e.trim()!==``&&this.#c.write(e+`
|
|
28
|
-
`),this}return this.isSpinning?this:(this.#o.hideCursor&&
|
|
29
|
-
`;return this.stop(),this.#c.write(c),this}};function
|
|
28
|
+
`),this}return this.isSpinning?this:(this.#o.hideCursor&&Nn.hide(this.#c),this.#o.discardStdin&&u.stdin.isTTY&&(this.#t=!0,pr.start()),this.render(),this.#l=setInterval(this.render.bind(this),this.interval),this)}stop(){return clearInterval(this.#l),this.#l=void 0,this.#r=0,this.#d&&(this.clear(),this.#o.hideCursor&&Nn.show(this.#c)),this.#o.discardStdin&&u.stdin.isTTY&&this.#t&&(pr.stop(),this.#t=!1),this}succeed(e){return this.stopAndPersist({symbol:qn,text:e})}fail(e){return this.stopAndPersist({symbol:Yn,text:e})}warn(e){return this.stopAndPersist({symbol:Jn,text:e})}info(e){return this.stopAndPersist({symbol:Kn,text:e})}stopAndPersist(e={}){if(this.#f)return this;let t=e.prefixText??this.#h,n=this.#v(t,` `),r=e.symbol??` `,i=e.text??this.text,a=typeof i==`string`?(r?` `:``)+i:``,o=e.suffixText??this.#g,s=this.#y(o,` `),c=n+r+a+s+`
|
|
29
|
+
`;return this.stop(),this.#c.write(c),this}};function hr(e){return new mr(e)}var gr=t(n(((e,t)=>{t.exports=function(e){if(typeof e!=`object`)throw Error(`expected an author to be an object`);var t={name:[``,``],email:[`<`,`>`],url:[`(`,`)`]},r=``;for(var i in e.url&&=n(e.url),t)e[i]&&(r+=t[i][0]+e[i]+t[i][1]+` `);return r.trim()};function n(e){return e.replace(/\/$/,``)}}))(),1);async function _r(e){let t=new AbortController,n=setTimeout(()=>t.abort(),5e3);try{let r=await fetch(e,{signal:t.signal});clearTimeout(n);let i=(await r.text()).trim();if(i)return i;throw Error(`template download fail`)}catch(e){throw clearTimeout(n),e.name===`AbortError`?Error(`request timeout`):e}}function vr(){return ne(process.cwd()).filter(e=>e!==`.git`).length===0}function yr(e){return e?e.trim():void 0}function br(){try{return{name:S(`git config user.name`).toString().trim(),email:S(`git config user.email`).toString().trim()}}catch{return{}}}async function xr(e){if(e)return e;let t=br();return t.name?(0,gr.default)(t):`Unknown`}async function Sr(e){return(await xr(e)).name||`Unknown`}function Cr(){try{return JSON.parse(te(o(process.cwd(),`package.json`)))}catch{return{}}}var wr=`# Created by nice-move
|
|
30
30
|
|
|
31
31
|
* text=auto eol=lf
|
|
32
|
-
`;const
|
|
33
|
-
`)}).output().then(()=>{e.stopAndPersist({symbol
|
|
32
|
+
`;const Tr={Windows_NT:`windows`,Linux:`linux`,Darwin:`macos`};async function Er(){await new F().onDone(()=>wr).output(`.gitattributes`).logger(`Create/Overwrite`,Qt(`.gitattributes`));let e=hr({text:"Downloading template from `gitignore.io`"}).start(),t=`Create/Overwrite ${Qt(`.gitignore`)}`;return new F().source(`.gitignore`).onFail().onDone((e=``)=>{let t=Tr[_()];return _r(`https://www.toptal.com/developers/gitignore/api/ssh,certificates,node,${t}`).then(e=>{let t=e.replaceAll(/(www\.)?toptal\.com\/developers\/gitignore/g,`gitignore.io`);return t.startsWith(`# Created`)?t:`node_modules`}).catch(()=>e||`node_modules
|
|
33
|
+
`)}).output().then(()=>{e.stopAndPersist({symbol:en(`✔`),text:t})}).catch(n=>{e.stopAndPersist({symbol:$t(`✘`),text:`${t} - ${n.message}`})})}var Dr=`MIT License
|
|
34
34
|
|
|
35
35
|
Copyright (c) {{year}} {{holder}}
|
|
36
36
|
|
|
@@ -51,7 +51,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
51
51
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
52
52
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
53
53
|
SOFTWARE.
|
|
54
|
-
`,
|
|
54
|
+
`,Or=`This is free and unencumbered software released into the public domain.
|
|
55
55
|
|
|
56
56
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
57
57
|
distribute this software, either in source code form or as a compiled
|
|
@@ -75,44 +75,44 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
75
75
|
OTHER DEALINGS IN THE SOFTWARE.
|
|
76
76
|
|
|
77
77
|
For more information, please refer to <https://unlicense.org/>
|
|
78
|
-
`;async function
|
|
79
|
-
`)){let[e,r]=n.split(`=`);t[e]=r.replace(/^"|"$/g,``)}return
|
|
78
|
+
`;async function kr(){let{license:e,author:t=``}=Cr(),n=e===`MIT`;if(n||e===`Unlicense`){let e=await Sr(t);return new F().onDone(()=>n?Dr.replace(`{{year}}`,new Date().getFullYear()).replace(`{{holder}}`,e):Or).output(`LICENSE`).logger(`Create/Overwrite`,Qt(`LICENSE`)).catch(console.warn)}}const L={defaultMerge:Symbol(`deepmerge-ts: default merge`),skip:Symbol(`deepmerge-ts: skip`)};L.defaultMerge;function Ar(e,t){return t}function jr(e,t){return e.filter(e=>e!==void 0)}var Mr;(function(e){e[e.NOT=0]=`NOT`,e[e.RECORD=1]=`RECORD`,e[e.ARRAY=2]=`ARRAY`,e[e.SET=3]=`SET`,e[e.MAP=4]=`MAP`,e[e.OTHER=5]=`OTHER`})(Mr||={});function Nr(e){return typeof e!=`object`||!e?0:Array.isArray(e)?2:Rr(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Pr(e){let t=new Set;for(let n of e)for(let e of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(e);return t}function Fr(e,t){return typeof e==`object`&&Object.prototype.propertyIsEnumerable.call(e,t)}function Ir(e){let t=0,n=e[0]?.[Symbol.iterator]();return{[Symbol.iterator](){return{next(){do{if(n===void 0)return{done:!0,value:void 0};let r=n.next();if(r.done===!0){t+=1,n=e[t]?.[Symbol.iterator]();continue}return{done:!1,value:r.value}}while(!0)}}}}}const Lr=[`[object Object]`,`[object Module]`];function Rr(e){if(!Lr.includes(Object.prototype.toString.call(e)))return!1;let{constructor:t}=e;if(t===void 0)return!0;let n=t.prototype;return!(typeof n!=`object`||!n||!Lr.includes(Object.prototype.toString.call(n))||!n.hasOwnProperty(`isPrototypeOf`))}function zr(e,t,n){let r={};for(let i of Pr(e)){let a=[];for(let t of e)Fr(t,i)&&a.push(t[i]);if(a.length===0)continue;let o=Jr(a,t,t.metaDataUpdater(n,{key:i,parents:e}));o!==L.skip&&(i===`__proto__`?Object.defineProperty(r,i,{value:o,configurable:!0,enumerable:!0,writable:!0}):r[i]=o)}return r}function Br(e){return e.flat()}function Vr(e){return new Set(Ir(e))}function Hr(e){return new Map(Ir(e))}function Ur(e){return e.at(-1)}const Wr={mergeRecords:zr,mergeArrays:Br,mergeSets:Vr,mergeMaps:Hr,mergeOthers:Ur};function Gr(...e){return Kr({})(...e)}function Kr(e,t){let n=qr(e,r);function r(...e){return Jr(e,n,t)}return r}function qr(e,t){return{defaultMergeFunctions:Wr,mergeFunctions:{...Wr,...Object.fromEntries(Object.entries(e).filter(([e,t])=>Object.hasOwn(Wr,e)).map(([e,t])=>t===!1?[e,Wr.mergeOthers]:[e,t]))},metaDataUpdater:e.metaDataUpdater??Ar,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:e.filterValues===!1?void 0:e.filterValues??jr,actions:L}}function Jr(e,t,n){let r=t.filterValues?.(e,n)??e;if(r.length===0)return;if(r.length===1)return $r(r,t,n);let i=Nr(r[0]);if(i!==0&&i!==5){for(let e=1;e<r.length;e++)if(Nr(r[e])!==i)return $r(r,t,n)}switch(i){case 1:return Yr(r,t,n);case 2:return Xr(r,t,n);case 3:return Zr(r,t,n);case 4:return Qr(r,t,n);default:return $r(r,t,n)}}function Yr(e,t,n){let r=t.mergeFunctions.mergeRecords(e,t,n);return r===L.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):r}function Xr(e,t,n){let r=t.mergeFunctions.mergeArrays(e,t,n);return r===L.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):r}function Zr(e,t,n){let r=t.mergeFunctions.mergeSets(e,t,n);return r===L.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):r}function Qr(e,t,n){let r=t.mergeFunctions.mergeMaps(e,t,n);return r===L.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):r}function $r(e,t,n){let r=t.mergeFunctions.mergeOthers(e,t,n);return r===L.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):r}var R={"@bring-it/cli":`^0.11.1`,"@bring-it/npm":`^0.9.3`,"@cospaia/prettier-plugin-clojure":`^0.0.2`,"@pnpm/pnpmfile":`^1002.1.11`,"@pnpm/types":`^1001.3.0`,"@vitest/ui":`^4.0.17`,eslint:`^9.39.2`,"find-workspaces":`^0.3.1`,garou:`^0.9.17`,postcss:`^8.5.6`,prettier:`~3.8.0`,"prettier-plugin-tailwindcss":`^0.7.2`,stylelint:`^16.26.1`,syncpack:`^13.0.4`,tsdown:`^0.19.0`,typescript:`~5.9.3`,vitest:`^4.0.17`,"@bring-it/sftp":`^0.7.1`,"@nice-move/init":`^0.8.35`,"@nice-move/syncpack-config":`^0.4.2`,"@playwright/test":`~1.56.1`,"@types/react":`~18.3.27`,react:`~18.3.1`,"react-dom":`~18.3.1`,tailwindcss:`^3.4.19`,vue:`~3.5.26`,yaml:`^2.8.2`,"@nice-move/eslint-config-base":`^0.13.19`,"@nice-move/stylelint-config":`^0.10.25`,"@nice-move/prettier-config":`^0.15.8`,"@nice-move/tsconfig":`^0.4.2`,"@nice-move/cli":`^0.11.29`,"@eslint/eslintrc":`^3.3.3`,"@eslint/js":`^9.39.2`,"@eslint/markdown":`^7.5.1`,"@types/node":`^24.10.9`,chalk:`^5.6.2`,"eslint-plugin-vue":`^10.7.0`,execa:`^9.6.1`,"fs-chain":`^10.0.0`,lodash:`^4.17.21`,settingz:`^0.2.0`,"sort-keys":`^6.0.0`,"typescript-eslint":`^8.53.1`,"eslint-plugin-react-hooks":`^5.2.0`,globals:`^17.0.0`,packageManager:`pnpm@10.27.0`,engines:{node:`>=24.0.0 || ^22.18.0`,pnpm:`^10.27.0`}},ei=n(((e,t)=>{t.exports=e=>{if(typeof e!=`object`||!e)throw TypeError(`Expected an object`);let t={};for(let[n,r]of Object.entries(e))t[r]=n;for(let n of Object.getOwnPropertySymbols(e)){let r=e[n];t[r]=n}return t}})),ti=n(((e,t)=>{t.exports={4:`zh_CHS`,1025:`ar_SA`,1026:`bg_BG`,1027:`ca_ES`,1028:`zh_TW`,1029:`cs_CZ`,1030:`da_DK`,1031:`de_DE`,1032:`el_GR`,1033:`en_US`,1034:`es_ES`,1035:`fi_FI`,1036:`fr_FR`,1037:`he_IL`,1038:`hu_HU`,1039:`is_IS`,1040:`it_IT`,1041:`ja_JP`,1042:`ko_KR`,1043:`nl_NL`,1044:`nb_NO`,1045:`pl_PL`,1046:`pt_BR`,1047:`rm_CH`,1048:`ro_RO`,1049:`ru_RU`,1050:`hr_HR`,1051:`sk_SK`,1052:`sq_AL`,1053:`sv_SE`,1054:`th_TH`,1055:`tr_TR`,1056:`ur_PK`,1057:`id_ID`,1058:`uk_UA`,1059:`be_BY`,1060:`sl_SI`,1061:`et_EE`,1062:`lv_LV`,1063:`lt_LT`,1064:`tg_TJ`,1065:`fa_IR`,1066:`vi_VN`,1067:`hy_AM`,1069:`eu_ES`,1070:`wen_DE`,1071:`mk_MK`,1074:`tn_ZA`,1076:`xh_ZA`,1077:`zu_ZA`,1078:`af_ZA`,1079:`ka_GE`,1080:`fo_FO`,1081:`hi_IN`,1082:`mt_MT`,1083:`se_NO`,1086:`ms_MY`,1087:`kk_KZ`,1088:`ky_KG`,1089:`sw_KE`,1090:`tk_TM`,1092:`tt_RU`,1093:`bn_IN`,1094:`pa_IN`,1095:`gu_IN`,1096:`or_IN`,1097:`ta_IN`,1098:`te_IN`,1099:`kn_IN`,1100:`ml_IN`,1101:`as_IN`,1102:`mr_IN`,1103:`sa_IN`,1104:`mn_MN`,1105:`bo_CN`,1106:`cy_GB`,1107:`kh_KH`,1108:`lo_LA`,1109:`my_MM`,1110:`gl_ES`,1111:`kok_IN`,1114:`syr_SY`,1115:`si_LK`,1118:`am_ET`,1121:`ne_NP`,1122:`fy_NL`,1123:`ps_AF`,1124:`fil_PH`,1125:`div_MV`,1128:`ha_NG`,1130:`yo_NG`,1131:`quz_BO`,1132:`ns_ZA`,1133:`ba_RU`,1134:`lb_LU`,1135:`kl_GL`,1144:`ii_CN`,1146:`arn_CL`,1148:`moh_CA`,1150:`br_FR`,1152:`ug_CN`,1153:`mi_NZ`,1154:`oc_FR`,1155:`co_FR`,1156:`gsw_FR`,1157:`sah_RU`,1158:`qut_GT`,1159:`rw_RW`,1160:`wo_SN`,1164:`gbz_AF`,2049:`ar_IQ`,2052:`zh_CN`,2055:`de_CH`,2057:`en_GB`,2058:`es_MX`,2060:`fr_BE`,2064:`it_CH`,2067:`nl_BE`,2068:`nn_NO`,2070:`pt_PT`,2077:`sv_FI`,2080:`ur_IN`,2092:`az_AZ`,2094:`dsb_DE`,2107:`se_SE`,2108:`ga_IE`,2110:`ms_BN`,2115:`uz_UZ`,2128:`mn_CN`,2129:`bo_BT`,2141:`iu_CA`,2143:`tmz_DZ`,2155:`quz_EC`,3073:`ar_EG`,3076:`zh_HK`,3079:`de_AT`,3081:`en_AU`,3082:`es_ES`,3084:`fr_CA`,3098:`sr_SP`,3131:`se_FI`,3179:`quz_PE`,4097:`ar_LY`,4100:`zh_SG`,4103:`de_LU`,4105:`en_CA`,4106:`es_GT`,4108:`fr_CH`,4122:`hr_BA`,4155:`smj_NO`,5121:`ar_DZ`,5124:`zh_MO`,5127:`de_LI`,5129:`en_NZ`,5130:`es_CR`,5132:`fr_LU`,5179:`smj_SE`,6145:`ar_MA`,6153:`en_IE`,6154:`es_PA`,6156:`fr_MC`,6203:`sma_NO`,7169:`ar_TN`,7177:`en_ZA`,7178:`es_DO`,7194:`sr_BA`,7227:`sma_SE`,8193:`ar_OM`,8201:`en_JA`,8202:`es_VE`,8218:`bs_BA`,8251:`sms_FI`,9217:`ar_YE`,9225:`en_CB`,9226:`es_CO`,9275:`smn_FI`,10241:`ar_SY`,10249:`en_BZ`,10250:`es_PE`,11265:`ar_JO`,11273:`en_TT`,11274:`es_AR`,12289:`ar_LB`,12297:`en_ZW`,12298:`es_EC`,13313:`ar_KW`,13321:`en_PH`,13322:`es_CL`,14337:`ar_AE`,14346:`es_UR`,15361:`ar_BH`,15370:`es_PY`,16385:`ar_QA`,16394:`es_BO`,17417:`en_MY`,17418:`es_SV`,18441:`en_IN`,18442:`es_HN`,19466:`es_NI`,20490:`es_PR`,21514:`es_US`,31748:`zh_CHT`}})),ni=t(n((e=>{let t=ei(),n=ti(),r=t(n);e.from=e=>{if(typeof e!=`number`)throw TypeError(`Expected a number`);return n[e]},e.all=new Proxy(r,{get(e,t){let n=e[t];if(n)return Number(n)}})}))(),1);const ri=le(y.execFile);async function ii(e,t){let n=await ri(e,t,{encoding:`utf8`});return n.stdout=n.stdout.trim(),n}const ai={spawn:!0},oi=`en-US`;async function si(e,t){return(await ii(e,t)).stdout}function ci(e=process.env){return e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}function li(e){let t={};for(let n of e.split(`
|
|
79
|
+
`)){let[e,r]=n.split(`=`);t[e]=r.replace(/^"|"$/g,``)}return ci(t)}function ui(e){return e&&e.replace(/[.:].*/,``)}async function di(){return si(`locale`,[`-a`])}function fi(e,t=``){return t.includes(e)?e:oi}async function pi(){let e=await Promise.all([si(`defaults`,[`read`,`-globalDomain`,`AppleLocale`]),di()]);return fi(e[0],e[1])}async function mi(){return ui(li(await si(`locale`)))}async function hi(){let e=await si(`wmic`,[`os`,`get`,`locale`]),t=Number.parseInt(e.replace(`Locale`,``),16);return ni.from(t)}function gi(e){return e.replace(/_/,`-`)}const _i=new Map;async function vi(e=ai){if(_i.has(e.spawn))return _i.get(e.spawn);let t;try{let n=ci();t=n||e.spawn===!1?ui(n):process.platform===`win32`?await hi():process.platform===`darwin`?await pi():await mi()}catch{}let n=gi(t||oi);return _i.set(e.spawn,n),n}async function yi(){await vi()===`zh-CN`&&new F().source(`.npmrc`).onFail().onDone((e=``)=>e.trim()&&/registry\s*=\s*["']?https:\/\/mirrors\.tencent\.com\/npm\/["']?/i.test(e)?e:`registry = https://mirrors.tencent.com/npm/\r${e}`).output().logger(`Set registry to China mirror in`,Qt(`.npmrc`)).catch(console.warn)}const bi=`package.json`;function xi(e){return new Zt().config({pretty:!0}).source(bi).onFail().onDone((t={})=>Gr({packageManager:R.packageManager,type:`module`,engines:{node:R.engines.node,pnpm:R.engines.pnpm},publishConfig:e.private||t.private?void 0:{access:`public`,registry:`https://registry.npmjs.org/`}},t,e)).onDone(e=>(e.private===!0&&yi(),e)).output().logger(`Add project info to`,Qt(bi)).catch(console.warn)}async function Si(){let{name:e,description:t}=Cr();new F().source(`README.md`).onFail().onDone(n=>n||[`# ${e}`,t?`${t}.\n`:``].filter(Boolean).join(`
|
|
80
80
|
|
|
81
|
-
`)).output().logger(`Create`,
|
|
82
|
-
`?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=
|
|
83
|
-
`]),
|
|
81
|
+
`)).output().logger(`Create`,Qt(`README.md`)).catch(console.warn)}function z(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 Ci=(e,t)=>{let n=Ei(wi(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},wi=e=>Ti(e)?e.toString():e,Ti=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Ei=e=>e instanceof URL?l(e):e,Di=(e,t=[],n={})=>{let r=Ci(e,`First argument`),[i,a]=z(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(!z(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]},{toString:Oi}=Object.prototype,ki=e=>Oi.call(e)===`[object ArrayBuffer]`,B=e=>Oi.call(e)===`[object Uint8Array]`,Ai=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ji=new TextEncoder,Mi=e=>ji.encode(e),Ni=new TextDecoder,Pi=e=>Ni.decode(e),Fi=(e,t)=>Ii(e,t).join(``),Ii=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new de(t),r=e.map(e=>typeof e==`string`?Mi(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Li=e=>e.length===1&&B(e[0])?e[0]:zi(Ri(e)),Ri=e=>e.map(e=>typeof e==`string`?Mi(e):e),zi=e=>{let t=new Uint8Array(Bi(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Bi=e=>{let t=0;for(let n of e)t+=n.length;return t},Vi=e=>Array.isArray(e)&&Array.isArray(e.raw),Hi=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=Ui({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,{}]},Ui=({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}=Wi(i,e.raw[r]),c=qi(n,a,o);if(r===t.length)return c;let l=t[r];return qi(c,Array.isArray(l)?l.map(e=>Ji(e)):[Ji(l)],s)},Wi=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=Gi.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(Gi.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
|
|
82
|
+
`?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=Ki[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},Gi=new Set([` `,` `,`\r`,`
|
|
83
|
+
`]),Ki={x:3,u:5},qi=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Ji=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(z(e)&&(`stdout`in e||`isMaxBuffer`in e))return Yi(e);throw e instanceof b||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`)},Yi=({stdout:e})=>{if(typeof e==`string`)return e;if(B(e))return Pi(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`)},Xi=e=>Zi.includes(e),Zi=[u.stdin,u.stdout,u.stderr],V=[`stdin`,`stdout`,`stderr`],Qi=e=>V[e]??`stdio[${e}]`,$i=e=>{let t={...e};for(let n of da)t[n]=ea(e,n);return t},ea=(e,t)=>{let n=Array.from({length:ta(e)+1});return la(na(e[t],n,t),t)},ta=({stdio:e})=>Array.isArray(e)?Math.max(e.length,V.length):V.length,na=(e,t,n)=>z(e)?ra(e,t,n):t.fill(e),ra=(e,t,n)=>{for(let r of Object.keys(e).sort(ia))for(let i of oa(r,n,t))t[i]=e[r];return t},ia=(e,t)=>aa(e)<aa(t)?1:-1,aa=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,oa=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=sa(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
|
|
84
84
|
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.
|
|
85
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},
|
|
86
|
-
`).map(e=>
|
|
87
|
-
`),
|
|
88
|
-
`)?e:`${e}\n`,
|
|
89
|
-
`).map(e=>qa({...t,message:e})),qa=e=>({verboseLine:Pa(e),verboseObject:e}),Ja=e=>ba(typeof e==`string`?e:ce(e)).replaceAll(` `,` `.repeat(Ya)),Ya=2,Xa=(e,t)=>{fa(t)&&Wa({type:`command`,verboseMessage:e,verboseInfo:t})},Za=(e,t,n)=>(eo(e),{verbose:e,escapedCommand:t,commandId:Qa(e),rawOptions:n}),Qa=e=>fa({verbose:e})?$a++:void 0;let $a=0n;const eo=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(!va.includes(t)&&!_a(t)){let e=va.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},to=()=>p.bigint(),no=e=>Number(p.bigint()-e)/1e6,ro=(e,t,n)=>{let r=to(),{command:i,escapedCommand:a}=ya(e,t),o=Za($i(n,`verbose`),a,{...n});return Xa(a,o),{command:i,escapedCommand:a,startTime:r,verboseInfo:o}};var io=n(((t,n)=>{n.exports=o,o.sync=s;var r=e(`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)}})),ao=n(((t,n)=>{n.exports=i,i.sync=a;var r=e(`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=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}})),oo=n(((t,n)=>{e(`fs`);var r=process.platform===`win32`||global.TESTING_WINDOWS?io():ao();n.exports=i,i.sync=a;function i(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){i(e,t||{},function(e,t){e?r(e):n(t)})})}r(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function a(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}})),so=n(((t,n)=>{let r=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,i=e(`path`),a=r?`;`:`:`,o=oo(),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);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,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)};n.exports=l,l.sync=(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{if(o.sync(n,{pathExt:a}))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)}})),co=n(((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n})),lo=n(((t,n)=>{let r=e(`path`),i=so(),a=co();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)}n.exports=s})),uo=n(((e,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})),fo=n(((e,t)=>{t.exports=/^#!(.*)/})),po=n(((e,t)=>{let n=fo();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}})),mo=n(((t,n)=>{let r=e(`fs`),i=po();function a(e){let t=Buffer.alloc(150),n;try{n=r.openSync(e,`r`),r.readSync(n,t,0,150,0),r.closeSync(n)}catch{}return i(t.toString())}n.exports=a})),ho=n(((t,n)=>{let r=e(`path`),i=lo(),a=uo(),o=mo(),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)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],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)}n.exports=f})),go=n(((e,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}})),_o=t(n(((t,n)=>{let r=e(`child_process`),i=ho(),a=go();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}n.exports=o,n.exports.spawn=o,n.exports.sync=s,n.exports._parse=i,n.exports._enoent=a}))(),1);function vo(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`}le(x);function yo(e){return e instanceof URL?l(e):e}function bo(e){return{*[Symbol.iterator](){let t=i.resolve(yo(e)),n;for(;n!==t;)yield t,n=t,t=i.resolve(t,`..`)}}}const xo=({cwd:e=u.cwd(),path:t=u.env[vo()],preferLocal:n=!0,execPath:r=u.execPath,addExecPath:a=!0}={})=>{let o=i.resolve(yo(e)),s=[],c=t.split(i.delimiter);return n&&So(s,c,o),a&&Co(s,c,r,o),t===``||t===i.delimiter?`${s.join(i.delimiter)}${t}`:[...s,t].join(i.delimiter)},So=(e,t,n)=>{for(let r of bo(n)){let n=i.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},Co=(e,t,n,r)=>{let a=i.resolve(r,yo(n),`..`);t.includes(a)||e.push(a)},wo=({env:e=u.env,...t}={})=>{e={...e};let n=vo({env:e});return t.path=e[n],e[n]=xo(t),e},To=(e,t,n)=>new(n?Mo:jo)(t,e instanceof Eo?{}:{cause:e});var Eo=class extends Error{};const Do=(e,t)=>{Object.defineProperty(e.prototype,`name`,{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,ko,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Oo=e=>Ao(e)&&ko in e,ko=Symbol(`isExecaError`),Ao=e=>Object.prototype.toString.call(e)===`[object Error]`;var jo=class extends Error{};Do(jo,jo.name);var Mo=class extends Error{};Do(Mo,Mo.name);const No=()=>{let e=Io-Fo+1;return Array.from({length:e},Po)},Po=(e,t)=>({name:`SIGRT${t+1}`,number:Fo+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),Fo=34,Io=64,Lo=[{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`}],Ro=()=>{let e=No();return[...Lo,...e].map(zo)},zo=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=g,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},Bo=()=>{let e=Ro();return Object.fromEntries(e.map(Vo))},Vo=({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}],Ho=Bo(),Uo=()=>{let e=Ro(),t=Array.from({length:65},(t,n)=>Wo(n,e));return Object.assign({},...t)},Wo=(e,t)=>{let n=Go(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}}},Go=(e,t)=>{let n=t.find(({name:t})=>g.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};Uo();const Ko=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Jo(e,t)},qo=e=>e===0?e:Jo(e,"`subprocess.kill()`'s argument"),Jo=(e,t)=>{if(Number.isInteger(e))return Yo(e,t);if(typeof e==`string`)return Zo(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${Qo()}`)},Yo=(e,t)=>{if(Xo.has(e))return Xo.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${Qo()}`)},Xo=(()=>new Map(Object.entries(g.signals).reverse().map(([e,t])=>[t,e])))(),Zo=(e,t)=>{if(e in g.signals)return e;throw e.toUpperCase()in g.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${Qo()}`)},Qo=()=>`Available signal names: ${$o()}.
|
|
90
|
-
Available signal numbers: ${
|
|
85
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},sa=e=>{if(e===`all`)return e;if(V.includes(e))return V.indexOf(e);let t=ca.exec(e);if(t!==null)return Number(t[1])},ca=/^fd(\d+)$/,la=(e,t)=>e.map(e=>e===void 0?ua[t]:e),ua={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:se(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},da=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],fa=(e,t)=>t===`ipc`?e.at(-1):e[t],pa=({verbose:e},t)=>ga(e,t)!==`none`,ma=({verbose:e},t)=>![`none`,`short`].includes(ga(e,t)),ha=({verbose:e},t)=>{let n=ga(e,t);return va(n)?n:void 0},ga=(e,t)=>t===void 0?_a(e):fa(e,t),_a=e=>e.find(e=>va(e))??ya.findLast(t=>e.includes(t)),va=e=>typeof e==`function`,ya=[`none`,`short`,`full`],ba=(e,t)=>{let n=[e,...t];return{command:n.join(` `),escapedCommand:n.map(e=>Da(Sa(e))).join(` `)}},xa=e=>ue(e).split(`
|
|
86
|
+
`).map(e=>Sa(e)).join(`
|
|
87
|
+
`),Sa=e=>e.replaceAll(wa,e=>Ca(e)),Ca=e=>{let t=Ta[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=Ea?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},wa=(()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),Ta={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},Ea=65535,Da=e=>Oa.test(e)?e:m===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,Oa=/^[\w./-]+$/,ka={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:`╱`},Aa={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:`⅒`},ja={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`},Ma={...ka,...Aa},Na={...ka,...ja};var Pa=Wn()?Ma:Na;Object.entries(Aa);const Fa=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=Ia(n),c=za[e]({failed:a,reject:o,piped:r}),l=Va[e]({reject:o});return`${Vn(`[${s}]`)} ${Vn(`[${i}]`)} ${l(c)} ${l(t)}`},Ia=e=>`${La(e.getHours(),2)}:${La(e.getMinutes(),2)}:${La(e.getSeconds(),2)}.${La(e.getMilliseconds(),3)}`,La=(e,t)=>String(e).padStart(t,`0`),Ra=({failed:e,reject:t})=>e?t?Pa.cross:Pa.warning:Pa.tick,za={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:Ra,duration:Ra},Ba=e=>e,Va={command:()=>In,output:()=>Ba,ipc:()=>Ba,error:({reject:e})=>e?Hn:Un,duration:()=>Vn},Ha=(e,t,n)=>{let r=ha(t,n);return e.map(({verboseLine:e,verboseObject:t})=>Ua(e,t,r)).filter(e=>e!==void 0).map(e=>Wa(e)).join(``)},Ua=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},Wa=e=>e.endsWith(`
|
|
88
|
+
`)?e:`${e}\n`,Ga=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=Ha(qa(t,Ka({type:e,result:i,verboseInfo:r})),r,n);a!==``&&console.warn(a.slice(0,-1))},Ka=({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}),qa=(e,t)=>e.split(`
|
|
89
|
+
`).map(e=>Ja({...t,message:e})),Ja=e=>({verboseLine:Fa(e),verboseObject:e}),Ya=e=>xa(typeof e==`string`?e:ce(e)).replaceAll(` `,` `.repeat(Xa)),Xa=2,Za=(e,t)=>{pa(t)&&Ga({type:`command`,verboseMessage:e,verboseInfo:t})},Qa=(e,t,n)=>(to(e),{verbose:e,escapedCommand:t,commandId:$a(e),rawOptions:n}),$a=e=>pa({verbose:e})?eo++:void 0;let eo=0n;const to=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(!ya.includes(t)&&!va(t)){let e=ya.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},no=()=>p.bigint(),ro=e=>Number(p.bigint()-e)/1e6,io=(e,t,n)=>{let r=no(),{command:i,escapedCommand:a}=ba(e,t),o=Qa(ea(n,`verbose`),a,{...n});return Za(a,o),{command:i,escapedCommand:a,startTime:r,verboseInfo:o}};var ao=n(((t,n)=>{n.exports=o,o.sync=s;var r=e(`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)}})),oo=n(((t,n)=>{n.exports=i,i.sync=a;var r=e(`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=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}})),so=n(((t,n)=>{e(`fs`);var r=process.platform===`win32`||global.TESTING_WINDOWS?ao():oo();n.exports=i,i.sync=a;function i(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){i(e,t||{},function(e,t){e?r(e):n(t)})})}r(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function a(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}})),co=n(((t,n)=>{let r=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,i=e(`path`),a=r?`;`:`:`,o=so(),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);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,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)};n.exports=l,l.sync=(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{if(o.sync(n,{pathExt:a}))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)}})),lo=n(((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n})),uo=n(((t,n)=>{let r=e(`path`),i=co(),a=lo();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)}n.exports=s})),fo=n(((e,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})),po=n(((e,t)=>{t.exports=/^#!(.*)/})),mo=n(((e,t)=>{let n=po();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}})),ho=n(((t,n)=>{let r=e(`fs`),i=mo();function a(e){let t=Buffer.alloc(150),n;try{n=r.openSync(e,`r`),r.readSync(n,t,0,150,0),r.closeSync(n)}catch{}return i(t.toString())}n.exports=a})),go=n(((t,n)=>{let r=e(`path`),i=uo(),a=fo(),o=ho(),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)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],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)}n.exports=f})),_o=n(((e,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}})),vo=t(n(((t,n)=>{let r=e(`child_process`),i=go(),a=_o();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}n.exports=o,n.exports.spawn=o,n.exports.sync=s,n.exports._parse=i,n.exports._enoent=a}))(),1);function yo(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`}le(x);function bo(e){return e instanceof URL?l(e):e}function xo(e){return{*[Symbol.iterator](){let t=i.resolve(bo(e)),n;for(;n!==t;)yield t,n=t,t=i.resolve(t,`..`)}}}const So=({cwd:e=u.cwd(),path:t=u.env[yo()],preferLocal:n=!0,execPath:r=u.execPath,addExecPath:a=!0}={})=>{let o=i.resolve(bo(e)),s=[],c=t.split(i.delimiter);return n&&Co(s,c,o),a&&wo(s,c,r,o),t===``||t===i.delimiter?`${s.join(i.delimiter)}${t}`:[...s,t].join(i.delimiter)},Co=(e,t,n)=>{for(let r of xo(n)){let n=i.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},wo=(e,t,n,r)=>{let a=i.resolve(r,bo(n),`..`);t.includes(a)||e.push(a)},To=({env:e=u.env,...t}={})=>{e={...e};let n=yo({env:e});return t.path=e[n],e[n]=So(t),e},Eo=(e,t,n)=>new(n?No:Mo)(t,e instanceof Do?{}:{cause:e});var Do=class extends Error{};const Oo=(e,t)=>{Object.defineProperty(e.prototype,`name`,{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Ao,{value:!0,writable:!1,enumerable:!1,configurable:!1})},ko=e=>jo(e)&&Ao in e,Ao=Symbol(`isExecaError`),jo=e=>Object.prototype.toString.call(e)===`[object Error]`;var Mo=class extends Error{};Oo(Mo,Mo.name);var No=class extends Error{};Oo(No,No.name);const Po=()=>{let e=Lo-Io+1;return Array.from({length:e},Fo)},Fo=(e,t)=>({name:`SIGRT${t+1}`,number:Io+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),Io=34,Lo=64,Ro=[{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`}],zo=()=>{let e=Po();return[...Ro,...e].map(Bo)},Bo=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=g,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},Vo=()=>{let e=zo();return Object.fromEntries(e.map(Ho))},Ho=({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}],Uo=Vo(),Wo=()=>{let e=zo(),t=Array.from({length:65},(t,n)=>Go(n,e));return Object.assign({},...t)},Go=(e,t)=>{let n=Ko(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}}},Ko=(e,t)=>{let n=t.find(({name:t})=>g.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};Wo();const qo=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Yo(e,t)},Jo=e=>e===0?e:Yo(e,"`subprocess.kill()`'s argument"),Yo=(e,t)=>{if(Number.isInteger(e))return Xo(e,t);if(typeof e==`string`)return Qo(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${$o()}`)},Xo=(e,t)=>{if(Zo.has(e))return Zo.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${$o()}`)},Zo=new Map(Object.entries(g.signals).reverse().map(([e,t])=>[t,e])),Qo=(e,t)=>{if(e in g.signals)return e;throw e.toUpperCase()in g.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${$o()}`)},$o=()=>`Available signal names: ${es()}.
|
|
90
|
+
Available signal numbers: ${ts()}.`,es=()=>Object.keys(g.signals).sort().map(e=>`'${e}'`).join(`, `),ts=()=>[...new Set(Object.values(g.signals).sort((e,t)=>e-t))].join(`, `),ns=e=>Uo[e].description,rs=e=>{if(e===!1)return e;if(e===!0)return is;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},is=1e3*5,as=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=os(o,s,n);ss(l,r);let u=e(c);return cs({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},os=(e,t,n)=>{let[r=n,i]=jo(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&&!jo(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Jo(r),error:i}},ss=(e,t)=>{e!==void 0&&t.reject(e)},cs=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&ls({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},ls=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await me(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??=!0)}catch{}},us=async(e,t)=>{e.aborted||await D(e,`abort`,{signal:t})},ds=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},fs=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[ps(e,t,r,i)],ps=async(e,t,n,{signal:r})=>{throw await us(t,r),n.terminationReason??=`cancel`,e.kill(),t.reason},ms=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{hs(e,t,n),gs(e,t,r)},hs=(e,t,n)=>{if(!n)throw Error(`${H(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},gs=(e,t,n)=>{if(!n)throw Error(`${H(e,t)} cannot be used: the ${U(t)} has already exited or disconnected.`)},_s=e=>{throw Error(`${H(`getOneMessage`,e)} could not complete: the ${U(e)} exited or disconnected.`)},vs=e=>{throw Error(`${H(`sendMessage`,e)} failed: the ${U(e)} is sending a message too, instead of listening to incoming messages.
|
|
91
91
|
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
92
92
|
|
|
93
93
|
const [receivedMessage] = await Promise.all([
|
|
94
|
-
${
|
|
95
|
-
${
|
|
96
|
-
]);`)},
|
|
94
|
+
${H(`getOneMessage`,e)},
|
|
95
|
+
${H(`sendMessage`,e,`message, {strict: true}`)},
|
|
96
|
+
]);`)},ys=(e,t)=>Error(`${H(`sendMessage`,t)} failed when sending an acknowledgment response to the ${U(t)}.`,{cause:e}),bs=e=>{throw Error(`${H(`sendMessage`,e)} failed: the ${U(e)} is not listening to incoming messages.`)},xs=e=>{throw Error(`${H(`sendMessage`,e)} failed: the ${U(e)} exited without listening to incoming messages.`)},Ss=()=>Error(`\`cancelSignal\` aborted: the ${U(!0)} disconnected.`),Cs=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},ws=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${H(t,n)} cannot be used: the ${U(n)} is disconnecting.`,{cause:e})},Ts=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(Es(e))throw Error(`${H(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},Es=({code:e,message:t})=>Ds.has(e)||Os.some(e=>t.includes(e)),Ds=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),Os=[`could not be cloned`,`circular structure`,`call stack size exceeded`],H=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${ks(t)}${e}(${n})`,ks=e=>e?``:`subprocess.`,U=e=>e?`parent process`:`subprocess`,As=e=>{e.connected&&e.disconnect()},js=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},Ms=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=Ps.get(e),i=Fs(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(Rs(i,t,n,!0));return a},Ns=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=Ps.get(e),i=Fs(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(Rs(i,t,n,!1));return a},Ps=new WeakMap,Fs=(e,t,n)=>{let r=Is(t,n);return Ls(r,t,n,e),r},Is=(e,t)=>{let n=sa(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(`"${Vs(t)}" must not be "${e}".
|
|
97
97
|
It must be ${r} or "fd3", "fd4" (and so on).
|
|
98
98
|
It is optional and defaults to "${i}".`)},Ls=(e,t,n,r)=>{let i=r[Bs(e)];if(i===void 0)throw TypeError(`"${Vs(n)}" must not be ${t}. That file descriptor does not exist.
|
|
99
99
|
Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction===`input`&&!n)throw TypeError(`"${Vs(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${Vs(n)}" must not be ${t}. It must be a writable stream, not readable.`)},Rs=(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}=zs(e,n);return`The "${i}: ${Hs(a)}" option is incompatible with using "${Vs(r)}: ${Hs(t)}".
|
|
100
|
-
Please set this option with "pipe" instead.`},zs=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=Bs(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]}},Bs=e=>e===`all`?1:e,Vs=e=>e?`to`:`from`,Hs=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,Us=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),ge(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},Ws=(e,t)=>{t&&Gs(e)},Gs=e=>{e.refCounted()},Ks=(e,t)=>{t&&qs(e)},qs=e=>{e.unrefCounted()},Js=(e,t)=>{t&&(qs(e),qs(e))},Ys=(e,t)=>{t&&(Gs(e),Gs(e))},Xs=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(sc(i)||Oc(i))return;Qs.has(e)||Qs.set(e,[]);let a=Qs.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await hc(e,r,i),await fe.yield();let o=await oc({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},Zs=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{Ac();let a=Qs.get(e);for(;a?.length>0;)await D(r,`message:done`);e.removeListener(`message`,i),Ys(t,n),r.connected=!1,r.emit(`disconnect`)},Qs=new WeakMap,$s=(e,t,n)=>{if(ec.has(e))return ec.get(e);let r=new he;return r.connected=!0,ec.set(e,r),tc({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},ec=new WeakMap,tc=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Xs.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,Zs.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Js(n,r)},nc=e=>{let t=ec.get(e);return t===void 0?e.channel!==null:t.connected},rc=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=_c(e,$s(e,t,n));return{id:ic++,type:dc,message:r,hasListeners:a}};let ic=0n;const ac=(e,t)=>{if(!(t?.type!==dc||t.hasListeners))for(let{id:t}of e)t!==void 0&&lc[t].resolve({isDeadlock:!0,hasListeners:!1})},oc=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==dc||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:fc,message:_c(t,i)};try{await yc({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},sc=e=>{if(e?.type!==fc)return!1;let{id:t,message:n}=e;return lc[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},cc=async(e,t,n)=>{if(e?.type!==dc)return;let r=js();lc[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,uc(t,n,i)]);e&&
|
|
100
|
+
Please set this option with "pipe" instead.`},zs=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=Bs(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]}},Bs=e=>e===`all`?1:e,Vs=e=>e?`to`:`from`,Hs=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,Us=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),ge(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},Ws=(e,t)=>{t&&Gs(e)},Gs=e=>{e.refCounted()},Ks=(e,t)=>{t&&qs(e)},qs=e=>{e.unrefCounted()},Js=(e,t)=>{t&&(qs(e),qs(e))},Ys=(e,t)=>{t&&(Gs(e),Gs(e))},Xs=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(sc(i)||Oc(i))return;Qs.has(e)||Qs.set(e,[]);let a=Qs.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await hc(e,r,i),await fe.yield();let o=await oc({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},Zs=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{Ac();let a=Qs.get(e);for(;a?.length>0;)await D(r,`message:done`);e.removeListener(`message`,i),Ys(t,n),r.connected=!1,r.emit(`disconnect`)},Qs=new WeakMap,$s=(e,t,n)=>{if(ec.has(e))return ec.get(e);let r=new he;return r.connected=!0,ec.set(e,r),tc({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},ec=new WeakMap,tc=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Xs.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,Zs.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Js(n,r)},nc=e=>{let t=ec.get(e);return t===void 0?e.channel!==null:t.connected},rc=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=_c(e,$s(e,t,n));return{id:ic++,type:dc,message:r,hasListeners:a}};let ic=0n;const ac=(e,t)=>{if(!(t?.type!==dc||t.hasListeners))for(let{id:t}of e)t!==void 0&&lc[t].resolve({isDeadlock:!0,hasListeners:!1})},oc=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==dc||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:fc,message:_c(t,i)};try{await yc({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},sc=e=>{if(e?.type!==fc)return!1;let{id:t,message:n}=e;return lc[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},cc=async(e,t,n)=>{if(e?.type!==dc)return;let r=js();lc[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,uc(t,n,i)]);e&&vs(n),a||bs(n)}finally{i.abort(),delete lc[e.id]}},lc={},uc=async(e,t,{signal:n})=>{Us(e,1,n),await D(e,`disconnect`,{signal:n}),xs(t)},dc=`execa:ipc:request`,fc=`execa:ipc:response`,pc=(e,t,n)=>{gc.has(e)||gc.set(e,new Set);let r=gc.get(e),i={onMessageSent:js(),id:n?t.id:void 0};return r.add(i),{outgoingMessages:r,outgoingMessage:i}},mc=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},hc=async(e,t,n)=>{for(;!_c(e,t)&&gc.get(e)?.size>0;){let t=[...gc.get(e)];ac(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},gc=new WeakMap,_c=(e,t)=>t.listenerCount(`message`)>vc(e),vc=e=>Ps.has(e)&&!fa(Ps.get(e).options.buffer,`ipc`)?1:0,yc=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return ms({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),bc({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},bc=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=rc({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=pc(e,o,a);try{await xc({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw As(e),t}finally{mc(s)}},xc=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=Sc(e);try{await Promise.all([cc(r,e,n),a(r)])}catch(e){throw ws({error:e,methodName:t,isSubprocess:n}),Ts({error:e,methodName:t,isSubprocess:n,message:i}),e}},Sc=e=>{if(Cc.has(e))return Cc.get(e);let t=le(e.send.bind(e));return Cc.set(e,t),t},Cc=new WeakMap,wc=(e,t)=>{let n=`cancelSignal`;return gs(n,!1,e.connected),xc({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:kc,message:t},message:t})},Tc=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await Ec({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),jc.signal),Ec=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!Dc){if(Dc=!0,!r){Cs();return}if(t===null){Ac();return}$s(e,t,n),await fe.yield()}};let Dc=!1;const Oc=e=>e?.type===kc?(jc.abort(e.message),!0):!1,kc=`execa:ipc:cancel`,Ac=()=>{jc.abort(Ss())},jc=new AbortController,Mc=({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.")}},Nc=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[Pc({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],Pc=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{throw await us(t,i),await wc(e,Fc(t)),ls({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??=`gracefulCancel`,t.reason},Fc=({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},Ic=({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})`)},Lc=(e,t,n,r)=>t===0||t===void 0?[]:[Rc(e,t,n,r)],Rc=async(e,t,n,{signal:r})=>{throw await me(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e.kill(),new Do},zc=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Bc=(e,t,{node:n=!1,nodePath:r=f,nodeOptions:a=d.filter(e=>!e.startsWith(`--inspect`)),cwd:o,execPath:s,...c})=>{if(s!==void 0)throw TypeError(`The "execPath" option has been removed. Please use the "nodePath" option instead.`);let l=Ci(r,`The "nodePath" option`),u=i.resolve(o,l),p={...c,nodePath:u,node:n,cwd:o};if(!n)return[e,t,p];if(i.basename(e,`.exe`)===`node`)throw TypeError(`When the "node" option is true, the first argument does not need to be "node".`);return[u,[...a,e,...t],{ipc:!0,...p,shell:!1}]},Vc=({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`.");Hc[n](e)}},Hc={advanced:e=>{try{ye(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},Uc=async(e,t)=>{t!==void 0&&await e.sendMessage(t)},Wc=({encoding:e})=>{if(qc.has(e))return;let t=Jc(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${Xc(e)}\`.
|
|
101
101
|
Please rename it to ${Xc(t)}.`);let n=[...qc].map(e=>Xc(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${Xc(e)}\`.
|
|
102
|
-
Please rename it to one of: ${n}.`)},Gc=new Set([`utf8`,`utf16le`]),Kc=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),qc=new Set([...Gc,...Kc]),Jc=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Yc)return Yc[t];if(qc.has(t))return t},Yc={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Xc=e=>typeof e==`string`?`"${e}"`:String(e),Zc=(e=Qc())=>{let t=
|
|
102
|
+
Please rename it to one of: ${n}.`)},Gc=new Set([`utf8`,`utf16le`]),Kc=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),qc=new Set([...Gc,...Kc]),Jc=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Yc)return Yc[t];if(qc.has(t))return t},Yc={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Xc=e=>typeof e==`string`?`"${e}"`:String(e),Zc=(e=Qc())=>{let t=Ci(e,`The "cwd" option`);return i.resolve(t)},Qc=()=>{try{return u.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},$c=(e,t)=>{if(t===Qc())return e;let n;try{n=re(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}`},el=(e,t,n)=>{n.cwd=Zc(n.cwd);let[r,a,o]=Bc(e,t,n),{command:s,args:c,options:l}=vo.default._parse(r,a,o),d=tl($i(l));return Ic(d),Wc(d),Vc(d),ds(d),Mc(d),d.shell=Ei(d.shell),d.env=nl(d),d.killSignal=qo(d.killSignal),d.forceKillAfterDelay=rs(d.forceKillAfterDelay),d.lines=d.lines.map((e,t)=>e&&!Kc.has(d.encoding)&&d.buffer[t]),u.platform===`win32`&&i.basename(s,`.exe`)===`cmd`&&c.unshift(`/q`),{file:s,commandArguments:c,options:d}},tl=({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}),nl=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{...u.env,...e}:e;return n||r?To({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o},rl=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function il(e){if(typeof e==`string`)return al(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return ol(e)}const al=e=>e.at(-1)===sl?e.slice(0,e.at(-2)===ll?-2:-1):e,ol=e=>e.at(-1)===cl?e.subarray(0,e.at(-2)===ul?-2:-1):e,sl=`
|
|
103
103
|
`,cl=`
|
|
104
|
-
`.codePointAt(0),ll=`\r`,ul=`\r`.codePointAt(0);function dl(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 fl(e,{checkOpen:t=!0}={}){return dl(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 pl(e,{checkOpen:t=!0}={}){return dl(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 ml(e,t){return fl(e,t)&&pl(e,t)}const hl=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var gl=class{#e;#t;#n=!1;#r=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){let t=()=>this.#a(e);return this.#r?this.#r.then(t,t):t()}async#i(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),e}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#a(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const _l=Symbol();function vl(){return this[_l].next()}Object.defineProperty(vl,`name`,{value:`next`});function yl(e){return this[_l].return(e)}Object.defineProperty(yl,`name`,{value:`return`});const bl=Object.create(hl,{next:{enumerable:!0,configurable:!0,writable:!0,value:vl},return:{enumerable:!0,configurable:!0,writable:!0,value:yl}});function xl({preventCancel:e=!1}={}){let t=new gl(this.getReader(),e),n=Object.create(bl);return n[_l]=t,n}const Sl=e=>{if(pl(e,{checkOpen:!1})&&El.on!==void 0)return wl(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(Cl.call(e)===`[object ReadableStream]`)return xl.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:Cl}=Object.prototype,wl=async function*(e){let t=new AbortController,n={};Tl(e,t,n);try{for await(let[n]of El.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()}},Tl=async(e,t,n)=>{try{await El.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},El={},Dl=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=Sl(e),u=t();u.length=0;try{for await(let e of l)kl({convertedChunk:n[jl(e)](e,u),state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c});return Ol({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}},Ol=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&kl({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},kl=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Al(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Al(c,t,i,a),new Nl},Al=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},jl=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=Ml.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Ml.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Ml}=Object.prototype;var Nl=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const Pl=e=>e,Fl=()=>void 0,Il=({contents:e})=>e,Ll=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},Rl=e=>e.length;async function zl(e,t){return Dl(e,Bl,t)}const Bl={init:()=>({contents:[]}),convertChunk:{string:Pl,buffer:Pl,arrayBuffer:Pl,dataView:Pl,typedArray:Pl,others:Pl},getSize:()=>1,truncateChunk:Fl,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:Fl,finalize:Il};async function Vl(e,t){return Dl(e,tu,t)}const Hl=()=>({contents:new ArrayBuffer(0)}),Ul=e=>Wl.encode(e),Wl=new TextEncoder,Gl=e=>new Uint8Array(e),Kl=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ql=(e,t)=>e.slice(0,t),Jl=(e,{contents:t,length:n},r)=>{let i=eu()?Xl(t,r):Yl(t,r);return new Uint8Array(i).set(e,n),i},Yl=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Zl(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Xl=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Zl(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},Zl=e=>Ql**Math.ceil(Math.log(e)/Math.log(Ql)),Ql=2,$l=({contents:e,length:t})=>eu()?e:e.slice(0,t),eu=()=>`resize`in ArrayBuffer.prototype,tu={init:Hl,convertChunk:{string:Ul,buffer:Gl,arrayBuffer:Gl,dataView:Kl,typedArray:Kl,others:Ll},getSize:Rl,truncateChunk:ql,addChunk:Jl,getFinalChunk:Fl,finalize:$l};async function nu(e,t){return Dl(e,au,t)}const ru=()=>({contents:``,textDecoder:new TextDecoder}),iu=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),au={init:ru,convertChunk:{string:Pl,buffer:iu,arrayBuffer:iu,dataView:iu,typedArray:iu,others:Ll},getSize:Rl,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:Il},ou=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof Nl))throw e;if(a===`all`)return e;throw e.maxBufferInfo={fdNumber:a,unit:su(n,r,i)},t.destroy(),e},su=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,cu=(e,t,n)=>{if(t.length!==n)return;let r=new Nl;throw r.maxBufferInfo={fdNumber:`ipc`},r},lu=(e,t)=>{let{streamName:n,threshold:r,unit:i}=uu(e,t);return`Command's ${n} was larger than ${r} ${i}`},uu=(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=
|
|
105
|
-
`)].map(e=>
|
|
104
|
+
`.codePointAt(0),ll=`\r`,ul=`\r`.codePointAt(0);function dl(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 fl(e,{checkOpen:t=!0}={}){return dl(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 pl(e,{checkOpen:t=!0}={}){return dl(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 ml(e,t){return fl(e,t)&&pl(e,t)}const hl=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var gl=class{#e;#t;#n=!1;#r=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){let t=()=>this.#a(e);return this.#r?this.#r.then(t,t):t()}async#i(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),e}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#a(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const _l=Symbol();function vl(){return this[_l].next()}Object.defineProperty(vl,`name`,{value:`next`});function yl(e){return this[_l].return(e)}Object.defineProperty(yl,`name`,{value:`return`});const bl=Object.create(hl,{next:{enumerable:!0,configurable:!0,writable:!0,value:vl},return:{enumerable:!0,configurable:!0,writable:!0,value:yl}});function xl({preventCancel:e=!1}={}){let t=new gl(this.getReader(),e),n=Object.create(bl);return n[_l]=t,n}const Sl=e=>{if(pl(e,{checkOpen:!1})&&El.on!==void 0)return wl(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(Cl.call(e)===`[object ReadableStream]`)return xl.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:Cl}=Object.prototype,wl=async function*(e){let t=new AbortController,n={};Tl(e,t,n);try{for await(let[n]of El.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()}},Tl=async(e,t,n)=>{try{await El.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},El={},Dl=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=Sl(e),u=t();u.length=0;try{for await(let e of l)kl({convertedChunk:n[jl(e)](e,u),state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c});return Ol({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}},Ol=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&kl({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},kl=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Al(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Al(c,t,i,a),new Nl},Al=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},jl=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=Ml.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Ml.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Ml}=Object.prototype;var Nl=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const Pl=e=>e,Fl=()=>void 0,Il=({contents:e})=>e,Ll=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},Rl=e=>e.length;async function zl(e,t){return Dl(e,Bl,t)}const Bl={init:()=>({contents:[]}),convertChunk:{string:Pl,buffer:Pl,arrayBuffer:Pl,dataView:Pl,typedArray:Pl,others:Pl},getSize:()=>1,truncateChunk:Fl,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:Fl,finalize:Il};async function Vl(e,t){return Dl(e,tu,t)}const Hl=()=>({contents:new ArrayBuffer(0)}),Ul=e=>Wl.encode(e),Wl=new TextEncoder,Gl=e=>new Uint8Array(e),Kl=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ql=(e,t)=>e.slice(0,t),Jl=(e,{contents:t,length:n},r)=>{let i=eu()?Xl(t,r):Yl(t,r);return new Uint8Array(i).set(e,n),i},Yl=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Zl(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Xl=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Zl(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},Zl=e=>Ql**Math.ceil(Math.log(e)/Math.log(Ql)),Ql=2,$l=({contents:e,length:t})=>eu()?e:e.slice(0,t),eu=()=>`resize`in ArrayBuffer.prototype,tu={init:Hl,convertChunk:{string:Ul,buffer:Gl,arrayBuffer:Gl,dataView:Kl,typedArray:Kl,others:Ll},getSize:Rl,truncateChunk:ql,addChunk:Jl,getFinalChunk:Fl,finalize:$l};async function nu(e,t){return Dl(e,au,t)}const ru=()=>({contents:``,textDecoder:new TextDecoder}),iu=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),au={init:ru,convertChunk:{string:Pl,buffer:iu,arrayBuffer:iu,dataView:iu,typedArray:iu,others:Ll},getSize:Rl,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:Il},ou=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof Nl))throw e;if(a===`all`)return e;throw e.maxBufferInfo={fdNumber:a,unit:su(n,r,i)},t.destroy(),e},su=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,cu=(e,t,n)=>{if(t.length!==n)return;let r=new Nl;throw r.maxBufferInfo={fdNumber:`ipc`},r},lu=(e,t)=>{let{streamName:n,threshold:r,unit:i}=uu(e,t);return`Command's ${n} was larger than ${r} ${i}`},uu=(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=fa(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:Qi(n),threshold:i,unit:r}},du=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>pu(n)),fu=(e,t,n)=>{if(!t)return e;let r=pu(n);return e.length>r?e.slice(0,r):e},pu=([,e])=>e,mu=({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=hu({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=_u(r,_),x=`${y}: ${s}${b===void 0?``:`\n${b}`}`;return{originalMessage:b,shortMessage:x,message:[x,...t===void 0?[e[2],e[1]]:[t],...e.slice(3),n.map(e=>vu(e)).join(`
|
|
105
|
+
`)].map(e=>xa(il(yu(e)))).filter(Boolean).join(`
|
|
106
106
|
|
|
107
|
-
`)}},hu=({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=gu(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?`${lu(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${
|
|
108
|
-
`):bu(e),bu=e=>typeof e==`string`?e:V(e)?Ni(e):``,xu=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>Tu({command:e,escapedCommand:t,cwd:a,durationMs:no(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:[]}),Su=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>Cu({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}),Cu=({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}=Eu(l,u),{originalMessage:w,shortMessage:T,message:E}=mu({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}),ee=To(e,E,b);return Object.assign(ee,wu({error:ee,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:x,signal:S,signalDescription:C,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:w,shortMessage:T})),ee},wu=({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:_})=>Tu({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:no(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:[]}),Tu=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),Eu=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t;return{exitCode:n,signal:r,signalDescription:r===void 0?void 0:ts(t)}},Du=e=>Number.isFinite(e)?e:0;function Ou(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(Du(e*1e3)%1e3),nanoseconds:Math.trunc(Du(e*1e6)%1e3)}}function ku(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 Au(e){switch(typeof e){case`number`:if(Number.isFinite(e))return Ou(e);break;case`bigint`:return ku(e)}throw TypeError(`Expected a finite number or bigint`)}const ju=e=>e===0||e===0n,Mu=(e,t)=>t===1||t===1n?e:`${e}s`,Nu=24n*60n*60n*1000n;function Pu(e,t){let n=typeof e==`bigint`;if(!n&&!Number.isFinite(e))throw TypeError(`Expected a finite number or bigint`);t={...t};let r=e<0?`-`:``;e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],a=(e,t)=>{let n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&ju(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?` `+Mu(n,e):r;i.push(a)}},s=Au(e),c=BigInt(s.days);if(t.hideYearAndDays?o(BigInt(c)*24n+BigInt(s.hours),`hour`,`h`):(t.hideYear?o(c,`day`,`d`):(o(c/365n,`year`,`y`),o(c%365n,`day`,`d`)),o(Number(s.hours),`hour`,`h`)),o(Number(s.minutes),`minute`,`m`),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(s.seconds),n=Number(s.milliseconds),r=Number(s.microseconds),i=Number(s.nanoseconds);if(o(e,`second`,`s`),t.formatSubMilliseconds)o(n,`millisecond`,`ms`),o(r,`microsecond`,`µs`),o(i,`nanosecond`,`ns`);else{let e=n+r/1e3+i/1e6,a=typeof t.millisecondsDecimalDigits==`number`?t.millisecondsDecimalDigits:0,s=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);o(Number.parseFloat(s),`millisecond`,`ms`,s)}}else{let r=a((n?Number(e%Nu):e)/1e3%60,typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?r:r.replace(/\.0+$/,``);o(Number.parseFloat(i),`second`,`s`,i)}if(i.length===0)return r+`0`+(t.verbose?` milliseconds`:`ms`);let l=t.colonNotation?`:`:` `;return typeof t.unitCount==`number`&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(l)}const Fu=(e,t)=>{e.failed&&Wa({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},Iu=(e,t)=>{fa(t)&&(Fu(e,t),Lu(e,t))},Lu=(e,t)=>{Wa({type:`duration`,verboseMessage:`(done in ${Pu(e.durationMs)})`,verboseInfo:t,result:e})},Ru=(e,t,{reject:n})=>{if(Iu(e,t),e.failed&&n)throw e;return e},zu=(e,t)=>Ju(e)?`asyncGenerator`:Yu(e)?`generator`:Zu(e)?`fileUrl`:$u(e)?`filePath`:od(e)?`webStream`:dl(e,{checkOpen:!1})?`native`:V(e)?`uint8Array`:cd(e)?`asyncIterable`:ld(e)?`iterable`:sd(e)?Hu({transform:e},t):Xu(e)?Bu(e,t):`native`,Bu=(e,t)=>ml(e.transform,{checkOpen:!1})?Vu(e,t):sd(e.transform)?Hu(e,t):Gu(e,t),Vu=(e,t)=>(Uu(e,t,`Duplex stream`),`duplex`),Hu=(e,t)=>(Uu(e,t,`web TransformStream`),`webTransform`),Uu=({final:e,binary:t,objectMode:n},r,i)=>{Wu(e,`${r}.final`,i),Wu(t,`${r}.binary`,i),Ku(n,`${r}.objectMode`)},Wu=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Gu=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!qu(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(ml(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(sd(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!qu(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return Ku(n,`${i}.binary`),Ku(r,`${i}.objectMode`),Ju(e)||Ju(t)?`asyncGenerator`:`generator`},Ku=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},qu=e=>Ju(e)||Yu(e),Ju=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Yu=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Xu=e=>B(e)&&(e.transform!==void 0||e.final!==void 0),Zu=e=>Object.prototype.toString.call(e)===`[object URL]`,Qu=e=>Zu(e)&&e.protocol!==`file:`,$u=e=>B(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>ed.has(e))&&td(e.file),ed=new Set([`file`,`append`]),td=e=>typeof e==`string`,nd=(e,t)=>e===`native`&&typeof t==`string`&&!rd.has(t),rd=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),id=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,ad=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,od=e=>id(e)||ad(e),sd=e=>id(e?.readable)&&ad(e?.writable),cd=e=>ud(e)&&typeof e[Symbol.asyncIterator]==`function`,ld=e=>ud(e)&&typeof e[Symbol.iterator]==`function`,ud=e=>typeof e==`object`&&!!e,dd=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),fd=new Set([`fileUrl`,`filePath`,`fileNumber`]),pd=new Set([`fileUrl`,`filePath`]),md=new Set([...pd,`webStream`,`nodeStream`]),hd=new Set([`webTransform`,`duplex`]),gd={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`},_d=(e,t,n,r)=>r===`output`?vd(e,t,n):yd(e,t,n),vd=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},yd=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},bd=(e,t)=>{let n=e.findLast(({type:e})=>dd.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},xd=(e,t,n,r)=>[...e.filter(({type:e})=>!dd.has(e)),...Sd(e,t,n,r)],Sd=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>dd.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=Cd({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return Dd(a,n)},Cd=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?wd({stdioItem:e,optionName:i}):t===`webTransform`?Td({stdioItem:e,index:n,newTransforms:r,direction:a}):Ed({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),wd=({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}}},Td=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=B(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=_d(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},Ed=({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}=B(t)?t:{transform:t},d=c||Kc.has(a),{writableObjectMode:f,readableObjectMode:p}=_d(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Dd=(e,t)=>t===`input`?e.reverse():e,Od=(e,t,n)=>{let r=e.map(e=>kd(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)??Fd},kd=({type:e,value:t},n)=>Ad[n]??Nd[e](t),Ad=[`input`,`output`,`output`],jd=()=>void 0,Md=()=>`input`,Nd={generator:jd,asyncGenerator:jd,fileUrl:jd,filePath:jd,iterable:Md,asyncIterable:Md,uint8Array:Md,webStream:e=>ad(e)?`output`:`input`,nodeStream(e){return pl(e,{checkOpen:!1})?fl(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:jd,duplex:jd,native(e){let t=Pd(e);if(t!==void 0)return t;if(dl(e,{checkOpen:!1}))return Nd.nodeStream(e)}},Pd=e=>{if([0,u.stdin].includes(e))return`input`;if([1,2,u.stdout,u.stderr].includes(e))return`output`},Fd=`output`,Id=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e,Ld=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=Rd(e,r).map((e,t)=>Bd(e,t));return a?Vd(o,n,i):Id(o,t)},Rd=(e,t)=>{if(e===void 0)return H.map(e=>t[e]);if(zd(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${H.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,H.length);return Array.from({length:n},(t,n)=>e[n])},zd=e=>H.some(t=>e[t]!==void 0),Bd=(e,t)=>Array.isArray(e)?e.map(e=>Bd(e,t)):e??(t>=H.length?`ignore`:`pipe`),Vd=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!pa(n,r)&&Hd(e)?`ignore`:e),Hd=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`),Ud=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?Wd({stdioItem:e,fdNumber:r,direction:i}):qd({stdioItem:e,fdNumber:r}),Wd=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=Gd({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(dl(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},Gd=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=Kd(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(v.isatty(i))throw TypeError(`The \`${t}: ${Hs(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:ki(te(i)),optionName:t}}},Kd=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Xi.indexOf(e);if(n!==-1)return n},qd=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:Jd(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:Jd(t,t,n),optionName:n}:dl(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,Jd=(e,t,n)=>{let r=Xi[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},Yd=({input:e,inputFile:t},n)=>n===0?[...Xd(e),...Qd(t)]:[],Xd=e=>e===void 0?[]:[{type:Zd(e),value:e,optionName:`input`}],Zd=e=>{if(pl(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(V(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Qd=e=>e===void 0?[]:[{...$d(e),optionName:`inputFile`}],$d=e=>{if(Zu(e))return{type:`fileUrl`,value:e};if(td(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},ef=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),tf=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=nf(i,e);if(o.length!==0){if(a){rf({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(md.has(e))return af({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});hd.has(e)&&sf({otherStdioItems:o,type:e,value:t,optionName:n})}},nf=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),rf=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{pd.has(t)&&af({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},af=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>of(e,n));if(a.length!==0)return cf(a.find(e=>e.direction!==i),r,t),i===`output`?a[0].stream:void 0},of=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,sf=({otherStdioItems:e,type:t,value:n,optionName:r})=>{cf(e.find(({value:{transform:e}})=>e===n.transform),r,t)},cf=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${gd[n]} that is the same.`)},lf=(e,t,n,r)=>{let i=vf({initialFileDescriptors:Ld(t,n,r).map((e,n)=>uf({stdioOption:e,fdNumber:n,options:t,isSync:r})),addProperties:e,options:t,isSync:r});return t.stdio=i.map(({stdioItems:e})=>Sf(e)),i},uf=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Zi(t),{stdioItems:a,isStdioArray:o}=df({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=Od(a,t,i),c=xd(a.map(e=>Ud({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),i,s,n),l=bd(c,s);return _f(c,l),{direction:s,objectMode:l,stdioItems:c}},df=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=ef([...(Array.isArray(e)?e:[e]).map(e=>ff(e,r)),...Yd(n,t)]),a=i.length>1;return pf(i,a,r),hf(i),{stdioItems:i,isStdioArray:a}},ff=(e,t)=>({type:zu(e,t),value:e,optionName:t}),pf=(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(mf.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},mf=new Set([`ignore`,`ipc`]),hf=e=>{for(let t of e)gf(t)},gf=({type:e,value:t,optionName:n})=>{if(Qu(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
109
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(nd(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},_f=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>fd.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},vf=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(yf({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw xf(i),e}},yf=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>({direction:e,objectMode:t,stdioItems:n.map(t=>bf({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}))}),bf=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=tf({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},xf=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!
|
|
107
|
+
`)}},hu=({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=gu(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?`${lu(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${ns(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}`},gu=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,_u=(e,t)=>{if(e instanceof Do)return;let n=xa($c(ko(e)?e.originalMessage:String(e?.message??e),t));return n===``?void 0:n},vu=e=>typeof e==`string`?e:ce(e),yu=e=>Array.isArray(e)?e.map(e=>il(bu(e))).filter(Boolean).join(`
|
|
108
|
+
`):bu(e),bu=e=>typeof e==`string`?e:B(e)?Pi(e):``,xu=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>Tu({command:e,escapedCommand:t,cwd:a,durationMs:ro(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:[]}),Su=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>Cu({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}),Cu=({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}=Eu(l,u),{originalMessage:w,shortMessage:T,message:E}=mu({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}),ee=Eo(e,E,b);return Object.assign(ee,wu({error:ee,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:x,signal:S,signalDescription:C,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:w,shortMessage:T})),ee},wu=({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:_})=>Tu({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:ro(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:[]}),Tu=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),Eu=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t;return{exitCode:n,signal:r,signalDescription:r===void 0?void 0:ns(t)}},Du=e=>Number.isFinite(e)?e:0;function Ou(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(Du(e*1e3)%1e3),nanoseconds:Math.trunc(Du(e*1e6)%1e3)}}function ku(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 Au(e){switch(typeof e){case`number`:if(Number.isFinite(e))return Ou(e);break;case`bigint`:return ku(e)}throw TypeError(`Expected a finite number or bigint`)}const ju=e=>e===0||e===0n,Mu=(e,t)=>t===1||t===1n?e:`${e}s`,Nu=24n*60n*60n*1000n;function Pu(e,t){let n=typeof e==`bigint`;if(!n&&!Number.isFinite(e))throw TypeError(`Expected a finite number or bigint`);t={...t};let r=e<0?`-`:``;e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],a=(e,t)=>{let n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&ju(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?` `+Mu(n,e):r;i.push(a)}},s=Au(e),c=BigInt(s.days);if(t.hideYearAndDays?o(BigInt(c)*24n+BigInt(s.hours),`hour`,`h`):(t.hideYear?o(c,`day`,`d`):(o(c/365n,`year`,`y`),o(c%365n,`day`,`d`)),o(Number(s.hours),`hour`,`h`)),o(Number(s.minutes),`minute`,`m`),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(s.seconds),n=Number(s.milliseconds),r=Number(s.microseconds),i=Number(s.nanoseconds);if(o(e,`second`,`s`),t.formatSubMilliseconds)o(n,`millisecond`,`ms`),o(r,`microsecond`,`µs`),o(i,`nanosecond`,`ns`);else{let e=n+r/1e3+i/1e6,a=typeof t.millisecondsDecimalDigits==`number`?t.millisecondsDecimalDigits:0,s=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);o(Number.parseFloat(s),`millisecond`,`ms`,s)}}else{let r=a((n?Number(e%Nu):e)/1e3%60,typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?r:r.replace(/\.0+$/,``);o(Number.parseFloat(i),`second`,`s`,i)}if(i.length===0)return r+`0`+(t.verbose?` milliseconds`:`ms`);let l=t.colonNotation?`:`:` `;return typeof t.unitCount==`number`&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(l)}const Fu=(e,t)=>{e.failed&&Ga({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},Iu=(e,t)=>{pa(t)&&(Fu(e,t),Lu(e,t))},Lu=(e,t)=>{Ga({type:`duration`,verboseMessage:`(done in ${Pu(e.durationMs)})`,verboseInfo:t,result:e})},Ru=(e,t,{reject:n})=>{if(Iu(e,t),e.failed&&n)throw e;return e},zu=(e,t)=>Ju(e)?`asyncGenerator`:Yu(e)?`generator`:Zu(e)?`fileUrl`:$u(e)?`filePath`:od(e)?`webStream`:dl(e,{checkOpen:!1})?`native`:B(e)?`uint8Array`:cd(e)?`asyncIterable`:ld(e)?`iterable`:sd(e)?Hu({transform:e},t):Xu(e)?Bu(e,t):`native`,Bu=(e,t)=>ml(e.transform,{checkOpen:!1})?Vu(e,t):sd(e.transform)?Hu(e,t):Gu(e,t),Vu=(e,t)=>(Uu(e,t,`Duplex stream`),`duplex`),Hu=(e,t)=>(Uu(e,t,`web TransformStream`),`webTransform`),Uu=({final:e,binary:t,objectMode:n},r,i)=>{Wu(e,`${r}.final`,i),Wu(t,`${r}.binary`,i),Ku(n,`${r}.objectMode`)},Wu=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Gu=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!qu(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(ml(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(sd(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!qu(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return Ku(n,`${i}.binary`),Ku(r,`${i}.objectMode`),Ju(e)||Ju(t)?`asyncGenerator`:`generator`},Ku=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},qu=e=>Ju(e)||Yu(e),Ju=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Yu=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Xu=e=>z(e)&&(e.transform!==void 0||e.final!==void 0),Zu=e=>Object.prototype.toString.call(e)===`[object URL]`,Qu=e=>Zu(e)&&e.protocol!==`file:`,$u=e=>z(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>ed.has(e))&&td(e.file),ed=new Set([`file`,`append`]),td=e=>typeof e==`string`,nd=(e,t)=>e===`native`&&typeof t==`string`&&!rd.has(t),rd=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),id=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,ad=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,od=e=>id(e)||ad(e),sd=e=>id(e?.readable)&&ad(e?.writable),cd=e=>ud(e)&&typeof e[Symbol.asyncIterator]==`function`,ld=e=>ud(e)&&typeof e[Symbol.iterator]==`function`,ud=e=>typeof e==`object`&&!!e,dd=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),fd=new Set([`fileUrl`,`filePath`,`fileNumber`]),pd=new Set([`fileUrl`,`filePath`]),md=new Set([...pd,`webStream`,`nodeStream`]),hd=new Set([`webTransform`,`duplex`]),gd={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`},_d=(e,t,n,r)=>r===`output`?vd(e,t,n):yd(e,t,n),vd=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},yd=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},bd=(e,t)=>{let n=e.findLast(({type:e})=>dd.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},xd=(e,t,n,r)=>[...e.filter(({type:e})=>!dd.has(e)),...Sd(e,t,n,r)],Sd=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>dd.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=Cd({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return Dd(a,n)},Cd=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?wd({stdioItem:e,optionName:i}):t===`webTransform`?Td({stdioItem:e,index:n,newTransforms:r,direction:a}):Ed({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),wd=({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}}},Td=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=z(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=_d(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},Ed=({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}=z(t)?t:{transform:t},d=c||Kc.has(a),{writableObjectMode:f,readableObjectMode:p}=_d(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Dd=(e,t)=>t===`input`?e.reverse():e,Od=(e,t,n)=>{let r=e.map(e=>kd(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)??Fd},kd=({type:e,value:t},n)=>Ad[n]??Nd[e](t),Ad=[`input`,`output`,`output`],jd=()=>void 0,Md=()=>`input`,Nd={generator:jd,asyncGenerator:jd,fileUrl:jd,filePath:jd,iterable:Md,asyncIterable:Md,uint8Array:Md,webStream:e=>ad(e)?`output`:`input`,nodeStream(e){return pl(e,{checkOpen:!1})?fl(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:jd,duplex:jd,native(e){let t=Pd(e);if(t!==void 0)return t;if(dl(e,{checkOpen:!1}))return Nd.nodeStream(e)}},Pd=e=>{if([0,u.stdin].includes(e))return`input`;if([1,2,u.stdout,u.stderr].includes(e))return`output`},Fd=`output`,Id=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e,Ld=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=Rd(e,r).map((e,t)=>Bd(e,t));return a?Vd(o,n,i):Id(o,t)},Rd=(e,t)=>{if(e===void 0)return V.map(e=>t[e]);if(zd(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${V.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,V.length);return Array.from({length:n},(t,n)=>e[n])},zd=e=>V.some(t=>e[t]!==void 0),Bd=(e,t)=>Array.isArray(e)?e.map(e=>Bd(e,t)):e??(t>=V.length?`ignore`:`pipe`),Vd=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!ma(n,r)&&Hd(e)?`ignore`:e),Hd=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`),Ud=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?Wd({stdioItem:e,fdNumber:r,direction:i}):qd({stdioItem:e,fdNumber:r}),Wd=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=Gd({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(dl(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},Gd=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=Kd(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(v.isatty(i))throw TypeError(`The \`${t}: ${Hs(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:Ai(te(i)),optionName:t}}},Kd=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Zi.indexOf(e);if(n!==-1)return n},qd=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:Jd(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:Jd(t,t,n),optionName:n}:dl(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,Jd=(e,t,n)=>{let r=Zi[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},Yd=({input:e,inputFile:t},n)=>n===0?[...Xd(e),...Qd(t)]:[],Xd=e=>e===void 0?[]:[{type:Zd(e),value:e,optionName:`input`}],Zd=e=>{if(pl(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(B(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Qd=e=>e===void 0?[]:[{...$d(e),optionName:`inputFile`}],$d=e=>{if(Zu(e))return{type:`fileUrl`,value:e};if(td(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},ef=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),tf=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=nf(i,e);if(o.length!==0){if(a){rf({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(md.has(e))return af({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});hd.has(e)&&sf({otherStdioItems:o,type:e,value:t,optionName:n})}},nf=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),rf=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{pd.has(t)&&af({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},af=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>of(e,n));if(a.length!==0)return cf(a.find(e=>e.direction!==i),r,t),i===`output`?a[0].stream:void 0},of=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,sf=({otherStdioItems:e,type:t,value:n,optionName:r})=>{cf(e.find(({value:{transform:e}})=>e===n.transform),r,t)},cf=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${gd[n]} that is the same.`)},lf=(e,t,n,r)=>{let i=vf({initialFileDescriptors:Ld(t,n,r).map((e,n)=>uf({stdioOption:e,fdNumber:n,options:t,isSync:r})),addProperties:e,options:t,isSync:r});return t.stdio=i.map(({stdioItems:e})=>Sf(e)),i},uf=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Qi(t),{stdioItems:a,isStdioArray:o}=df({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=Od(a,t,i),c=xd(a.map(e=>Ud({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),i,s,n),l=bd(c,s);return _f(c,l),{direction:s,objectMode:l,stdioItems:c}},df=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=ef([...(Array.isArray(e)?e:[e]).map(e=>ff(e,r)),...Yd(n,t)]),a=i.length>1;return pf(i,a,r),hf(i),{stdioItems:i,isStdioArray:a}},ff=(e,t)=>({type:zu(e,t),value:e,optionName:t}),pf=(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(mf.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},mf=new Set([`ignore`,`ipc`]),hf=e=>{for(let t of e)gf(t)},gf=({type:e,value:t,optionName:n})=>{if(Qu(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
109
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(nd(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},_f=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>fd.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},vf=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(yf({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw xf(i),e}},yf=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>({direction:e,objectMode:t,stdioItems:n.map(t=>bf({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}))}),bf=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=tf({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},xf=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!Xi(e)&&e.destroy()},Sf=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`},Cf=(e,t)=>lf(Df,e,t,!0),W=({type:e,optionName:t})=>{Tf(t,gd[e])},wf=({optionName:e,value:t})=>((t===`ipc`||t===`overlapped`)&&Tf(e,`"${t}"`),{}),Tf=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Ef={generator(){},asyncGenerator:W,webStream:W,nodeStream:W,webTransform:W,duplex:W,asyncIterable:W,native:wf},Df={input:{...Ef,fileUrl:({value:e})=>({contents:[Ai(te(e))]}),filePath:({value:{file:e}})=>({contents:[Ai(te(e))]}),fileNumber:W,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Ef,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:W,string:W,uint8Array:W}},Of=(e,{stripFinalNewline:t},n)=>kf(t,n)&&e!==void 0&&!Array.isArray(e)?il(e):e,kf=(e,t)=>t===`all`?e[1]||e[2]:e[t],Af=(e,t,n,r)=>e||n?void 0:Nf(t,r),jf=(e,t,n)=>n?e.flatMap(e=>Mf(e,t)):Mf(e,t),Mf=(e,t)=>{let{transform:n,final:r}=Nf(t,{});return[...n(e),...r()]},Nf=(e,t)=>(t.previousChunks=``,{transform:Pf.bind(void 0,t,e),final:If.bind(void 0,t)}),Pf=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]===`
|
|
110
110
|
`){let o=Ff(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=zf(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=zf(r,n.slice(i+1))),e.previousChunks=r},Ff=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),If=function*({previousChunks:e}){e.length>0&&(yield e)},Lf=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:Rf.bind(void 0,r)},Rf=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?Bf:Vf;if(t.at(-1)===i){yield t;return}yield a(t,e?r:n)},zf=(e,t)=>`${e}${t}`,Bf={windowsNewline:`\r
|
|
111
111
|
`,unixNewline:`
|
|
112
112
|
`,LF:`
|
|
113
|
-
`,concatBytes:zf},Vf={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}},Hf=(e,t)=>e?void 0:Uf.bind(void 0,t),Uf=function*(e,t){if(typeof t!=`string`&&!
|
|
113
|
+
`,concatBytes:zf},Vf={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}},Hf=(e,t)=>e?void 0:Uf.bind(void 0,t),Uf=function*(e,t){if(typeof t!=`string`&&!B(t)&&!De.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Wf=(e,t)=>e?Gf.bind(void 0,t):Kf.bind(void 0,t),Gf=function*(e,t){qf(e,t),yield t},Kf=function*(e,t){if(qf(e,t),typeof t!=`string`&&!B(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},qf=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
|
|
114
114
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
115
|
-
if (condition) { yield value; }`)},Jf=(e,t,n)=>{if(n)return;if(e)return{transform:Yf.bind(void 0,new TextEncoder)};let r=new de(t);return{transform:Xf.bind(void 0,r),final:Zf.bind(void 0,r)}},Yf=function*(e,t){Ee.isBuffer(t)?yield ki(t):typeof t==`string`?yield e.encode(t):yield t},Xf=function*(e,t){yield V(t)?e.write(t):t},Zf=function*(e){let t=e.end();t!==``&&(yield t)},Qf=oe(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),$f=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=rp}=t[n];for await(let i of r(e))yield*$f(i,t,n+1)},ep=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*tp(n,Number(t),e)},tp=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*$f(r,n,t+1)},np=oe(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),rp=function*(e){yield e},ip=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},ap=(e,t)=>[...t.flatMap(t=>[...op(t,e,0)]),...sp(e)],op=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=lp}=t[n];for(let i of r(e))yield*op(i,t,n+1)},sp=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*cp(n,Number(t),e)},cp=function*(e,t,n){if(e!==void 0)for(let r of e())yield*op(r,n,t+1)},lp=function*(e){yield e},up=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=fp(e,o,a),l=Ju(t),u=Ju(n),d=l?Qf.bind(void 0,$f,s):ip.bind(void 0,op),f=l||u?Qf.bind(void 0,ep,s):ip.bind(void 0,sp),p=l||u?np.bind(void 0,s):void 0;return{stream:new Ce({writableObjectMode:r,writableHighWaterMark:Te(r),readableObjectMode:i,readableHighWaterMark:Te(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},dp=(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)e=ap(fp(t,n,r),e);return e},fp=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:Hf(r,s)},Jf(n,o,r),Af(n,a,r,c),{transform:e,final:t},{transform:Wf(i,s)},Lf({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},pp=(e,t)=>{for(let n of mp(e))hp(e,n,t)},mp=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),hp=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length!==0){if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${gd[e]} with synchronous methods.`)}n.input=Ii(i.map(({contents:e})=>e).map(e=>gp(e,r)))}},gp=(e,t)=>{let n=dp(e,t,`utf8`,!0);return _p(n),Ii(n)},_p=e=>{let t=e.find(e=>typeof e!=`string`&&!V(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}.`)},vp=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&pa(n,r)&&!Kc.has(t)&&yp(r)&&(e.some(({type:e,value:t})=>e===`native`&&bp.has(t))||e.every(({type:e})=>dd.has(e))),yp=e=>e===1||e===2,bp=new Set([`pipe`,`overlapped`]),xp=async(e,t,n,r)=>{for await(let i of e)Cp(t)||wp(i,n,r)},Sp=(e,t,n)=>{for(let r of e)wp(r,t,n)},Cp=e=>e._readableState.pipes.length>0,wp=(e,t,n)=>{Wa({type:`output`,verboseMessage:Ja(e),fdNumber:t,verboseInfo:n})},Tp=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set([]);return{output:t.map((t,s)=>Ep({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},Ep=({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=ki(fu(e,a,d)),{stdioItems:p,objectMode:m}=t[n],{serializedResult:h,finalResult:g=h}=Op({chunks:Dp([f],p,c,r),objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});kp({serializedResult:h,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});let _=s[n]?g:void 0;try{return r.error===void 0&&Ap(h,p,i),_}catch(e){return r.error=e,_}},Dp=(e,t,n,r)=>{try{return dp(e,t,n,!1)}catch(t){return r.error=t,e}},Op=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:Ii(e)};let o=Pi(e,n);return r[a]?{serializedResult:o,finalResult:jf(o,!i[a],t)}:{serializedResult:o}},kp=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!vp({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=jf(e,!1,o);try{Sp(s,t,r)}catch(e){n.error??=e}},Ap=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>fd.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?T(r,e):(n.add(t),ie(r,e))}},jp=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Of(t,n,`all`)]:Array.isArray(t)?[Of(e,n,`all`),...t]:V(e)&&V(t)?Ri([e,t]):`${e}${t}`},Mp=async(e,t)=>{let[n,r]=await Np(e);return t.isForcefullyTerminated??=!1,[n,r]},Np=async e=>{let[t,n]=await Promise.allSettled([D(e,`spawn`),D(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Pp(e):n.value},Pp=async e=>{try{return await D(e,`exit`)}catch{return Pp(e)}},Fp=async e=>{let[t,n]=await e;if(!Ip(t,n)&&Lp(t,n))throw new Eo;return[t,n]},Ip=(e,t)=>e===void 0&&t===void 0,Lp=(e,t)=>e!==0||t!==null,Rp=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=zp(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:du(a,r,i)}},zp=(e,t,n)=>e===void 0?Lp(t,n)?new Eo:void 0:e,Bp=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=Vp(e,t,n);return Ru(Gp({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},Vp=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=ro(e,t,n),{file:s,commandArguments:c,options:l}=el(e,t,Hp(n));return Up(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:Cf(l,o)}},Hp=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,Up=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Wp(`ipcInput`),e&&Wp(`ipc: true`),n&&Wp(`detached: true`),r&&Wp(`cancelSignal`)},Wp=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Gp=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=Kp({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}=Rp(c,n),{output:m,error:h=l}=Tp({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a});return Jp({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:m.map((e,t)=>Of(e,n,t)),all:Of(jp(m,n),n,`all`),options:n,command:r,escapedCommand:i,startTime:s})},Kp=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return pp(a,n),w(...rl(e,t,qp(n)))}catch(e){return Su({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},qp=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:pu(t)}),Jp=({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?xu({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):Cu({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}),Yp=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(ps({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:nc(e)}),Xp({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),Xp=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Ws(t,i);let a=$s(e,t,n),o=new AbortController;try{return await Promise.race([Zp(a,r,o),Qp(a,n,o),$p(a,n,o)])}catch(t){throw As(e),t}finally{o.abort(),Ks(t,i)}},Zp=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await D(e,`message`,{signal:n});return t}for await(let[r]of _e(e,`message`,{signal:n}))if(t(r))return r},Qp=async(e,t,{signal:n})=>{await D(e,`disconnect`,{signal:n}),gs(t)},$p=async(e,t,{signal:n})=>{let[r]=await D(e,`strict:error`,{signal:n});throw vs(r,t)},em=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>tm({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),tm=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{ps({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:nc(e)}),Ws(t,a);let o=$s(e,t,n),s=new AbortController,c={};return nm(e,o,s),rm({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),im({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},nm=async(e,t,n)=>{try{await D(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},rm=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await D(e,`strict:error`,{signal:n.signal});r.error=vs(i,t),n.abort()}catch{}},im=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of _e(n,`message`,{signal:a.signal}))am(o),yield e}catch{am(o)}finally{a.abort(),Ks(t,s),r||As(e),i&&await e}},am=({error:e})=>{if(e)throw e},om=(e,{ipc:t})=>{Object.assign(e,cm(e,!1,t))},sm=()=>{let e=u,t=u.channel!==void 0;return{...cm(e,!0,t),getCancelSignal:Tc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},cm=(e,t,n)=>({sendMessage:yc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:Yp.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:em.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),lm=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:o})=>{xf(r);let s=new b;return um(s,r),Object.assign(s,{readable:fm,writable:pm,duplex:mm}),{subprocess:s,promise:hm(Su({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1}),o,i)}},um=(e,t)=>{let n=dm(),r=dm(),i=dm(),a=Array.from({length:t.length-3},dm),o=dm(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},dm=()=>{let e=new xe;return e.end(),e},fm=()=>new Se({read(){}}),pm=()=>new we({write(){}}),mm=()=>new be({read(){},write(){}}),hm=async(e,t,n)=>Ru(e,t,n),gm=(e,t)=>lf(ym,e,t,!1),_m=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${gd[e]}.`)},vm={fileNumber:_m,generator:up,asyncGenerator:up,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:be.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},ym={input:{...vm,fileUrl:({value:e})=>({stream:E(e)}),filePath:({value:{file:e}})=>({stream:E(e)}),webStream:({value:e})=>({stream:Se.fromWeb(e)}),iterable:({value:e})=>({stream:Se.from(e)}),asyncIterable:({value:e})=>({stream:Se.from(e)}),string:({value:e})=>({stream:Se.from(e)}),uint8Array:({value:e})=>({stream:Se.from(Ee.from(e))})},output:{...vm,fileUrl:({value:e})=>({stream:ee(e)}),filePath:({value:{file:e,append:t}})=>({stream:ee(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:we.fromWeb(e)}),iterable:_m,asyncIterable:_m,string:_m,uint8Array:_m}};function bm(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Em(t);let t=e.some(({readableObjectMode:e})=>e),n=xm(e,t),r=new Sm({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const xm=(e,t)=>{if(e.length===0)return Te(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)};var Sm=class extends xe{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#i=Symbol(`unpipe`);#a=new WeakMap;add(e){if(Em(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Cm(this,this.#e,this.#i);let t=Dm({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#i});this.#a.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Em(e),!this.#e.has(e))return!1;let t=this.#a.get(e);return t===void 0?!1:(this.#a.delete(e),e.unpipe(this),await t,!0)}};const Cm=async(e,t,n)=>{Lm(e,Rm);let r=new AbortController;try{await Promise.race([wm(e,r),Tm(e,t,n,r)])}finally{r.abort(),Lm(e,-Rm)}},wm=async(e,{signal:t})=>{try{await O(e,{signal:t,cleanup:!0})}catch(t){throw Mm(e,t),t}},Tm=async(e,t,n,{signal:r})=>{for await(let[i]of _e(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Em=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Dm=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{Lm(e,zm);let s=new AbortController;try{await Promise.race([Om(a,t,s),km({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),Am({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),Lm(e,-zm)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Pm(e):jm(e))},Om=async(e,t,{signal:n})=>{try{await e,n.aborted||Pm(t)}catch(e){n.aborted||Mm(t,e)}},km=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await O(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;Nm(r)?i.add(t):Fm(e,r)}},Am=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await D(e,i,{signal:a}),!e.readable)return D(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},jm=e=>{e.writable&&e.end()},Mm=(e,t)=>{Nm(t)?Pm(e):Fm(e,t)},Nm=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Pm=e=>{(e.readable||e.writable)&&e.destroy()},Fm=(e,t)=>{e.destroyed||(e.once(`error`,Im),e.destroy(t))},Im=()=>{},Lm=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},Rm=2,zm=1,Bm=(e,t)=>{e.pipe(t),Vm(e,t),Um(e,t)},Vm=async(e,t)=>{if(!(Yi(e)||Yi(t))){try{await O(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Hm(t)}},Hm=e=>{e.writable&&e.end()},Um=async(e,t)=>{if(!(Yi(e)||Yi(t))){try{await O(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Wm(e)}},Wm=e=>{e.readable&&e.destroy()},Gm=(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})=>dd.has(e)))Km(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!dd.has(e)))Jm({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())Bm(t.length===1?t[0]:bm(t),e)},Km=(e,t,n,r)=>{n===`output`?Bm(e.stdio[r],t):Bm(t,e.stdio[r]);let i=qm[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},qm=[`stdin`,`stdout`,`stderr`],Jm=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;Ym(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},Ym=(e,{signal:t})=>{Yi(e)&&Us(e,Xm,t)},Xm=2,Zm=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let i=Tn(()=>{e.kill()});ge(r,()=>{i()})},Qm=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=to(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=$m(n,r,i),{sourceStream:d,sourceError:f}=nh(e,l),{options:p,fileDescriptors:m}=Ps.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},$m=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=eh(e,t,...n);return{destination:r,destinationStream:Ms(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},eh=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(th,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||wi(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]=Ei(n,...r);return{destination:t(th)(i,a,o),pipeOptions:o}}if(Ps.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}`)},th=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),nh=(e,t)=>{try{return{sourceStream:Ns(e,t)}}catch(e){return{sourceError:e}}},rh=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=ih({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw ah({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},ih=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return Wm(e),r;if(t!==void 0)return Hm(n),t},ah=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>Su({error:e,command:oh,escapedCommand:oh,fileDescriptors:t,options:n,startTime:r,isSync:!1}),oh=`source.pipe(destination)`,sh=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},ch=(e,t,n)=>{let r=fh.has(t)?uh(e,t):lh(e,t);return Us(e,ph,n.signal),Us(t,mh,n.signal),dh(t),r},lh=(e,t)=>{let n=bm([e]);return Bm(n,t),fh.set(t,n),n},uh=(e,t)=>{let n=fh.get(t);return n.add(e),n},dh=async e=>{try{await O(e,{cleanup:!0,readable:!1,writable:!0})}catch{}fh.delete(e)},fh=new WeakMap,ph=2,mh=1,hh=(e,t)=>e===void 0?[]:[gh(e,t)],gh=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await ae(e,t),await n.remove(t),ah({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})},_h=(e,...t)=>{if(B(t[0]))return _h.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=Qm(e,...t),i=vh({...r,destination:n});return i.pipe=_h.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},vh=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=yh(e,i);rh({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=ch(t,a,d);return await Promise.race([sh(u),...hh(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},yh=(e,t)=>Promise.allSettled([e,t]),bh=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return xh(t,o),wh({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},xh=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Sh=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Ch(t,o,e);let s=e.readableObjectMode&&!a;return wh({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Ch=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},wh=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>Dh({onStdoutChunk:_e(e,`data`,{signal:t.signal,highWaterMark:Eh,highWatermark:Eh}),controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}),Th=Te(!0),Eh=Th,Dh=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=Oh({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*op(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*sp(s)}},Oh=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Jf(e,n,!t),Af(e,i,!r,{})].filter(Boolean),kh=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=Ah({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([jh(e),d]);return}let f=Sh({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:kf(c,n),allMixed:s}),[p]=await Promise.all([Mh({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},Ah=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{vp({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await xp(Sh({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},jh=async e=>{await pe(),e.readableFlowing===null&&e.resume()},Mh=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await zl(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await Vl(n,{maxBuffer:a})):await nu(n,{maxBuffer:a})}catch(n){return Ph(ou({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},Nh=async e=>{try{return await e}catch(e){return Ph(e)}},Ph=({bufferedData:e})=>Oi(e)?new Uint8Array(e):e,Fh=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=Ih(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],O(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||zh(e,t,n,r)}finally{o.abort()}},Ih=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&Lh(e,n,r),r},Lh=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{Rh(t,n),r.call(e,...i)}},Rh=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},zh=(e,t,n,r)=>{if(!Bh(e,t,n,r))throw e},Bh=(e,t,n,r=!0)=>n.propagating?Uh(e)||Hh(e):(n.propagating=!0,Vh(n,t)===r?Uh(e):Hh(e)),Vh=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,Hh=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Uh=e=>e?.code===`EPIPE`,Wh=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>Gh({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),Gh=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=Fh(e,t,l);if(Vh(l,t)){await u;return}let[d]=await Promise.all([kh({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},Kh=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?bm([e,t].filter(Boolean)):void 0,qh=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>Gh({...Jh(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Yh(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),Jh=({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}},Yh=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,Xh=e=>pa(e,`ipc`),Zh=(e,t)=>{Wa({type:`ipc`,verboseMessage:Ja(e),fdNumber:`ipc`,verboseInfo:t})},Qh=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Xh(a),s=da(t,`ipc`),c=da(n,`ipc`);for await(let t of tm({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(cu(e,i,c),i.push(t)),o&&Zh(t,a);return i},$h=async(e,t)=>(await Promise.allSettled([e]),t),eg=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=Mp(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=Wh({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=qh({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),S=[],C=Qh({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:S,verboseInfo:p}),w=tg(h,e,y),T=ng(m,y);try{return await Promise.race([Promise.all([{},Fp(v),Promise.all(b),x,C,Uc(e,d),...w,...T]),g,rg(e,_),...Lc(e,a,f,_),...ds({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...Nc({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=>Nh(e))),Nh(x),$h(C,S),Promise.allSettled(w),Promise.allSettled(T)])}},tg=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:Fh(e,r,n)),ng=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>dl(t,{checkOpen:!1})&&!Yi(t)).map(({type:e,value:r,stream:i=r})=>Fh(i,n,t,{isSameDirection:dd.has(e),stopOnExit:e===`native`}))),rg=async(e,{signal:t})=>{let[n]=await D(e,`error`,{signal:t});throw n},ig=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),ag=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=js();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},og=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},sg=async e=>{if(e!==void 0)try{await lg(e)}catch{}},cg=async e=>{if(e!==void 0)try{await ug(e)}catch{}},lg=async e=>{await O(e,{cleanup:!0,readable:!1,writable:!0})},ug=async e=>{await O(e,{cleanup:!0,readable:!0,writable:!1})},dg=async(e,t)=>{if(await e,t)throw t},fg=(e,t,n)=>{n&&!Hh(n)?e.destroy(n):t&&e.destroy()},pg=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||Kc.has(n),{subprocessStdout:s,waitReadableDestroy:c}=mg(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=hg(s,o),{read:f,onStdoutDataDone:p}=gg({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),m=new Se({read:f,destroy:oe(yg.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return vg({subprocessStdout:s,onStdoutDataDone:p,readable:m,subprocess:e}),m},mg=(e,t,n)=>{let r=Ns(e,t);return{subprocessStdout:r,waitReadableDestroy:ag(n,r,`readableDestroy`)}},hg=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Th},gg=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=js(),o=bh({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){_g(this,o,a)},onStdoutDataDone:a}},_g=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},vg=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await ug(e),await r,await sg(i),await t,n.readable&&n.push(null)}catch(e){await sg(i),bg(n,e)}},yg=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await og(n,t)&&(bg(e,r),await dg(t,r))},bg=(e,t)=>{fg(e,e.readable,t)},xg=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=Sg(e,n,t),o=new we({...Cg(r,e,i),destroy:oe(Dg.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Eg(r,o),o},Sg=(e,t,n)=>{let r=Ms(e,t);return{subprocessStdin:r,waitWritableFinal:ag(n,r,`writableFinal`),waitWritableDestroy:ag(n,r,`writableDestroy`)}},Cg=(e,t,n)=>({write:wg.bind(void 0,e),final:oe(Tg.bind(void 0,e,t,n))}),wg=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},Tg=async(e,t,n)=>{await og(n,t)&&(e.writable&&e.end(),await t)},Eg=async(e,t,n)=>{try{await lg(e),t.writable&&t.end()}catch(e){await cg(n),Og(t,e)}},Dg=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await og(n,t),await og(r,t)&&(Og(e,i),await dg(t,i))},Og=(e,t)=>{fg(e,e.writable,t)},kg=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||Kc.has(n),{subprocessStdout:c,waitReadableDestroy:l}=mg(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=Sg(e,i,t),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=hg(c,s),{read:g,onStdoutDataDone:_}=gg({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),v=new be({read:g,...Cg(u,e,d),destroy:oe(Ag.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return vg({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:e,subprocessStdin:u}),Eg(u,v,c),v},Ag=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([yg({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),Dg({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},jg=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||Kc.has(t),o=Ns(e,n);return Mg(bh({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i}),o,e)},Mg=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},Ng=(e,{encoding:t})=>{let n=ig();e.readable=pg.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=xg.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=kg.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=jg.bind(void 0,e,t),e[Symbol.asyncIterator]=jg.bind(void 0,e,t,{})},Pg=(e,t)=>{for(let[n,r]of Ig){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Fg=(async()=>{})().constructor.prototype,Ig=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Fg,e)]),Lg=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Rg(e,t,n),{subprocess:f,promise:p}=Bg({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=_h.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Pg(f,p),Ps.set(f,{options:u,fileDescriptors:d}),f},Rg=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=ro(e,t,n),{file:s,commandArguments:c,options:l}=el(e,t,n),u=zg(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:gm(u,o)}},zg=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},Bg=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let c;try{c=C(...rl(e,t,n))}catch(e){return lm({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let l=new AbortController;ve(1/0,l.signal);let u=[...c.stdio];Gm(c,s,l),Zm(c,n,l);let d={},f=js();c.kill=is.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:l}),c.all=Kh(c,n),Ng(c,n),om(c,n);let p=Vg({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:u,command:a,escapedCommand:o,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Vg=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 eg({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});return u.abort(),l.resolve(),Ru(Hg({errorInfo:d,exitCode:f,signal:p,stdio:m.map((e,n)=>Of(e,t,n)),all:Of(h,t,`all`),ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},Hg=({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?Cu({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 Nl,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):xu({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),Ug=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,Wg(t,e[t],n)]));return{...e,...n}},Wg=(e,t,n)=>Gg.has(e)&&B(t)&&B(n)?{...t,...n}:n,Gg=new Set([`env`,...ua]),Kg=(e,t,n,r)=>{let i=(e,t,r)=>Kg(e,t,n,r),a=(...a)=>qg({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},qg=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(B(a))return i(e,Ug(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=Jg({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?Bp(s,c,l):Lg(s,c,l,i)},Jg=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Ei(...Bi(t)?Vi(t,n):[t,...n]),c=Ug(Ug(r,i),s),{file:l=a,commandArguments:u=o,options:d=c,isSync:f=!1}=e({file:a,commandArguments:o,options:c});return{file:l,commandArguments:u,options:d,isSync:f}},Yg=({file:e,commandArguments:t})=>Zg(e,t),Xg=({file:e,commandArguments:t})=>({...Zg(e,t),isSync:!0}),Zg=(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]=Qg(e);return{file:n,commandArguments:r}},Qg=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($g)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},$g=/ +/g,e_=(e,t,n)=>{e.sync=t(n_,n),e.s=e.sync},t_=({options:e})=>r_(e),n_=({options:e})=>({...r_(e),isSync:!0}),r_=e=>({options:{...i_(e),...e}}),i_=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},a_={preferLocal:!0},o_=Kg(()=>({}));Kg(()=>({isSync:!0})),Kg(Yg),Kg(Xg),Kg(zc),Kg(t_,{},a_,e_);const{sendMessage:s_,getOneMessage:c_,getEachMessage:l_,getCancelSignal:u_}=sm();var G=n(((e,t)=>{let{FORCE_COLOR:n,NODE_DISABLE_COLORS:r,TERM:i}=process.env,a={enabled:!r&&i!==`dumb`&&n!==`0`,reset:c(0,0),bold:c(1,22),dim:c(2,22),italic:c(3,23),underline:c(4,24),inverse:c(7,27),hidden:c(8,28),strikethrough:c(9,29),black:c(30,39),red:c(31,39),green:c(32,39),yellow:c(33,39),blue:c(34,39),magenta:c(35,39),cyan:c(36,39),white:c(37,39),gray:c(90,39),grey:c(90,39),bgBlack:c(40,49),bgRed:c(41,49),bgGreen:c(42,49),bgYellow:c(43,49),bgBlue:c(44,49),bgMagenta:c(45,49),bgCyan:c(46,49),bgWhite:c(47,49)};function o(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,t.includes(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function s(e,t){let n={has:e,keys:t};return n.reset=a.reset.bind(n),n.bold=a.bold.bind(n),n.dim=a.dim.bind(n),n.italic=a.italic.bind(n),n.underline=a.underline.bind(n),n.inverse=a.inverse.bind(n),n.hidden=a.hidden.bind(n),n.strikethrough=a.strikethrough.bind(n),n.black=a.black.bind(n),n.red=a.red.bind(n),n.green=a.green.bind(n),n.yellow=a.yellow.bind(n),n.blue=a.blue.bind(n),n.magenta=a.magenta.bind(n),n.cyan=a.cyan.bind(n),n.white=a.white.bind(n),n.gray=a.gray.bind(n),n.grey=a.grey.bind(n),n.bgBlack=a.bgBlack.bind(n),n.bgRed=a.bgRed.bind(n),n.bgGreen=a.bgGreen.bind(n),n.bgYellow=a.bgYellow.bind(n),n.bgBlue=a.bgBlue.bind(n),n.bgMagenta=a.bgMagenta.bind(n),n.bgCyan=a.bgCyan.bind(n),n.bgWhite=a.bgWhite.bind(n),n}function c(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(this.has.includes(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:a.enabled?o(this.keys,t+``):t+``):t===void 0?s([e],[n]):a.enabled?o([n],t+``):t+``}}t.exports=a})),d_=n(((e,t)=>{t.exports=(e,t)=>{if(!(e.meta&&e.name!==`escape`)){if(e.ctrl){if(e.name===`a`)return`first`;if(e.name===`c`||e.name===`d`)return`abort`;if(e.name===`e`)return`last`;if(e.name===`g`)return`reset`}if(t){if(e.name===`j`)return`down`;if(e.name===`k`)return`up`}return e.name===`return`||e.name===`enter`?`submit`:e.name===`backspace`?`delete`:e.name===`delete`?`deleteForward`:e.name===`abort`?`abort`:e.name===`escape`?`exit`:e.name===`tab`?`next`:e.name===`pagedown`?`nextPage`:e.name===`pageup`?`prevPage`:e.name===`home`?`home`:e.name===`end`?`end`:e.name===`up`?`up`:e.name===`down`?`down`:e.name===`right`?`right`:e.name===`left`?`left`:!1}}})),f_=n(((e,t)=>{t.exports=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))`].join(`|`),n=new RegExp(t,`g`);return typeof e==`string`?e.replace(n,``):e}})),K=n(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),p_=n(((e,t)=>{function n(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
115
|
+
if (condition) { yield value; }`)},Jf=(e,t,n)=>{if(n)return;if(e)return{transform:Yf.bind(void 0,new TextEncoder)};let r=new de(t);return{transform:Xf.bind(void 0,r),final:Zf.bind(void 0,r)}},Yf=function*(e,t){De.isBuffer(t)?yield Ai(t):typeof t==`string`?yield e.encode(t):yield t},Xf=function*(e,t){yield B(t)?e.write(t):t},Zf=function*(e){let t=e.end();t!==``&&(yield t)},Qf=oe(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),$f=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=rp}=t[n];for await(let i of r(e))yield*$f(i,t,n+1)},ep=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*tp(n,Number(t),e)},tp=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*$f(r,n,t+1)},np=oe(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),rp=function*(e){yield e},ip=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},ap=(e,t)=>[...t.flatMap(t=>[...op(t,e,0)]),...sp(e)],op=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=lp}=t[n];for(let i of r(e))yield*op(i,t,n+1)},sp=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*cp(n,Number(t),e)},cp=function*(e,t,n){if(e!==void 0)for(let r of e())yield*op(r,n,t+1)},lp=function*(e){yield e},up=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=fp(e,o,a),l=Ju(t),u=Ju(n),d=l?Qf.bind(void 0,$f,s):ip.bind(void 0,op),f=l||u?Qf.bind(void 0,ep,s):ip.bind(void 0,sp),p=l||u?np.bind(void 0,s):void 0;return{stream:new we({writableObjectMode:r,writableHighWaterMark:Ee(r),readableObjectMode:i,readableHighWaterMark:Ee(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},dp=(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)e=ap(fp(t,n,r),e);return e},fp=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:Hf(r,s)},Jf(n,o,r),Af(n,a,r,c),{transform:e,final:t},{transform:Wf(i,s)},Lf({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},pp=(e,t)=>{for(let n of mp(e))hp(e,n,t)},mp=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),hp=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length!==0){if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${gd[e]} with synchronous methods.`)}n.input=Li(i.map(({contents:e})=>e).map(e=>gp(e,r)))}},gp=(e,t)=>{let n=dp(e,t,`utf8`,!0);return _p(n),Li(n)},_p=e=>{let t=e.find(e=>typeof e!=`string`&&!B(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}.`)},vp=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&ma(n,r)&&!Kc.has(t)&&yp(r)&&(e.some(({type:e,value:t})=>e===`native`&&bp.has(t))||e.every(({type:e})=>dd.has(e))),yp=e=>e===1||e===2,bp=new Set([`pipe`,`overlapped`]),xp=async(e,t,n,r)=>{for await(let i of e)Cp(t)||wp(i,n,r)},Sp=(e,t,n)=>{for(let r of e)wp(r,t,n)},Cp=e=>e._readableState.pipes.length>0,wp=(e,t,n)=>{Ga({type:`output`,verboseMessage:Ya(e),fdNumber:t,verboseInfo:n})},Tp=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set([]);return{output:t.map((t,s)=>Ep({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},Ep=({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=Ai(fu(e,a,d)),{stdioItems:p,objectMode:m}=t[n],{serializedResult:h,finalResult:g=h}=Op({chunks:Dp([f],p,c,r),objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});kp({serializedResult:h,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});let _=s[n]?g:void 0;try{return r.error===void 0&&Ap(h,p,i),_}catch(e){return r.error=e,_}},Dp=(e,t,n,r)=>{try{return dp(e,t,n,!1)}catch(t){return r.error=t,e}},Op=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:Li(e)};let o=Fi(e,n);return r[a]?{serializedResult:o,finalResult:jf(o,!i[a],t)}:{serializedResult:o}},kp=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!vp({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=jf(e,!1,o);try{Sp(s,t,r)}catch(e){n.error??=e}},Ap=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>fd.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?T(r,e):(n.add(t),ie(r,e))}},jp=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Of(t,n,`all`)]:Array.isArray(t)?[Of(e,n,`all`),...t]:B(e)&&B(t)?zi([e,t]):`${e}${t}`},Mp=async(e,t)=>{let[n,r]=await Np(e);return t.isForcefullyTerminated??=!1,[n,r]},Np=async e=>{let[t,n]=await Promise.allSettled([D(e,`spawn`),D(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Pp(e):n.value},Pp=async e=>{try{return await D(e,`exit`)}catch{return Pp(e)}},Fp=async e=>{let[t,n]=await e;if(!Ip(t,n)&&Lp(t,n))throw new Do;return[t,n]},Ip=(e,t)=>e===void 0&&t===void 0,Lp=(e,t)=>e!==0||t!==null,Rp=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=zp(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:du(a,r,i)}},zp=(e,t,n)=>e===void 0?Lp(t,n)?new Do:void 0:e,Bp=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=Vp(e,t,n);return Ru(Gp({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},Vp=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=io(e,t,n),{file:s,commandArguments:c,options:l}=el(e,t,Hp(n));return Up(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:Cf(l,o)}},Hp=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,Up=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Wp(`ipcInput`),e&&Wp(`ipc: true`),n&&Wp(`detached: true`),r&&Wp(`cancelSignal`)},Wp=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Gp=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=Kp({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}=Rp(c,n),{output:m,error:h=l}=Tp({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a});return Jp({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:m.map((e,t)=>Of(e,n,t)),all:Of(jp(m,n),n,`all`),options:n,command:r,escapedCommand:i,startTime:s})},Kp=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return pp(a,n),w(...rl(e,t,qp(n)))}catch(e){return Su({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},qp=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:pu(t)}),Jp=({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?xu({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):Cu({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}),Yp=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(ms({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:nc(e)}),Xp({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),Xp=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Ws(t,i);let a=$s(e,t,n),o=new AbortController;try{return await Promise.race([Zp(a,r,o),Qp(a,n,o),$p(a,n,o)])}catch(t){throw As(e),t}finally{o.abort(),Ks(t,i)}},Zp=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await D(e,`message`,{signal:n});return t}for await(let[r]of _e(e,`message`,{signal:n}))if(t(r))return r},Qp=async(e,t,{signal:n})=>{await D(e,`disconnect`,{signal:n}),_s(t)},$p=async(e,t,{signal:n})=>{let[r]=await D(e,`strict:error`,{signal:n});throw ys(r,t)},em=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>tm({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),tm=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{ms({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:nc(e)}),Ws(t,a);let o=$s(e,t,n),s=new AbortController,c={};return nm(e,o,s),rm({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),im({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},nm=async(e,t,n)=>{try{await D(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},rm=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await D(e,`strict:error`,{signal:n.signal});r.error=ys(i,t),n.abort()}catch{}},im=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of _e(n,`message`,{signal:a.signal}))am(o),yield e}catch{am(o)}finally{a.abort(),Ks(t,s),r||As(e),i&&await e}},am=({error:e})=>{if(e)throw e},om=(e,{ipc:t})=>{Object.assign(e,cm(e,!1,t))},sm=()=>{let e=u,t=u.channel!==void 0;return{...cm(e,!0,t),getCancelSignal:Tc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},cm=(e,t,n)=>({sendMessage:yc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:Yp.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:em.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),lm=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:o})=>{xf(r);let s=new b;return um(s,r),Object.assign(s,{readable:fm,writable:pm,duplex:mm}),{subprocess:s,promise:hm(Su({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1}),o,i)}},um=(e,t)=>{let n=dm(),r=dm(),i=dm(),a=Array.from({length:t.length-3},dm),o=dm(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},dm=()=>{let e=new Se;return e.end(),e},fm=()=>new Ce({read(){}}),pm=()=>new Te({write(){}}),mm=()=>new xe({read(){},write(){}}),hm=async(e,t,n)=>Ru(e,t,n),gm=(e,t)=>lf(ym,e,t,!1),_m=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${gd[e]}.`)},vm={fileNumber:_m,generator:up,asyncGenerator:up,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:xe.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},ym={input:{...vm,fileUrl:({value:e})=>({stream:E(e)}),filePath:({value:{file:e}})=>({stream:E(e)}),webStream:({value:e})=>({stream:Ce.fromWeb(e)}),iterable:({value:e})=>({stream:Ce.from(e)}),asyncIterable:({value:e})=>({stream:Ce.from(e)}),string:({value:e})=>({stream:Ce.from(e)}),uint8Array:({value:e})=>({stream:Ce.from(De.from(e))})},output:{...vm,fileUrl:({value:e})=>({stream:ee(e)}),filePath:({value:{file:e,append:t}})=>({stream:ee(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:Te.fromWeb(e)}),iterable:_m,asyncIterable:_m,string:_m,uint8Array:_m}};function bm(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Em(t);let t=e.some(({readableObjectMode:e})=>e),n=xm(e,t),r=new Sm({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const xm=(e,t)=>{if(e.length===0)return Ee(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)};var Sm=class extends Se{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#i=Symbol(`unpipe`);#a=new WeakMap;add(e){if(Em(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Cm(this,this.#e,this.#i);let t=Dm({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#i});this.#a.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Em(e),!this.#e.has(e))return!1;let t=this.#a.get(e);return t===void 0?!1:(this.#a.delete(e),e.unpipe(this),await t,!0)}};const Cm=async(e,t,n)=>{Lm(e,Rm);let r=new AbortController;try{await Promise.race([wm(e,r),Tm(e,t,n,r)])}finally{r.abort(),Lm(e,-Rm)}},wm=async(e,{signal:t})=>{try{await be(e,{signal:t,cleanup:!0})}catch(t){throw Mm(e,t),t}},Tm=async(e,t,n,{signal:r})=>{for await(let[i]of _e(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Em=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Dm=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{Lm(e,zm);let s=new AbortController;try{await Promise.race([Om(a,t,s),km({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),Am({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),Lm(e,-zm)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Pm(e):jm(e))},Om=async(e,t,{signal:n})=>{try{await e,n.aborted||Pm(t)}catch(e){n.aborted||Mm(t,e)}},km=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await be(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;Nm(r)?i.add(t):Fm(e,r)}},Am=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await D(e,i,{signal:a}),!e.readable)return D(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},jm=e=>{e.writable&&e.end()},Mm=(e,t)=>{Nm(t)?Pm(e):Fm(e,t)},Nm=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Pm=e=>{(e.readable||e.writable)&&e.destroy()},Fm=(e,t)=>{e.destroyed||(e.once(`error`,Im),e.destroy(t))},Im=()=>{},Lm=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},Rm=2,zm=1,Bm=(e,t)=>{e.pipe(t),Vm(e,t),Um(e,t)},Vm=async(e,t)=>{if(!(Xi(e)||Xi(t))){try{await be(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Hm(t)}},Hm=e=>{e.writable&&e.end()},Um=async(e,t)=>{if(!(Xi(e)||Xi(t))){try{await be(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Wm(e)}},Wm=e=>{e.readable&&e.destroy()},Gm=(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})=>dd.has(e)))Km(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!dd.has(e)))Jm({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())Bm(t.length===1?t[0]:bm(t),e)},Km=(e,t,n,r)=>{n===`output`?Bm(e.stdio[r],t):Bm(t,e.stdio[r]);let i=qm[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},qm=[`stdin`,`stdout`,`stderr`],Jm=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;Ym(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},Ym=(e,{signal:t})=>{Xi(e)&&Us(e,Xm,t)},Xm=2,Zm=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let i=En(()=>{e.kill()});ge(r,()=>{i()})},Qm=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=no(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=$m(n,r,i),{sourceStream:d,sourceError:f}=nh(e,l),{options:p,fileDescriptors:m}=Ps.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},$m=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=eh(e,t,...n);return{destination:r,destinationStream:Ms(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},eh=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(th,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||Ti(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]=Di(n,...r);return{destination:t(th)(i,a,o),pipeOptions:o}}if(Ps.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}`)},th=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),nh=(e,t)=>{try{return{sourceStream:Ns(e,t)}}catch(e){return{sourceError:e}}},rh=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=ih({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw ah({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},ih=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return Wm(e),r;if(t!==void 0)return Hm(n),t},ah=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>Su({error:e,command:oh,escapedCommand:oh,fileDescriptors:t,options:n,startTime:r,isSync:!1}),oh=`source.pipe(destination)`,sh=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},ch=(e,t,n)=>{let r=fh.has(t)?uh(e,t):lh(e,t);return Us(e,ph,n.signal),Us(t,mh,n.signal),dh(t),r},lh=(e,t)=>{let n=bm([e]);return Bm(n,t),fh.set(t,n),n},uh=(e,t)=>{let n=fh.get(t);return n.add(e),n},dh=async e=>{try{await be(e,{cleanup:!0,readable:!1,writable:!0})}catch{}fh.delete(e)},fh=new WeakMap,ph=2,mh=1,hh=(e,t)=>e===void 0?[]:[gh(e,t)],gh=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await ae(e,t),await n.remove(t),ah({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})},_h=(e,...t)=>{if(z(t[0]))return _h.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=Qm(e,...t),i=vh({...r,destination:n});return i.pipe=_h.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},vh=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=yh(e,i);rh({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=ch(t,a,d);return await Promise.race([sh(u),...hh(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},yh=(e,t)=>Promise.allSettled([e,t]),bh=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return xh(t,o),wh({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},xh=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Sh=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Ch(t,o,e);let s=e.readableObjectMode&&!a;return wh({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Ch=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},wh=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>Dh({onStdoutChunk:_e(e,`data`,{signal:t.signal,highWaterMark:Eh,highWatermark:Eh}),controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}),Th=Ee(!0),Eh=Th,Dh=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=Oh({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*op(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*sp(s)}},Oh=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Jf(e,n,!t),Af(e,i,!r,{})].filter(Boolean),kh=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=Ah({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([jh(e),d]);return}let f=Sh({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:kf(c,n),allMixed:s}),[p]=await Promise.all([Mh({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},Ah=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{vp({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await xp(Sh({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},jh=async e=>{await pe(),e.readableFlowing===null&&e.resume()},Mh=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await zl(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await Vl(n,{maxBuffer:a})):await nu(n,{maxBuffer:a})}catch(n){return Ph(ou({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},Nh=async e=>{try{return await e}catch(e){return Ph(e)}},Ph=({bufferedData:e})=>ki(e)?new Uint8Array(e):e,Fh=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=Ih(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],be(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||zh(e,t,n,r)}finally{o.abort()}},Ih=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&Lh(e,n,r),r},Lh=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{Rh(t,n),r.call(e,...i)}},Rh=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},zh=(e,t,n,r)=>{if(!Bh(e,t,n,r))throw e},Bh=(e,t,n,r=!0)=>n.propagating?Uh(e)||Hh(e):(n.propagating=!0,Vh(n,t)===r?Uh(e):Hh(e)),Vh=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,Hh=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Uh=e=>e?.code===`EPIPE`,Wh=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>Gh({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),Gh=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=Fh(e,t,l);if(Vh(l,t)){await u;return}let[d]=await Promise.all([kh({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},Kh=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?bm([e,t].filter(Boolean)):void 0,qh=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>Gh({...Jh(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Yh(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),Jh=({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}},Yh=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,Xh=e=>ma(e,`ipc`),Zh=(e,t)=>{Ga({type:`ipc`,verboseMessage:Ya(e),fdNumber:`ipc`,verboseInfo:t})},Qh=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Xh(a),s=fa(t,`ipc`),c=fa(n,`ipc`);for await(let t of tm({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(cu(e,i,c),i.push(t)),o&&Zh(t,a);return i},$h=async(e,t)=>(await Promise.allSettled([e]),t),eg=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=Mp(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=Wh({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=qh({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),S=[],C=Qh({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:S,verboseInfo:p}),w=tg(h,e,y),T=ng(m,y);try{return await Promise.race([Promise.all([{},Fp(v),Promise.all(b),x,C,Uc(e,d),...w,...T]),g,rg(e,_),...Lc(e,a,f,_),...fs({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...Nc({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=>Nh(e))),Nh(x),$h(C,S),Promise.allSettled(w),Promise.allSettled(T)])}},tg=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:Fh(e,r,n)),ng=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>dl(t,{checkOpen:!1})&&!Xi(t)).map(({type:e,value:r,stream:i=r})=>Fh(i,n,t,{isSameDirection:dd.has(e),stopOnExit:e===`native`}))),rg=async(e,{signal:t})=>{let[n]=await D(e,`error`,{signal:t});throw n},ig=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),ag=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=js();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},og=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},sg=async e=>{if(e!==void 0)try{await lg(e)}catch{}},cg=async e=>{if(e!==void 0)try{await ug(e)}catch{}},lg=async e=>{await be(e,{cleanup:!0,readable:!1,writable:!0})},ug=async e=>{await be(e,{cleanup:!0,readable:!0,writable:!1})},dg=async(e,t)=>{if(await e,t)throw t},fg=(e,t,n)=>{n&&!Hh(n)?e.destroy(n):t&&e.destroy()},pg=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||Kc.has(n),{subprocessStdout:s,waitReadableDestroy:c}=mg(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=hg(s,o),{read:f,onStdoutDataDone:p}=gg({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),m=new Ce({read:f,destroy:oe(yg.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return vg({subprocessStdout:s,onStdoutDataDone:p,readable:m,subprocess:e}),m},mg=(e,t,n)=>{let r=Ns(e,t);return{subprocessStdout:r,waitReadableDestroy:ag(n,r,`readableDestroy`)}},hg=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Th},gg=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=js(),o=bh({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){_g(this,o,a)},onStdoutDataDone:a}},_g=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},vg=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await ug(e),await r,await sg(i),await t,n.readable&&n.push(null)}catch(e){await sg(i),bg(n,e)}},yg=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await og(n,t)&&(bg(e,r),await dg(t,r))},bg=(e,t)=>{fg(e,e.readable,t)},xg=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=Sg(e,n,t),o=new Te({...Cg(r,e,i),destroy:oe(Dg.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Eg(r,o),o},Sg=(e,t,n)=>{let r=Ms(e,t);return{subprocessStdin:r,waitWritableFinal:ag(n,r,`writableFinal`),waitWritableDestroy:ag(n,r,`writableDestroy`)}},Cg=(e,t,n)=>({write:wg.bind(void 0,e),final:oe(Tg.bind(void 0,e,t,n))}),wg=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},Tg=async(e,t,n)=>{await og(n,t)&&(e.writable&&e.end(),await t)},Eg=async(e,t,n)=>{try{await lg(e),t.writable&&t.end()}catch(e){await cg(n),Og(t,e)}},Dg=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await og(n,t),await og(r,t)&&(Og(e,i),await dg(t,i))},Og=(e,t)=>{fg(e,e.writable,t)},kg=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||Kc.has(n),{subprocessStdout:c,waitReadableDestroy:l}=mg(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=Sg(e,i,t),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=hg(c,s),{read:g,onStdoutDataDone:_}=gg({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),v=new xe({read:g,...Cg(u,e,d),destroy:oe(Ag.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return vg({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:e,subprocessStdin:u}),Eg(u,v,c),v},Ag=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([yg({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),Dg({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},jg=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||Kc.has(t),o=Ns(e,n);return Mg(bh({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i}),o,e)},Mg=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},Ng=(e,{encoding:t})=>{let n=ig();e.readable=pg.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=xg.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=kg.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=jg.bind(void 0,e,t),e[Symbol.asyncIterator]=jg.bind(void 0,e,t,{})},Pg=(e,t)=>{for(let[n,r]of Ig){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Fg=(async()=>{})().constructor.prototype,Ig=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Fg,e)]),Lg=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Rg(e,t,n),{subprocess:f,promise:p}=Bg({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=_h.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Pg(f,p),Ps.set(f,{options:u,fileDescriptors:d}),f},Rg=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=io(e,t,n),{file:s,commandArguments:c,options:l}=el(e,t,n),u=zg(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:gm(u,o)}},zg=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},Bg=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let c;try{c=C(...rl(e,t,n))}catch(e){return lm({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let l=new AbortController;ve(1/0,l.signal);let u=[...c.stdio];Gm(c,s,l),Zm(c,n,l);let d={},f=js();c.kill=as.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:l}),c.all=Kh(c,n),Ng(c,n),om(c,n);let p=Vg({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:u,command:a,escapedCommand:o,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Vg=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 eg({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});return u.abort(),l.resolve(),Ru(Hg({errorInfo:d,exitCode:f,signal:p,stdio:m.map((e,n)=>Of(e,t,n)),all:Of(h,t,`all`),ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},Hg=({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?Cu({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 Nl,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):xu({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),Ug=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,Wg(t,e[t],n)]));return{...e,...n}},Wg=(e,t,n)=>Gg.has(e)&&z(t)&&z(n)?{...t,...n}:n,Gg=new Set([`env`,...da]),Kg=(e,t,n,r)=>{let i=(e,t,r)=>Kg(e,t,n,r),a=(...a)=>qg({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},qg=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(z(a))return i(e,Ug(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=Jg({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?Bp(s,c,l):Lg(s,c,l,i)},Jg=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Di(...Vi(t)?Hi(t,n):[t,...n]),c=Ug(Ug(r,i),s),{file:l=a,commandArguments:u=o,options:d=c,isSync:f=!1}=e({file:a,commandArguments:o,options:c});return{file:l,commandArguments:u,options:d,isSync:f}},Yg=({file:e,commandArguments:t})=>Zg(e,t),Xg=({file:e,commandArguments:t})=>({...Zg(e,t),isSync:!0}),Zg=(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]=Qg(e);return{file:n,commandArguments:r}},Qg=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($g)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},$g=/ +/g,e_=(e,t,n)=>{e.sync=t(n_,n),e.s=e.sync},t_=({options:e})=>r_(e),n_=({options:e})=>({...r_(e),isSync:!0}),r_=e=>({options:{...i_(e),...e}}),i_=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},a_={preferLocal:!0},o_=Kg(()=>({}));Kg(()=>({isSync:!0})),Kg(Yg),Kg(Xg),Kg(zc),Kg(t_,{},a_,e_);const{sendMessage:s_,getOneMessage:c_,getEachMessage:l_,getCancelSignal:u_}=sm();var G=n(((e,t)=>{let{FORCE_COLOR:n,NODE_DISABLE_COLORS:r,TERM:i}=process.env,a={enabled:!r&&i!==`dumb`&&n!==`0`,reset:c(0,0),bold:c(1,22),dim:c(2,22),italic:c(3,23),underline:c(4,24),inverse:c(7,27),hidden:c(8,28),strikethrough:c(9,29),black:c(30,39),red:c(31,39),green:c(32,39),yellow:c(33,39),blue:c(34,39),magenta:c(35,39),cyan:c(36,39),white:c(37,39),gray:c(90,39),grey:c(90,39),bgBlack:c(40,49),bgRed:c(41,49),bgGreen:c(42,49),bgYellow:c(43,49),bgBlue:c(44,49),bgMagenta:c(45,49),bgCyan:c(46,49),bgWhite:c(47,49)};function o(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,t.includes(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function s(e,t){let n={has:e,keys:t};return n.reset=a.reset.bind(n),n.bold=a.bold.bind(n),n.dim=a.dim.bind(n),n.italic=a.italic.bind(n),n.underline=a.underline.bind(n),n.inverse=a.inverse.bind(n),n.hidden=a.hidden.bind(n),n.strikethrough=a.strikethrough.bind(n),n.black=a.black.bind(n),n.red=a.red.bind(n),n.green=a.green.bind(n),n.yellow=a.yellow.bind(n),n.blue=a.blue.bind(n),n.magenta=a.magenta.bind(n),n.cyan=a.cyan.bind(n),n.white=a.white.bind(n),n.gray=a.gray.bind(n),n.grey=a.grey.bind(n),n.bgBlack=a.bgBlack.bind(n),n.bgRed=a.bgRed.bind(n),n.bgGreen=a.bgGreen.bind(n),n.bgYellow=a.bgYellow.bind(n),n.bgBlue=a.bgBlue.bind(n),n.bgMagenta=a.bgMagenta.bind(n),n.bgCyan=a.bgCyan.bind(n),n.bgWhite=a.bgWhite.bind(n),n}function c(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(this.has.includes(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:a.enabled?o(this.keys,t+``):t+``):t===void 0?s([e],[n]):a.enabled?o([n],t+``):t+``}}t.exports=a})),d_=n(((e,t)=>{t.exports=(e,t)=>{if(!(e.meta&&e.name!==`escape`)){if(e.ctrl){if(e.name===`a`)return`first`;if(e.name===`c`||e.name===`d`)return`abort`;if(e.name===`e`)return`last`;if(e.name===`g`)return`reset`}if(t){if(e.name===`j`)return`down`;if(e.name===`k`)return`up`}return e.name===`return`||e.name===`enter`?`submit`:e.name===`backspace`?`delete`:e.name===`delete`?`deleteForward`:e.name===`abort`?`abort`:e.name===`escape`?`exit`:e.name===`tab`?`next`:e.name===`pagedown`?`nextPage`:e.name===`pageup`?`prevPage`:e.name===`home`?`home`:e.name===`end`?`end`:e.name===`up`?`up`:e.name===`down`?`down`:e.name===`right`?`right`:e.name===`left`?`left`:!1}}})),f_=n(((e,t)=>{t.exports=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))`].join(`|`),n=new RegExp(t,`g`);return typeof e==`string`?e.replace(n,``):e}})),K=n(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),p_=n(((e,t)=>{function n(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
116
116
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,c;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,c=e},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw c}}}}function r(e,t){if(e){if(typeof e==`string`)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function i(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let a=f_(),o=K(),s=o.erase,c=o.cursor,l=e=>[...a(e)].length;t.exports=function(e,t){if(!t)return s.line+c.to(0);let r=0;var i=n(e.split(/\r?\n/)),a;try{for(i.s();!(a=i.n()).done;){let e=a.value;r+=1+Math.floor(Math.max(l(e)-1,0)/t)}}catch(e){i.e(e)}finally{i.f()}return s.lines(r)}})),m_=n(((e,t)=>{let n={arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,radioOn:`◉`,radioOff:`◯`,tick:`✔`,cross:`✖`,ellipsis:`…`,pointerSmall:`›`,line:`─`,pointer:`❯`},r={arrowUp:n.arrowUp,arrowDown:n.arrowDown,arrowLeft:n.arrowLeft,arrowRight:n.arrowRight,radioOn:`(*)`,radioOff:`( )`,tick:`√`,cross:`×`,ellipsis:`...`,pointerSmall:`»`,line:`─`,pointer:`>`};t.exports=process.platform===`win32`?r:n})),h_=n(((e,t)=>{let n=G(),r=m_(),i=Object.freeze({password:{scale:1,render:e=>`*`.repeat(e.length)},emoji:{scale:2,render:e=>`😃`.repeat(e.length)},invisible:{scale:0,render:e=>``},default:{scale:1,render:e=>`${e}`}}),a=e=>i[e]||i.default,o=Object.freeze({aborted:n.red(r.cross),done:n.green(r.tick),exited:n.yellow(r.cross),default:n.cyan(`?`)});t.exports={styles:i,render:a,symbols:o,symbol:(e,t,n)=>t?o.aborted:n?o.exited:e?o.done:o.default,delimiter:e=>n.gray(e?r.ellipsis:r.pointerSmall),item:(e,t)=>n.gray(e?t?r.pointerSmall:`+`:r.line)}})),g_=n(((e,t)=>{let n=f_();t.exports=function(e,t){let r=String(n(e)||``).split(/\r?\n/);return t?r.map(e=>Math.ceil(e.length/t)).reduce((e,t)=>e+t):r.length}})),__=n(((e,t)=>{t.exports=(e,t={})=>{let n=Number.isSafeInteger(parseInt(t.margin))?Array(parseInt(t.margin)).fill(` `).join(``):t.margin||``,r=t.width;return(e||``).split(/\r?\n/g).map(e=>e.split(/\s+/g).reduce((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e),[n]).join(`
|
|
117
117
|
`)).join(`
|
|
118
118
|
`)}})),v_=n(((e,t)=>{t.exports=(e,t,n)=>{n||=t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,t);return{startIndex:r,endIndex:i}}})),q=n(((e,t)=>{t.exports={action:d_(),clear:p_(),style:h_(),strip:f_(),figures:m_(),lines:g_(),wrap:__(),entriesToDisplay:v_()}})),J=n(((t,n)=>{let r=e(`readline`),i=q().action,a=e(`events`),o=K(),s=o.beep,c=o.cursor,l=G();n.exports=class extends a{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>void 0)).bind(this);let t=r.createInterface({input:this.in,escapeCodeTimeout:50});r.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let n=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,a=(e,t)=>{let r=i(t,n);r===!1?this._&&this._(e,t):typeof this[r]==`function`?this[r](t):this.bell()};this.close=()=>{this.out.write(c.show),this.in.removeListener(`keypress`,a),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?`abort`:this.exited?`exit`:`submit`,this.value),this.closed=!0},this.in.on(`keypress`,a)}fire(){this.emit(`state`,{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(s)}render(){this.onRender(l),this.firstRender&&=!1}}})),y_=n(((e,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=G(),a=J(),o=K(),s=o.erase,c=o.cursor,l=q(),u=l.style,d=l.clear,f=l.lines,p=l.figures;t.exports=class extends a{constructor(e={}){super(e),this.transform=u.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||``,this.validator=e.validate||(()=>!0),this.value=``,this.errorMsg=e.error||`Please Enter A Valid Value`,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=d(``,this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=i.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value=``,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
@@ -194,29 +194,29 @@ Instructions:
|
|
|
194
194
|
`:``}renderCurrentInput(){return`
|
|
195
195
|
Filtered results for: ${this.inputValue?this.inputValue:n.gray(`Enter something to filter`)}\n`}renderOption(e,t,r){let i;return i=t.disabled?e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):e===r?n.cyan().underline(t.title):t.title,(t.selected?n.green(s.radioOn):s.radioOff)+` `+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=a(e,this.out.columns)}}})),fv=n(((e,t)=>{let n=G(),r=J_(),{style:i,clear:a}=X(),{erase:o,cursor:s}=K();t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||`yes`,this.yesOption=e.yesOption||`(Y/n)`,this.noMsg=e.no||`no`,this.noOption=e.noOption||`(y/N)`,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
196
196
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
197
|
-
`),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(o.line+s.to(0)+this.outputText))}}})),pv=n(((e,t)=>{t.exports={TextPrompt:Y_(),SelectPrompt:X_(),TogglePrompt:Z_(),DatePrompt:sv(),NumberPrompt:cv(),MultiselectPrompt:lv(),AutocompletePrompt:uv(),AutocompleteMultiselectPrompt:dv(),ConfirmPrompt:fv()}})),mv=n((e=>{let t=e,n=pv(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})),hv=n(((e,t)=>{let n=mv(),r=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],i=()=>{};async function a(e=[],{onSubmit:t=i,onCancel:s=i}={}){let c={},l=a._override||{};e=[].concat(e);let u,d,f,p,m,h,g=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,c):t};for(d of e)if({name:p,type:m}=d,typeof m==`function`&&(m=await m(u,{...c},d),d.type=m),m){for(let e in d){if(r.includes(e))continue;let t=d[e];d[e]=typeof t==`function`?await t(u,{...c},h):t}if(h=d,typeof d.message!=`string`)throw Error(`prompt message is required`);if({name:p,type:m}=d,n[m]===void 0)throw Error(`prompt type (${m}) is not defined`);if(l[d.name]!==void 0&&(u=await g(d,l[d.name]),u!==void 0)){c[p]=u;continue}try{u=a._injected?o(a._injected,d.initial):await n[m](d),c[p]=u=await g(d,u,!0),f=await t(d,u,c)}catch{f=!await s(d,c)}if(f)return c}return c}function o(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function s(e){a._injected=(a._injected||[]).concat(e)}function c(e){a._override=Object.assign({},e)}t.exports=Object.assign(a,{prompt:a,prompts:n,inject:s,override:c})})),gv=t(n(((e,t)=>{function n(e){e=(Array.isArray(e)?e:e.split(`.`)).map(Number);let t=0,n=process.versions.node.split(`.`).map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}t.exports=n(`8.6.0`)?z_():hv()}))(),1);function _v({vue:e,react:t}){return{devDependencies:{[`@nice-move/eslint-config-${t&&e||!t&&!e?`base`:t?`react`:`vue`}`]:
|
|
198
|
-
`)).output(`.githooks/pre-commit`),a&&await new
|
|
197
|
+
`),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(o.line+s.to(0)+this.outputText))}}})),pv=n(((e,t)=>{t.exports={TextPrompt:Y_(),SelectPrompt:X_(),TogglePrompt:Z_(),DatePrompt:sv(),NumberPrompt:cv(),MultiselectPrompt:lv(),AutocompletePrompt:uv(),AutocompleteMultiselectPrompt:dv(),ConfirmPrompt:fv()}})),mv=n((e=>{let t=e,n=pv(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})),hv=n(((e,t)=>{let n=mv(),r=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],i=()=>{};async function a(e=[],{onSubmit:t=i,onCancel:s=i}={}){let c={},l=a._override||{};e=[].concat(e);let u,d,f,p,m,h,g=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,c):t};for(d of e)if({name:p,type:m}=d,typeof m==`function`&&(m=await m(u,{...c},d),d.type=m),m){for(let e in d){if(r.includes(e))continue;let t=d[e];d[e]=typeof t==`function`?await t(u,{...c},h):t}if(h=d,typeof d.message!=`string`)throw Error(`prompt message is required`);if({name:p,type:m}=d,n[m]===void 0)throw Error(`prompt type (${m}) is not defined`);if(l[d.name]!==void 0&&(u=await g(d,l[d.name]),u!==void 0)){c[p]=u;continue}try{u=a._injected?o(a._injected,d.initial):await n[m](d),c[p]=u=await g(d,u,!0),f=await t(d,u,c)}catch{f=!await s(d,c)}if(f)return c}return c}function o(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function s(e){a._injected=(a._injected||[]).concat(e)}function c(e){a._override=Object.assign({},e)}t.exports=Object.assign(a,{prompt:a,prompts:n,inject:s,override:c})})),gv=t(n(((e,t)=>{function n(e){e=(Array.isArray(e)?e:e.split(`.`)).map(Number);let t=0,n=process.versions.node.split(`.`).map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}t.exports=n(`8.6.0`)?z_():hv()}))(),1);function _v({vue:e,react:t}){return{devDependencies:{[`@nice-move/eslint-config-${t&&e||!t&&!e?`base`:t?`react`:`vue`}`]:R[`eslint-config-base`],eslint:R.eslint},scripts:{"lint:eslint":`eslint . --quiet --fix --concurrency=auto`}}}const vv=`Add/Reset project dependencies`;function yv(e,t={}){return new Zt().config({pretty:!0}).source(`package.json`).onFail().onDone(async(e={})=>{let{devDependencies:n={},dependencies:r={}}=e,{ava:i=`ava`in n,commitlint:a=`commitlint`in n,eslint:o=`eslint`in n,garou:s=`garou`in n,prettier:c=`prettier`in n,react:l=`react`in r,stylelint:u=`stylelint`in n,syncpack:d=`syncpack`in n,typescript:f=`typescript`in n,vue:p=`vue`in r,tailwindcss:m=`tailwindcss`in r||`tailwindcss`in n,playwright:h,"@bring-it/sftp":g=`@bring-it/sftp`in n,"@bring-it/npm":_=`@bring-it/npm`in n,"best-shot":v=`best-shot`in n}=t,y=o||u||c||s,b=[y?`pnpm run lint:staged`:void 0,f?`pnpm run lint:type`:void 0,i?`pnpm test`:void 0].filter(Boolean);return b.length>0&&await new F().onDone(()=>[`#!/bin/sh`,``,...b.map((e,t,n)=>t===n-1?e:`${e} || exit 1`),``].join(`
|
|
198
|
+
`)).output(`.githooks/pre-commit`),a&&await new F().onDone(()=>[`#!/bin/sh`,`pnpm exec nice-move lint commit`,``].join(`
|
|
199
199
|
|
|
200
|
-
`)).output(`.githooks/commit-msg`),o&&await new
|
|
200
|
+
`)).output(`.githooks/commit-msg`),o&&await new F().onDone(()=>[l?`import config from '@nice-move/eslint-config-react';`:p?`import config from '@nice-move/eslint-config-vue';`:`import config from '@nice-move/eslint-config-base';`,`export default [...config];`,``].join(`
|
|
201
201
|
|
|
202
|
-
`)).output(`eslint.config.mjs`),d&&await new
|
|
202
|
+
`)).output(`eslint.config.mjs`),d&&await new F().onDone(()=>[`// @ts-check`,`// import defineConfig from '@nice-move/syncpack-config/define.mjs';`,`// export default defineConfig(import.meta.url, {});`,`export { default } from '@nice-move/syncpack-config';`].join(`
|
|
203
203
|
|
|
204
|
-
`)).output(`syncpack.config.mjs`),f&&await new
|
|
204
|
+
`)).output(`syncpack.config.mjs`),f&&await new Zt().config({pretty:!0}).onDone(()=>({extends:l?`@nice-move/tsconfig/react.json`:p?`@nice-move/tsconfig/vue.json`:`@nice-move/tsconfig/base.json`,compilerOptions:{noEmit:!0}})).output(`tsconfig.json`),Gr(...[e,{scripts:{prepare:`nice-move git hooks`}},s?{devDependencies:{garou:R.garou}}:void 0,f?{devDependencies:{typescript:R.typescript,"@nice-move/tsconfig":R.tsconfig},scripts:{"lint:type":`tsc -p tsconfig.json`}}:void 0,y||a?{devDependencies:{"@nice-move/cli":R.cli}}:void 0,y?{scripts:{"lint:staged":`nice-move lint staged`}}:void 0,i?{devDependencies:{ava:R.ava,...o?{"eslint-plugin-ava":R[`eslint-plugin-ava`]}:void 0},scripts:{prepublishOnly:!e.private&&b.length>0?b.join(` && `):void 0,test:`ava --fail-fast`,snapshot:`ava --fail-fast -u`}}:void 0,o?_v({react:l,vue:p}):void 0,u?{devDependencies:{"@nice-move/stylelint-config":R[`stylelint-config`],stylelint:R.stylelint},stylelint:{extends:`@nice-move/stylelint-config`}}:void 0,d?{devDependencies:{"@nice-move/syncpack-config":R[`syncpack-config`],syncpack:R.syncpack},scripts:{"lint:version":`syncpack lint`,"version:pin":`syncpack fix-mismatches`}}:void 0,c?{devDependencies:{"@nice-move/prettier-config":R[`prettier-config`],prettier:R.prettier},prettier:`@nice-move/prettier-config`}:void 0,l?{dependencies:{react:R.react,"react-dom":R[`react-dom`]},devDependencies:{"@types/react":R[`@types/react`],"@types/react-dom":R[`@types/react-dom`]}}:void 0,p?{dependencies:{vue:R.vue}}:void 0,m?{dependencies:{tailwindcss:R.tailwindcss},devDependencies:{"prettier-plugin-tailwindcss":c?R[`prettier-plugin-tailwindcss`]:void 0}}:void 0,h?{scripts:{"pretest:e2e":`pnpm link @playwright/test`,"test:e2e":`playwright test`}}:void 0,g?{devDependencies:{"@bring-it/sftp":R[`@bring-it/sftp`]}}:void 0,_?{devDependencies:{"@bring-it/npm":R[`@bring-it/npm`]}}:void 0,v?{devDependencies:{"best-shot":R[`best-shot`]},"nice-move":{globals:{BEST_SHOT:`readonly`}},scripts:{build:`best-shot prod`}}:void 0].filter(Boolean))}).output().logger(vv).catch(console.warn)}function bv(){let e=[`tailwindcss`,`react`,`vue`,`typescript`,`commitlint`,`eslint`,`stylelint`,`prettier`,`syncpack`,`garou`,`ava`,`playwright`,`@bring-it/sftp`,`@bring-it/npm`,`best-shot`],{dependencies:t={},devDependencies:n={}}=Cr();return{instructions:!1,optionsPerPage:20,message:vv,name:`Dependencies`,type:e=>e===!1?null:`multiselect`,choices:e.map(e=>({title:e,value:e,selected:e in t||e in n})),format:e=>{if(e.length>0)return t=>yv(t,Object.fromEntries(e.map(e=>[e,!0])))}}}const xv=`Initialize as git repository`;function Sv(){return o_(`git`,[`init`]).then(e=>(console.log(en(`√`),xv),e),e=>{throw console.log($t(`×`),xv),e})}function Cv({gitSupported:e,isRoot:t}){return{message:xv,name:`GitInit`,initial:!0,type:n=>n===!1||!e||t?null:`confirm`,format(e){if(e===!0)return Sv}}}
|
|
205
205
|
/*!
|
|
206
206
|
* author-regex <https://github.com/jonschlinkert/author-regex>
|
|
207
207
|
*
|
|
208
208
|
* Copyright (c) 2014, 2017, Jon Schlinkert.
|
|
209
209
|
* Released under the MIT License.
|
|
210
210
|
*/
|
|
211
|
-
var wv=n(((e,t)=>{t.exports=function(){return/^\s*([^<(]*?)\s*([<(]([^>)]*?)[>)])?\s*([<(]([^>)]*?)[>)])*\s*$/}})),Tv=t(n(((e,t)=>{var n=wv();t.exports=function(e){if(typeof e!=`string`)throw TypeError(`expected author to be a string`);if(!e||!/\w/.test(e))return{};var t=[].concat.apply([],n().exec(e)),r={};t[1]&&(r.name=t[1]);for(var i=2;i<t.length;i++){var a=t[i];i%2==0&&a&&t[i+1]&&(a.charAt(0)===`<`?(r.email=t[i+1],i++):a.charAt(0)===`(`&&(r.url=t[i+1],i++))}return r}}))(),1);function Ev(){return/(?<=^v?|\sv?)(?:(?:0|[1-9]\d{0,9}?)\.){2}(?:0|[1-9]\d{0,9})(?:-(?:--+)?(?:0|[1-9]\d*|\d*[a-z]+\d*)){0,100}(?=$| |\+|\.)(?:(?<=-\S+)(?:\.(?:--?|[\da-z-]*[a-z-]\d*|0|[1-9]\d*)){1,100}?)?(?!\.)(?:\+(?:[\da-z]\.?-?){1,100}?(?!\w))?(?!\+)/gi}var Dv=t(n(((t,n)=>{let{builtinModules:r}=e(`module`);var i=RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),a=[`node_modules`,`favicon.ico`];function o(e){var t=[],n=[];if(e===null)return n.push(`name cannot be null`),s(t,n);if(e===void 0)return n.push(`name cannot be undefined`),s(t,n);if(typeof e!=`string`)return n.push(`name must be a string`),s(t,n);if(e.length||n.push(`name length must be greater than zero`),e.startsWith(`.`)&&n.push(`name cannot start with a period`),e.startsWith(`-`)&&n.push(`name cannot start with a hyphen`),e.match(/^_/)&&n.push(`name cannot start with an underscore`),e.trim()!==e&&n.push(`name cannot contain leading or trailing spaces`),a.forEach(function(t){e.toLowerCase()===t&&n.push(t+` is not a valid package name`)}),r.includes(e.toLowerCase())&&t.push(e+` is a core module name`),e.length>214&&t.push(`name can no longer contain more than 214 characters`),e.toLowerCase()!==e&&t.push(`name can no longer contain capital letters`),/[~'!()*]/.test(e.split(`/`).slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var o=e.match(i);if(o){var c=o[1],l=o[2];if(l.startsWith(`.`)&&n.push(`name cannot start with a period`),encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return s(t,n)}n.push(`name can only contain URL-friendly characters`)}return s(t,n)}var s=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n};n.exports=o}))(),1);const Ov=Ev();function kv(e){return Array.isArray(e)&&e.length>0}async function Av({cwd:e,pkg:{author:t,description:n,license:r,name:i,private:a,version:o,workspaces:c}={}}){return[{format:vr,initial:s(e).base,message:`package.json » name`,name:`name`,type:e=>e===!1||i?null:`text`,validate:e=>(0,Dv.default)(vr(e)||``).validForNewPackages},{format:vr,initial:`0.0.0`,message:`package.json » version`,name:`version`,type:e=>e===!1||o?null:`text`,validate:e=>Ov.test(vr(e)||``)},{format:vr,message:`package.json » description`,name:`description`,type:e=>e===!1||n?null:`text`},{active:`MIT`,format:e=>e?`MIT`:`UNLICENSED`,inactive:`UNLICENSED`,initial:!0,message:`package.json » license`,name:`license`,type:e=>e===!1||r?null:`toggle`},{type:e=>e===!1||(typeof t==`string`?t:t&&t.name)?null:`text`,format:Tv.default,initial:await br(t),message:`package.json » author`,name:`author`},{active:`true`,inactive:`false`,initial:!1,message:`package.json » private`,name:`private`,format:e=>e===!1?void 0:e,type:e=>e===!1||a!==void 0?null:`toggle`},{active:`recommend`,inactive:`false`,initial:!1,message:`package.json » workspaces`,name:`workspaces`,format:e=>e?[`packages/*`,`tools/*`]:void 0,type:(e,t)=>e===!1||a===!1||t.private===!1||kv(c&&c.packages?c.packages:c)?null:`toggle`}]}function jv(){return o_(`git`,[`--version`]).then(({stdout:e})=>!!e)}function Mv(){return o_(`git`,[`rev-parse`,`--git-dir`]).then(({stdout:e})=>e===`.git`).catch(()=>!1)}function Nv(){return o_(`git`,[`status`,`--short`]).then(({stdout:e})=>e.length>0)}async function Pv(){let e=await jv(),t=e&&await Mv(),n=t?await Nv():!1,r=_r(),i={gitSupported:e,isRoot:t,isDirty:n,isEmpty:r,pkg:Sr(),cwd:process.cwd()},a=await Av(i);return(0,gv.default)([{active:`do it`,inactive:`cancel`,message:n===!0?`Repository not clean`:`Workspace not empty`,name:`okay`,type:()=>r||n===!1?null:`toggle`},Cv(i),...a,bv(i)],{onCancel(){throw Error(`cancel`)}}).then(({okay:e,...t})=>{if(e===!1)throw Error(`cancel`);return Object.entries(t)}).then(e=>{let t=a.map(({name:e})=>e),n=Object.fromEntries(e.filter(([e])=>t.includes(e)));return{...Object.fromEntries(e.filter(([e])=>!t.includes(e))),info:n,options:i}})}var Q=n((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),Fv=n((e=>{var t=Q();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),Iv=n((e=>{var t=Q(),n=Fv();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)t===`!!`&&n===`tag:yaml.org,2002:`||(!e||a.some(e=>e.startsWith(n)))&&r.push(`%TAG ${t} ${n}`);return r.join(`
|
|
212
|
-
`)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),
|
|
211
|
+
var wv=n(((e,t)=>{t.exports=function(){return/^\s*([^<(]*?)\s*([<(]([^>)]*?)[>)])?\s*([<(]([^>)]*?)[>)])*\s*$/}})),Tv=t(n(((e,t)=>{var n=wv();t.exports=function(e){if(typeof e!=`string`)throw TypeError(`expected author to be a string`);if(!e||!/\w/.test(e))return{};var t=[].concat.apply([],n().exec(e)),r={};t[1]&&(r.name=t[1]);for(var i=2;i<t.length;i++){var a=t[i];i%2==0&&a&&t[i+1]&&(a.charAt(0)===`<`?(r.email=t[i+1],i++):a.charAt(0)===`(`&&(r.url=t[i+1],i++))}return r}}))(),1);function Ev(){return/(?<=^v?|\sv?)(?:(?:0|[1-9]\d{0,9}?)\.){2}(?:0|[1-9]\d{0,9})(?:-(?:--+)?(?:0|[1-9]\d*|\d*[a-z]+\d*)){0,100}(?=$| |\+|\.)(?:(?<=-\S+)(?:\.(?:--?|[\da-z-]*[a-z-]\d*|0|[1-9]\d*)){1,100}?)?(?!\.)(?:\+(?:[\da-z]\.?-?){1,100}?(?!\w))?(?!\+)/gi}var Dv=n(((e,t)=>{t.exports=`_http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib.node:sea.node:sqlite.node:test.node:test/reporters`.split(`.`)})),Ov=t(n(((e,t)=>{let n=Dv();var r=RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),i=[`node_modules`,`favicon.ico`];function a(e){var t=[],a=[];if(e===null)return a.push(`name cannot be null`),o(t,a);if(e===void 0)return a.push(`name cannot be undefined`),o(t,a);if(typeof e!=`string`)return a.push(`name must be a string`),o(t,a);if(e.length||a.push(`name length must be greater than zero`),e.startsWith(`.`)&&a.push(`name cannot start with a period`),e.startsWith(`-`)&&a.push(`name cannot start with a hyphen`),e.match(/^_/)&&a.push(`name cannot start with an underscore`),e.trim()!==e&&a.push(`name cannot contain leading or trailing spaces`),i.forEach(function(t){e.toLowerCase()===t&&a.push(t+` is not a valid package name`)}),n.includes(e.toLowerCase())&&t.push(e+` is a core module name`),e.length>214&&t.push(`name can no longer contain more than 214 characters`),e.toLowerCase()!==e&&t.push(`name can no longer contain capital letters`),/[~'!()*]/.test(e.split(`/`).slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var s=e.match(r);if(s){var c=s[1],l=s[2];if(l.startsWith(`.`)&&a.push(`name cannot start with a period`),encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return o(t,a)}a.push(`name can only contain URL-friendly characters`)}return o(t,a)}var o=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n};t.exports=a}))(),1);const kv=Ev();function Av(e){return Array.isArray(e)&&e.length>0}async function jv({cwd:e,pkg:{author:t,description:n,license:r,name:i,private:a,version:o,workspaces:c}={}}){return[{format:yr,initial:s(e).base,message:`package.json » name`,name:`name`,type:e=>e===!1||i?null:`text`,validate:e=>(0,Ov.default)(yr(e)||``).validForNewPackages},{format:yr,initial:`0.0.0`,message:`package.json » version`,name:`version`,type:e=>e===!1||o?null:`text`,validate:e=>kv.test(yr(e)||``)},{format:yr,message:`package.json » description`,name:`description`,type:e=>e===!1||n?null:`text`},{active:`MIT`,format:e=>e?`MIT`:`UNLICENSED`,inactive:`UNLICENSED`,initial:!0,message:`package.json » license`,name:`license`,type:e=>e===!1||r?null:`toggle`},{type:e=>e===!1||(typeof t==`string`?t:t&&t.name)?null:`text`,format:Tv.default,initial:await xr(t),message:`package.json » author`,name:`author`},{active:`true`,inactive:`false`,initial:!1,message:`package.json » private`,name:`private`,format:e=>e===!1?void 0:e,type:e=>e===!1||a!==void 0?null:`toggle`},{active:`recommend`,inactive:`false`,initial:!1,message:`package.json » workspaces`,name:`workspaces`,format:e=>e?[`packages/*`,`tools/*`]:void 0,type:(e,t)=>e===!1||a===!1||t.private===!1||Av(c&&c.packages?c.packages:c)?null:`toggle`}]}function Mv(){return o_(`git`,[`--version`]).then(({stdout:e})=>!!e)}function Nv(){return o_(`git`,[`rev-parse`,`--git-dir`]).then(({stdout:e})=>e===`.git`).catch(()=>!1)}function Pv(){return o_(`git`,[`status`,`--short`]).then(({stdout:e})=>e.length>0)}async function Fv(){let e=await Mv(),t=e&&await Nv(),n=t?await Pv():!1,r=vr(),i={gitSupported:e,isRoot:t,isDirty:n,isEmpty:r,pkg:Cr(),cwd:process.cwd()},a=await jv(i);return(0,gv.default)([{active:`do it`,inactive:`cancel`,message:n===!0?`Repository not clean`:`Workspace not empty`,name:`okay`,type:()=>r||n===!1?null:`toggle`},Cv(i),...a,bv(i)],{onCancel(){throw Error(`cancel`)}}).then(({okay:e,...t})=>{if(e===!1)throw Error(`cancel`);return Object.entries(t)}).then(e=>{let t=a.map(({name:e})=>e),n=Object.fromEntries(e.filter(([e])=>t.includes(e)));return{...Object.fromEntries(e.filter(([e])=>!t.includes(e))),info:n,options:i}})}var Q=n((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),Iv=n((e=>{var t=Q();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),Lv=n((e=>{var t=Q(),n=Iv();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)t===`!!`&&n===`tag:yaml.org,2002:`||(!e||a.some(e=>e.startsWith(n)))&&r.push(`%TAG ${t} ${n}`);return r.join(`
|
|
212
|
+
`)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),Rv=n((e=>{var t=Q(),n=Iv();function r(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function i(e){let t=new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function a(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function o(e,n){let r=[],o=new Map,s=null;return{onAnchor:t=>{r.push(t),s??=i(e);let o=a(n,s);return s.add(o),o},setAnchors:()=>{for(let e of r){let n=o.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:o}}e.anchorIsValid=r,e.anchorNames=i,e.createNodeAnchors=o,e.findNewAnchor=a})),zv=n((e=>{function t(e,n,r,i){if(i&&typeof i==`object`)if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let r=i[n],a=t(e,i,String(n),r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=t(e,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=t(e,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=t(e,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}return e.call(n,r,i)}e.applyReviver=t})),Bv=n((e=>{var t=Q();function n(e,r,i){if(Array.isArray(e))return e.map((e,t)=>n(e,String(t),i));if(e&&typeof e.toJSON==`function`){if(!i||!t.hasAnchor(e))return e.toJSON(r,i);let n={aliasCount:0,count:1,res:void 0};i.anchors.set(e,n),i.onCreate=e=>{n.res=e,delete i.onCreate};let a=e.toJSON(r,i);return i.onCreate&&i.onCreate(a),a}return typeof e==`bigint`&&!i?.keep?Number(e):e}e.toJS=n})),Vv=n((e=>{var t=zv(),n=Q(),r=Bv();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),Hv=n((e=>{var t=Rv(),n=Iv(),r=Q(),i=Vv(),a=Bv(),o=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],n.visit(e,{Node:(e,t)=>{(r.isAlias(t)||r.hasAnchor(t))&&i.push(t)}}),t&&(t.aliasResolveCache=i));let a;for(let e of i){if(e===this)break;e.anchor===this.source&&(a=e)}return a}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r,t);if(!o){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let c=n.get(o);if(c||=(a.toJS(o,null,t),n.get(o)),c?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=s(r,o,n)),c.count*c.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return c.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${i} `}return i}};function s(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(r.isCollection(t)){let r=0;for(let i of t.items){let t=s(e,i,n);t>r&&(r=t)}return r}else if(r.isPair(t)){let r=s(e,t.key,n),i=s(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=o})),$=n((e=>{var t=Q(),n=Vv(),r=Bv();let i=e=>!e||typeof e!=`function`&&typeof e!=`object`;var a=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};a.BLOCK_FOLDED=`BLOCK_FOLDED`,a.BLOCK_LITERAL=`BLOCK_LITERAL`,a.PLAIN=`PLAIN`,a.QUOTE_DOUBLE=`QUOTE_DOUBLE`,a.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=a,e.isScalarValue=i})),Uv=n((e=>{var t=Hv(),n=Q(),r=$();function i(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function a(e,a,o){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=o.schema[n.MAP].createNode?.(o.schema,null,o);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:c,onTagObj:l,schema:u,sourceObjects:d}=o,f;if(s&&e&&typeof e==`object`){if(f=d.get(e),f)return f.anchor??=c(e),new t.Alias(f.anchor);f={anchor:null,node:null},d.set(e,f)}a?.startsWith(`!!`)&&(a=`tag:yaml.org,2002:`+a.slice(2));let p=i(e,a,u.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return f&&(f.node=t),t}p=e instanceof Map?u[n.MAP]:Symbol.iterator in Object(e)?u[n.SEQ]:u[n.MAP]}l&&(l(p),delete o.onTagObj);let m=p?.createNode?p.createNode(o.schema,e,o):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(o.schema,e,o):new r.Scalar(e);return a?m.tag=a:p.default||(m.tag=p.tag),f&&(f.node=m),m}e.createNode=a})),Wv=n((e=>{var t=Uv(),n=Q(),r=Vv();function i(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}let a=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{let[r,...a]=e,o=this.get(r,!0);if(n.isCollection(o))o.addIn(a,t);else if(o===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...a]=e;if(a.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(a,t);else if(e===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}},e.collectionFromPath=i,e.isEmptyPath=a})),Gv=n((e=>{let t=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=n,e.lineComment=(e,t,r)=>e.endsWith(`
|
|
213
213
|
`)?n(r,t):r.includes(`
|
|
214
214
|
`)?`
|
|
215
|
-
`+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),
|
|
215
|
+
`+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),Kv=n((e=>{let t=`block`,n=`quoted`;function r(e,r,a=`flow`,{indentAtStart:o,lineWidth:s=80,minContentWidth:c=20,onFold:l,onOverflow:u}={}){if(!s||s<0)return e;s<c&&(c=0);let d=Math.max(1+c,1+s-r.length);if(e.length<=d)return e;let f=[],p={},m=s-r.length;typeof o==`number`&&(o>s-Math.max(2,c)?f.push(0):m=s-o);let h,g,_=!1,v=-1,y=-1,b=-1;a===t&&(v=i(e,v,r.length),v!==-1&&(m=v+d));for(let o;o=e[v+=1];){if(a===n&&o===`\\`){switch(y=v,e[v+1]){case`x`:v+=3;break;case`u`:v+=5;break;case`U`:v+=9;break;default:v+=1}b=v}if(o===`
|
|
216
216
|
`)a===t&&(v=i(e,v,r.length)),m=v+r.length+d,h=void 0;else{if(o===` `&&g&&g!==` `&&g!==`
|
|
217
217
|
`&&g!==` `){let t=e[v+1];t&&t!==` `&&t!==`
|
|
218
218
|
`&&t!==` `&&(h=v)}if(v>=m)if(h)f.push(h),m=h+d,h=void 0;else if(a===n){for(;g===` `||g===` `;)g=o,o=e[v+=1],_=!0;let t=v>b+1?v-2:y-1;if(p[t])return e;f.push(t),p[t]=!0,m=t+d,h=void 0}else _=!0}g=o}if(_&&u&&u(),f.length===0)return e;l&&l();let x=e.slice(0,f[0]);for(let t=0;t<f.length;++t){let i=f[t],o=f[t+1]||e.length;i===0?x=`\n${r}${e.slice(0,o)}`:(a===n&&p[i]&&(x+=`${e[i]}\\`),x+=`\n${r}${e.slice(i+1,o)}`)}return x}function i(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
219
|
-
`);r=t,i=t+1,a=e[i]}return r}e.FOLD_BLOCK=t,e.FOLD_FLOW=`flow`,e.FOLD_QUOTED=n,e.foldFlowLines=r})),
|
|
219
|
+
`);r=t,i=t+1,a=e[i]}return r}e.FOLD_BLOCK=t,e.FOLD_FLOW=`flow`,e.FOLD_QUOTED=n,e.foldFlowLines=r})),qv=n((e=>{var t=$(),n=Kv();let r=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),i=e=>/^(%|---|\.\.\.)/m.test(e);function a(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
220
220
|
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function o(e,t){let a=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return a;let{implicitKey:o}=t,s=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(i(e)?` `:``),l=``,u=0;for(let e=0,t=a[e];t;t=a[++e])if(t===` `&&a[e+1]===`\\`&&a[e+2]===`n`&&(l+=a.slice(u,e)+`\\ `,e+=1,u=e,t=`\\`),t===`\\`)switch(a[e+1]){case`u`:{l+=a.slice(u,e);let t=a.substr(e+2,4);switch(t){case`0000`:l+=`\\0`;break;case`0007`:l+=`\\a`;break;case`000b`:l+=`\\v`;break;case`001b`:l+=`\\e`;break;case`0085`:l+=`\\N`;break;case`00a0`:l+=`\\_`;break;case`2028`:l+=`\\L`;break;case`2029`:l+=`\\P`;break;default:t.substr(0,2)===`00`?l+=`\\x`+t.substr(2):l+=a.substr(e,6)}e+=5,u=e+1}break;case`n`:if(o||a[e+2]===`"`||a.length<s)e+=1;else{for(l+=a.slice(u,e)+`
|
|
221
221
|
|
|
222
222
|
`;a[e+2]===`\\`&&a[e+3]===`n`&&a[e+4]!==`"`;)l+=`
|
|
@@ -234,29 +234,29 @@ var wv=n(((e,t)=>{t.exports=function(){return/^\s*([^<(]*?)\s*([<(]([^>)]*?)[>)]
|
|
|
234
234
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${g}`),i=!1,a=r(u,!0);p!==`folded`&&o!==t.Scalar.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let c=n.foldFlowLines(`${T}${e}${b}`,g,n.FOLD_BLOCK,a);if(!i)return`>${E}\n${g}${c}`}return s=s.replace(/\n+/g,`$&${g}`),`|${E}\n${g}${T}${s}${b}`}function d(e,a,o,s){let{type:l,value:d}=e,{actualString:f,implicitKey:p,indent:m,indentStep:h,inFlow:g}=a;if(p&&d.includes(`
|
|
235
235
|
`)||g&&/[[\]{},]/.test(d))return c(d,a);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(d))return p||g||!d.includes(`
|
|
236
236
|
`)?c(d,a):u(e,a,o,s);if(!p&&!g&&l!==t.Scalar.PLAIN&&d.includes(`
|
|
237
|
-
`))return u(e,a,o,s);if(i(d)){if(m===``)return a.forceBlockIndent=!0,u(e,a,o,s);if(p&&m===h)return c(d,a)}let _=d.replace(/\n+/g,`$&\n${m}`);if(f){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(_),{compat:t,tags:n}=a.doc.schema;if(n.some(e)||t?.some(e))return c(d,a)}return p?_:n.foldFlowLines(_,m,n.FOLD_FLOW,r(a,!1))}function f(e,n,r,i){let{implicitKey:a,inFlow:l}=n,f=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:p}=e;p!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(p=t.Scalar.QUOTE_DOUBLE);let m=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||l?c(f.value,n):u(f,n,r,i);case t.Scalar.QUOTE_DOUBLE:return o(f.value,n);case t.Scalar.QUOTE_SINGLE:return s(f.value,n);case t.Scalar.PLAIN:return d(f,n,r,i);default:return null}},h=m(p);if(h===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(h=m(r),h===null)throw Error(`Unsupported default string type ${r}`)}return h}e.stringifyString=f})),
|
|
237
|
+
`))return u(e,a,o,s);if(i(d)){if(m===``)return a.forceBlockIndent=!0,u(e,a,o,s);if(p&&m===h)return c(d,a)}let _=d.replace(/\n+/g,`$&\n${m}`);if(f){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(_),{compat:t,tags:n}=a.doc.schema;if(n.some(e)||t?.some(e))return c(d,a)}return p?_:n.foldFlowLines(_,m,n.FOLD_FLOW,r(a,!1))}function f(e,n,r,i){let{implicitKey:a,inFlow:l}=n,f=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:p}=e;p!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(p=t.Scalar.QUOTE_DOUBLE);let m=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||l?c(f.value,n):u(f,n,r,i);case t.Scalar.QUOTE_DOUBLE:return o(f.value,n);case t.Scalar.QUOTE_SINGLE:return s(f.value,n);case t.Scalar.PLAIN:return d(f,n,r,i);default:return null}},h=m(p);if(h===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(h=m(r),h===null)throw Error(`Unsupported default string type ${r}`)}return h}e.stringifyString=f})),Jv=n((e=>{var t=Rv(),n=Q(),r=Gv(),i=qv();function a(e,t){let n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case`block`:i=!1;break;case`flow`:i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:i,options:n}}function o(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let r,i;if(n.isScalar(t)){i=t.value;let n=e.filter(e=>e.identify?.(i));if(n.length>1){let e=n.filter(e=>e.test);e.length>0&&(n=e)}r=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i?.constructor?.name??(i===null?`null`:typeof i);throw Error(`Tag not resolved for ${e} value`)}return r}function s(e,r,{anchors:i,doc:a}){if(!a.directives)return``;let o=[],s=(n.isScalar(e)||n.isCollection(e))&&e.anchor;s&&t.anchorIsValid(s)&&(i.add(s),o.push(`&${s}`));let c=e.tag??(r.default?null:r.tag);return c&&o.push(a.directives.tagString(c)),o.join(` `)}function c(e,t,r,a){if(n.isPair(e))return e.toString(t,r,a);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let c,l=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>c=e});c??=o(t.doc.schema.tags,l);let u=s(l,c,t);u.length>0&&(t.indentAtStart=(t.indentAtStart??0)+u.length+1);let d=typeof c.stringify==`function`?c.stringify(l,t,r,a):n.isScalar(l)?i.stringifyString(l,t,r,a):l.toString(t,r,a);return u?n.isScalar(l)||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}\n${t.indent}${d}`:d}e.createStringifyContext=a,e.stringify=c})),Yv=n((e=>{var t=Q(),n=$(),r=Jv(),i=Gv();function a({key:e,value:a},o,s,c){let{allNullValues:l,doc:u,indent:d,indentStep:f,options:{commentString:p,indentSeq:m,simpleKeys:h}}=o,g=t.isNode(e)&&e.comment||null;if(h){if(g)throw Error(`With simple keys, key nodes cannot have comments`);if(t.isCollection(e)||!t.isNode(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let _=!h&&(!e||g&&a==null&&!o.inFlow||t.isCollection(e)||(t.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==`object`));o=Object.assign({},o,{allNullValues:!1,implicitKey:!_&&(h||!l),indent:d+f});let v=!1,y=!1,b=r.stringify(e,o,()=>v=!0,()=>y=!0);if(!_&&!o.inFlow&&b.length>1024){if(h)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);_=!0}if(o.inFlow){if(l||a==null)return v&&s&&s(),b===``?`?`:_?`? ${b}`:b}else if(l&&!h||a==null&&_)return b=`? ${b}`,g&&!v?b+=i.lineComment(b,o.indent,p(g)):y&&c&&c(),b;v&&(g=null),_?(g&&(b+=i.lineComment(b,o.indent,p(g))),b=`? ${b}\n${d}:`):(b=`${b}:`,g&&(b+=i.lineComment(b,o.indent,p(g))));let x,S,C;t.isNode(a)?(x=!!a.spaceBefore,S=a.commentBefore,C=a.comment):(x=!1,S=null,C=null,a&&typeof a==`object`&&(a=u.createNode(a))),o.implicitKey=!1,!_&&!g&&t.isScalar(a)&&(o.indentAtStart=b.length+1),y=!1,!m&&f.length>=2&&!o.inFlow&&!_&&t.isSeq(a)&&!a.flow&&!a.tag&&!a.anchor&&(o.indent=o.indent.substring(2));let w=!1,T=r.stringify(a,o,()=>w=!0,()=>y=!0),E=` `;if(g||x||S){if(E=x?`
|
|
238
238
|
`:``,S){let e=p(S);E+=`\n${i.indentComment(e,o.indent)}`}T===``&&!o.inFlow?E===`
|
|
239
239
|
`&&C&&(E=`
|
|
240
240
|
|
|
241
241
|
`):E+=`\n${o.indent}`}else if(!_&&t.isCollection(a)){let e=T[0],t=T.indexOf(`
|
|
242
242
|
`),n=t!==-1,r=o.inFlow??a.flow??a.items.length===0;if(n||!r){let r=!1;if(n&&(e===`&`||e===`!`)){let n=T.indexOf(` `);e===`&`&&n!==-1&&n<t&&T[n+1]===`!`&&(n=T.indexOf(` `,n+1)),(n===-1||t<n)&&(r=!0)}r||(E=`\n${o.indent}`)}}else (T===``||T[0]===`
|
|
243
|
-
`)&&(E=``);return b+=E+T,o.inFlow?w&&s&&s():C&&!w?b+=i.lineComment(b,o.indent,p(C)):y&&c&&c(),b}e.stringifyPair=a})),
|
|
243
|
+
`)&&(E=``);return b+=E+T,o.inFlow?w&&s&&s():C&&!w?b+=i.lineComment(b,o.indent,p(C)):y&&c&&c(),b}e.stringifyPair=a})),Xv=n((t=>{var n=e(`process`);function r(e,...t){e===`debug`&&console.log(...t)}function i(e,t){(e===`debug`||e===`warn`)&&(typeof n.emitWarning==`function`?n.emitWarning(t):console.warn(t))}t.debug=r,t.warn=i})),Zv=n((e=>{var t=Q(),n=$();let r={identify:e=>e===`<<`||typeof e==`symbol`&&e.description===`<<`,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(`<<`)),{addToJSMap:a}),stringify:()=>`<<`},i=(e,i)=>(r.identify(i)||t.isScalar(i)&&(!i.type||i.type===n.Scalar.PLAIN)&&r.identify(i.value))&&e?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default);function a(e,n,r){if(r=e&&t.isAlias(r)?r.resolve(e.doc):r,t.isSeq(r))for(let t of r.items)o(e,n,t);else if(Array.isArray(r))for(let t of r)o(e,n,t);else o(e,n,r)}function o(e,n,r){let i=e&&t.isAlias(r)?r.resolve(e.doc):r;if(!t.isMap(i))throw Error(`Merge sources must be maps or map aliases`);let a=i.toJSON(null,e,Map);for(let[e,t]of a)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}e.addMergeToJSMap=a,e.isMergeKey=i,e.merge=r})),Qv=n((e=>{var t=Xv(),n=Zv(),r=Jv(),i=Q(),a=Bv();function o(e,t,{key:r,value:o}){if(i.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,o);else if(n.isMergeKey(e,r))n.addMergeToJSMap(e,t,o);else{let n=a.toJS(r,``,e);if(t instanceof Map)t.set(n,a.toJS(o,n,e));else if(t instanceof Set)t.add(n);else{let i=s(r,n,e),c=a.toJS(o,i,e);i in t?Object.defineProperty(t,i,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[i]=c}}return t}function s(e,n,a){if(n===null)return``;if(typeof n!=`object`)return String(n);if(i.isNode(e)&&a?.doc){let n=r.createStringifyContext(a.doc,{});n.anchors=new Set;for(let e of a.anchors.keys())n.anchors.add(e.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!a.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+`..."`),t.warn(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return i}return JSON.stringify(n)}e.addPairToJSMap=o})),$v=n((e=>{var t=Uv(),n=Yv(),r=Qv(),i=Q();function a(e,n,r){return new o(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}var o=class e{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return i.isNode(n)&&(n=n.clone(t)),i.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,n,this)}toString(e,t,r){return e?.doc?n.stringifyPair(this,e,t,r):JSON.stringify(this)}};e.Pair=o,e.createPair=a})),ey=n((e=>{var t=Q(),n=Jv(),r=Gv();function i(e,t,n){return(t.inFlow??e.flow?o:a)(e,t,n)}function a({comment:e,items:i},a,{blockItemPrefix:o,flowChars:c,itemIndent:l,onChompKeep:u,onComment:d}){let{indent:f,options:{commentString:p}}=a,m=Object.assign({},a,{indent:l,type:null}),h=!1,g=[];for(let e=0;e<i.length;++e){let c=i[e],u=null;if(t.isNode(c))!h&&c.spaceBefore&&g.push(``),s(a,g,c.commentBefore,h),c.comment&&(u=c.comment);else if(t.isPair(c)){let e=t.isNode(c.key)?c.key:null;e&&(!h&&e.spaceBefore&&g.push(``),s(a,g,e.commentBefore,h))}h=!1;let d=n.stringify(c,m,()=>u=null,()=>h=!0);u&&(d+=r.lineComment(d,l,p(u))),h&&u&&(h=!1),g.push(o+d)}let _;if(g.length===0)_=c.start+c.end;else{_=g[0];for(let e=1;e<g.length;++e){let t=g[e];_+=t?`\n${f}${t}`:`
|
|
244
244
|
`}}return e?(_+=`
|
|
245
245
|
`+r.indentComment(p(e),f),d&&d()):h&&u&&u(),_}function o({items:e},i,{flowChars:a,itemIndent:o}){let{indent:c,indentStep:l,flowCollectionPadding:u,options:{commentString:d}}=i;o+=l;let f=Object.assign({},i,{indent:o,inFlow:!0,type:null}),p=!1,m=0,h=[];for(let a=0;a<e.length;++a){let c=e[a],l=null;if(t.isNode(c))c.spaceBefore&&h.push(``),s(i,h,c.commentBefore,!1),c.comment&&(l=c.comment);else if(t.isPair(c)){let e=t.isNode(c.key)?c.key:null;e&&(e.spaceBefore&&h.push(``),s(i,h,e.commentBefore,!1),e.comment&&(p=!0));let n=t.isNode(c.value)?c.value:null;n?(n.comment&&(l=n.comment),n.commentBefore&&(p=!0)):c.value==null&&e?.comment&&(l=e.comment)}l&&(p=!0);let u=n.stringify(c,f,()=>l=null);a<e.length-1&&(u+=`,`),l&&(u+=r.lineComment(u,o,d(l))),!p&&(h.length>m||u.includes(`
|
|
246
246
|
`))&&(p=!0),h.push(u),m=h.length}let{start:g,end:_}=a;if(h.length===0)return g+_;if(!p){let e=h.reduce((e,t)=>e+t.length+2,2);p=i.options.lineWidth>0&&e>i.options.lineWidth}if(p){let e=g;for(let t of h)e+=t?`\n${l}${c}${t}`:`
|
|
247
|
-
`;return`${e}\n${c}${_}`}else return`${g}${u}${h.join(` `)}${u}${_}`}function s({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,``)),i){let a=r.indentComment(t(i),e);n.push(a.trimStart())}}e.stringifyCollection=i})),
|
|
248
|
-
`:` `)}return i.stringifyString({comment:e,type:t,value:u},o,s,c)}}})),py=n((e=>{var t=Q(),n=Qv(),r=$(),i=ny();function a(e,i){if(t.isSeq(e))for(let a=0;a<e.items.length;++a){let o=e.items[a];if(!t.isPair(o)){if(t.isMap(o)){o.items.length>1&&i(`Each pair must have its own sequence indicator`);let e=o.items[0]||new n.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){let t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[a]=t.isPair(o)?o:new n.Pair(o)}}else i(`Expected a sequence for this tag`);return e}function o(e,t,r){let{replacer:a}=r,o=new i.YAMLSeq(e);o.tag=`tag:yaml.org,2002:pairs`;let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof a==`function`&&(e=a.call(t,String(s++),e));let i,c;if(Array.isArray(e))if(e.length===2)i=e[0],c=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)i=t[0],c=e[i];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;o.items.push(n.createPair(i,c,r))}return o}let s={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:a,createNode:o};e.createPairs=o,e.pairs=s,e.resolvePairs=a})),my=n((e=>{var t=Q(),n=zv(),r=ey(),i=ny(),a=py(),o=class e extends i.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let e of this.items){let a,o;if(t.isPair(e)?(a=n.toJS(e.key,``,r),o=n.toJS(e.value,a,r)):a=n.toJS(e,``,r),i.has(a))throw Error(`Ordered maps must not include duplicate keys`);i.set(a,o)}return i}static from(e,t,n){let r=a.createPairs(e,t,n),i=new this;return i.items=r.items,i}};o.tag=`tag:yaml.org,2002:omap`;let s={collection:`seq`,identify:e=>e instanceof Map,nodeClass:o,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,n){let r=a.resolvePairs(e,n),i=[];for(let{key:e}of r.items)t.isScalar(e)&&(i.includes(e.value)?n(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new o,r)},createNode:(e,t,n)=>o.from(e,t,n)};e.YAMLOMap=o,e.omap=s})),hy=n((e=>{var t=$();function n({value:e,source:t},n){return t&&(e?r:i).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}let r={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new t.Scalar(!0),stringify:n},i={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new t.Scalar(!1),stringify:n};e.falseTag=i,e.trueTag=r})),gy=n((e=>{var t=$(),n=sy();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let n=new t.Scalar(parseFloat(e.replace(/_/g,``))),r=e.indexOf(`.`);if(r!==-1){let t=e.substring(r+1).replace(/_/g,``);t[t.length-1]===`0`&&(n.minFractionDigits=t.length)}return n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),_y=n((e=>{var t=sy();let n=e=>typeof e==`bigint`||Number.isInteger(e);function r(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function i(e,r,i){let{value:a}=e;if(n(a)){let e=a.toString(r);return a<0?`-`+i+e.substr(1):i+e}return t.stringifyNumber(e)}let a={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>r(e,2,2,n),stringify:e=>i(e,2,`0b`)},o={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>r(e,1,8,n),stringify:e=>i(e,8,`0`)},s={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},c={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)};e.int=s,e.intBin=a,e.intHex=c,e.intOct=o})),vy=n((e=>{var t=Q(),n=Qv(),r=ey(),i=class e extends r.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(e){let i;i=t.isPair(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new n.Pair(e.key,null):new n.Pair(e,null),r.findPair(this.items,i.key)||this.items.push(i)}get(e,n){let i=r.findPair(this.items,e);return!n&&t.isPair(i)?t.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=r.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new n.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,r){let{replacer:i}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof i==`function`&&(e=i.call(t,e,e)),a.items.push(n.createPair(e,null,r));return a}};i.tag=`tag:yaml.org,2002:set`;let a={collection:`map`,identify:e=>e instanceof Set,nodeClass:i,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>i.from(e,t,n),resolve(e,n){if(t.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new i,e);n(`Set items must all have null values`)}else n(`Expected a mapping for this tag`);return e}};e.YAMLSet=i,e.set=a})),yy=n((e=>{var t=sy();function n(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function r(e){let{value:n}=e,r=e=>e;if(typeof n==`bigint`)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return t.stringifyNumber(e);let i=``;n<0&&(i=`-`,n*=r(-1));let a=r(60),o=[n%a];return n<60?o.unshift(0):(n=(n-o[0])/a,o.unshift(n%a),n>=60&&(n=(n-o[0])/a,o.unshift(n))),i+o.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}let i={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>n(e,r),stringify:r},a={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>n(e,!1),stringify:r},o={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(o.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,r,i,a,s,c,l]=t.map(Number),u=t[7]?Number((t[7]+`00`).substr(1,3)):0,d=Date.UTC(r,i-1,a,s||0,c||0,l||0,u),f=t[8];if(f&&f!==`Z`){let e=n(f,!1);Math.abs(e)<30&&(e*=60),d-=6e4*e}return new Date(d)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``};e.floatTime=a,e.intTime=i,e.timestamp=o})),by=n((e=>{var t=ty(),n=ay(),r=ry(),i=iy(),a=fy(),o=hy(),s=gy(),c=_y(),l=Xv(),u=my(),d=py(),f=vy(),p=yy();e.schema=[t.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,s.floatNaN,s.floatExp,s.float,a.binary,l.merge,u.omap,d.pairs,f.set,p.intTime,p.floatTime,p.timestamp]})),xy=n((e=>{var t=ty(),n=ay(),r=ry(),i=iy(),a=oy(),o=cy(),s=ly(),c=uy(),l=dy(),u=fy(),d=Xv(),f=my(),p=py(),m=by(),h=vy(),g=yy();let _=new Map([[`core`,c.schema],[`failsafe`,[t.map,r.seq,i.string]],[`json`,l.schema],[`yaml11`,m.schema],[`yaml-1.1`,m.schema]]),v={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:g.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:g.intTime,map:t.map,merge:d.merge,null:n.nullTag,omap:f.omap,pairs:p.pairs,seq:r.seq,set:h.set,timestamp:g.timestamp},y={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":d.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":h.set,"tag:yaml.org,2002:timestamp":g.timestamp};function b(e,t,n){let r=_.get(t);if(r&&!e)return n&&!r.includes(d.merge)?r.concat(d.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(_.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(d.merge)),i.reduce((e,t)=>{let n=typeof t==`string`?v[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(v).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}e.coreKnownTags=y,e.getTags=b})),Sy=n((e=>{var t=Q(),n=ty(),r=ry(),i=iy(),a=xy();let o=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;e.Schema=class e{constructor({compat:e,customTags:s,merge:c,resolveKnownTags:l,schema:u,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(e)?a.getTags(e,`compat`):e?a.getTags(null,e):null,this.name=typeof u==`string`&&u||`core`,this.knownTags=l?a.coreKnownTags:{},this.tags=a.getTags(s,this.name,c),this.toStringOptions=f??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:i.string}),Object.defineProperty(this,t.SEQ,{value:r.seq}),this.sortMapEntries=typeof d==`function`?d:d===!0?o:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}})),Cy=n((e=>{var t=Q(),n=qv(),r=Wv();function i(e,i){let a=[],o=i.directives===!0;if(i.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(a.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&a.push(`---`);let s=n.createStringifyContext(e,i),{commentString:c}=s.options;if(e.commentBefore){a.length!==1&&a.unshift(``);let t=c(e.commentBefore);a.unshift(r.indentComment(t,``))}let l=!1,u=null;if(e.contents){if(t.isNode(e.contents)){if(e.contents.spaceBefore&&o&&a.push(``),e.contents.commentBefore){let t=c(e.contents.commentBefore);a.push(r.indentComment(t,``))}s.forceBlockIndent=!!e.comment,u=e.contents.comment}let i=u?void 0:()=>l=!0,d=n.stringify(e.contents,s,()=>u=null,i);u&&(d+=r.lineComment(d,``,c(u))),(d[0]===`|`||d[0]===`>`)&&a[a.length-1]===`---`?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(n.stringify(e.contents,s));if(e.directives?.docEnd)if(e.comment){let t=c(e.comment);t.includes(`
|
|
247
|
+
`;return`${e}\n${c}${_}`}else return`${g}${u}${h.join(` `)}${u}${_}`}function s({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,``)),i){let a=r.indentComment(t(i),e);n.push(a.trimStart())}}e.stringifyCollection=i})),ty=n((e=>{var t=ey(),n=Qv(),r=Wv(),i=Q(),a=$v(),o=$();function s(e,t){let n=i.isScalar(t)?t.value:t;for(let r of e)if(i.isPair(r)&&(r.key===t||r.key===n||i.isScalar(r.key)&&r.key.value===n))return r}e.YAMLMap=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(i.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),s=(e,s)=>{if(typeof i==`function`)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(s!==void 0||r)&&o.items.push(a.createPair(e,s,n))};if(t instanceof Map)for(let[e,n]of t)s(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))s(e,t[e]);return typeof e.sortMapEntries==`function`&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=i.isPair(e)?e:!e||typeof e!=`object`||!(`key`in e)?new a.Pair(e,e?.value):new a.Pair(e.key,e.value);let r=s(this.items,n.key),c=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);i.isScalar(r.value)&&o.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(c){let e=this.items.findIndex(e=>c(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=s(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=s(this.items,e)?.value;return(!t&&i.isScalar(n)?n.value:n)??void 0}has(e){return!!s(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,r){let i=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let e of this.items)n.addPairToJSMap(t,i,e);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!i.isPair(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),t.stringifyCollection(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:r,onComment:n})}},e.findPair=s})),ny=n((e=>{var t=Q(),n=ty();e.map={collection:`map`,default:!0,nodeClass:n.YAMLMap,tag:`tag:yaml.org,2002:map`,resolve(e,n){return t.isMap(e)||n(`Expected a mapping for this tag`),e},createNode:(e,t,r)=>n.YAMLMap.from(e,t,r)}})),ry=n((e=>{var t=Uv(),n=ey(),r=Wv(),i=Q(),a=$(),o=Bv(),s=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(i.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=c(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=c(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&i.isScalar(r)?r.value:r}has(e){let t=c(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=c(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];i.isScalar(r)&&a.isScalarValue(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(o.toJS(e,String(r++),t));return n}toString(e,t,r){return e?n.stringifyCollection(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,a=new this(e);if(n&&Symbol.iterator in Object(n)){let e=0;for(let o of n){if(typeof i==`function`){let t=n instanceof Set?o:String(e++);o=i.call(n,t,o)}a.items.push(t.createNode(o,void 0,r))}}return a}};function c(e){let t=i.isScalar(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}e.YAMLSeq=s})),iy=n((e=>{var t=Q(),n=ry();e.seq={collection:`seq`,default:!0,nodeClass:n.YAMLSeq,tag:`tag:yaml.org,2002:seq`,resolve(e,n){return t.isSeq(e)||n(`Expected a sequence for this tag`),e},createNode:(e,t,r)=>n.YAMLSeq.from(e,t,r)}})),ay=n((e=>{var t=qv();e.string={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,n,r,i){return n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)}}})),oy=n((e=>{var t=$();let n={identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t.Scalar(null),stringify:({source:e},t)=>typeof e==`string`&&n.test.test(e)?e:t.options.nullStr};e.nullTag=n})),sy=n((e=>{var t=$();let n={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new t.Scalar(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},r){return e&&n.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?r.options.trueStr:r.options.falseStr}};e.boolTag=n})),cy=n((e=>{function t({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}e.stringifyNumber=t})),ly=n((e=>{var t=$(),n=cy();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let n=new t.Scalar(parseFloat(e)),r=e.indexOf(`.`);return r!==-1&&e[e.length-1]===`0`&&(n.minFractionDigits=e.length-r-1),n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),uy=n((e=>{var t=cy();let n=e=>typeof e==`bigint`||Number.isInteger(e),r=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function i(e,r,i){let{value:a}=e;return n(a)&&a>=0?i+a.toString(r):t.stringifyNumber(e)}e.int={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},e.intHex={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)},e.intOct={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>r(e,2,8,n),stringify:e=>i(e,8,`0o`)}})),dy=n((e=>{var t=ny(),n=oy(),r=iy(),i=ay(),a=sy(),o=ly(),s=uy();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),fy=n((e=>{var t=$(),n=ny(),r=iy();function i(e){return typeof e==`bigint`||Number.isInteger(e)}let a=({value:e})=>JSON.stringify(e),o=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:a},{identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:a},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:a},{identify:i,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>i(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:a}];e.schema=[n.map,r.seq].concat(o,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}})})),py=n((t=>{var n=e(`buffer`),r=$(),i=qv();t.binary={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof n.Buffer==`function`)return n.Buffer.from(e,`base64`);if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}else return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:a},o,s,c){if(!a)return``;let l=a,u;if(typeof n.Buffer==`function`)u=l instanceof n.Buffer?l.toString(`base64`):n.Buffer.from(l.buffer).toString(`base64`);else if(typeof btoa==`function`){let e=``;for(let t=0;t<l.length;++t)e+=String.fromCharCode(l[t]);u=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=r.Scalar.BLOCK_LITERAL,t!==r.Scalar.QUOTE_DOUBLE){let e=Math.max(o.options.lineWidth-o.indent.length,o.options.minContentWidth),n=Math.ceil(u.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=u.substr(r,e);u=i.join(t===r.Scalar.BLOCK_LITERAL?`
|
|
248
|
+
`:` `)}return i.stringifyString({comment:e,type:t,value:u},o,s,c)}}})),my=n((e=>{var t=Q(),n=$v(),r=$(),i=ry();function a(e,i){if(t.isSeq(e))for(let a=0;a<e.items.length;++a){let o=e.items[a];if(!t.isPair(o)){if(t.isMap(o)){o.items.length>1&&i(`Each pair must have its own sequence indicator`);let e=o.items[0]||new n.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){let t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[a]=t.isPair(o)?o:new n.Pair(o)}}else i(`Expected a sequence for this tag`);return e}function o(e,t,r){let{replacer:a}=r,o=new i.YAMLSeq(e);o.tag=`tag:yaml.org,2002:pairs`;let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof a==`function`&&(e=a.call(t,String(s++),e));let i,c;if(Array.isArray(e))if(e.length===2)i=e[0],c=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)i=t[0],c=e[i];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;o.items.push(n.createPair(i,c,r))}return o}let s={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:a,createNode:o};e.createPairs=o,e.pairs=s,e.resolvePairs=a})),hy=n((e=>{var t=Q(),n=Bv(),r=ty(),i=ry(),a=my(),o=class e extends i.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let e of this.items){let a,o;if(t.isPair(e)?(a=n.toJS(e.key,``,r),o=n.toJS(e.value,a,r)):a=n.toJS(e,``,r),i.has(a))throw Error(`Ordered maps must not include duplicate keys`);i.set(a,o)}return i}static from(e,t,n){let r=a.createPairs(e,t,n),i=new this;return i.items=r.items,i}};o.tag=`tag:yaml.org,2002:omap`;let s={collection:`seq`,identify:e=>e instanceof Map,nodeClass:o,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,n){let r=a.resolvePairs(e,n),i=[];for(let{key:e}of r.items)t.isScalar(e)&&(i.includes(e.value)?n(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new o,r)},createNode:(e,t,n)=>o.from(e,t,n)};e.YAMLOMap=o,e.omap=s})),gy=n((e=>{var t=$();function n({value:e,source:t},n){return t&&(e?r:i).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}let r={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new t.Scalar(!0),stringify:n},i={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new t.Scalar(!1),stringify:n};e.falseTag=i,e.trueTag=r})),_y=n((e=>{var t=$(),n=cy();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let n=new t.Scalar(parseFloat(e.replace(/_/g,``))),r=e.indexOf(`.`);if(r!==-1){let t=e.substring(r+1).replace(/_/g,``);t[t.length-1]===`0`&&(n.minFractionDigits=t.length)}return n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),vy=n((e=>{var t=cy();let n=e=>typeof e==`bigint`||Number.isInteger(e);function r(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function i(e,r,i){let{value:a}=e;if(n(a)){let e=a.toString(r);return a<0?`-`+i+e.substr(1):i+e}return t.stringifyNumber(e)}let a={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>r(e,2,2,n),stringify:e=>i(e,2,`0b`)},o={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>r(e,1,8,n),stringify:e=>i(e,8,`0`)},s={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},c={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)};e.int=s,e.intBin=a,e.intHex=c,e.intOct=o})),yy=n((e=>{var t=Q(),n=$v(),r=ty(),i=class e extends r.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(e){let i;i=t.isPair(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new n.Pair(e.key,null):new n.Pair(e,null),r.findPair(this.items,i.key)||this.items.push(i)}get(e,n){let i=r.findPair(this.items,e);return!n&&t.isPair(i)?t.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=r.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new n.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,r){let{replacer:i}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof i==`function`&&(e=i.call(t,e,e)),a.items.push(n.createPair(e,null,r));return a}};i.tag=`tag:yaml.org,2002:set`;let a={collection:`map`,identify:e=>e instanceof Set,nodeClass:i,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>i.from(e,t,n),resolve(e,n){if(t.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new i,e);n(`Set items must all have null values`)}else n(`Expected a mapping for this tag`);return e}};e.YAMLSet=i,e.set=a})),by=n((e=>{var t=cy();function n(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function r(e){let{value:n}=e,r=e=>e;if(typeof n==`bigint`)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return t.stringifyNumber(e);let i=``;n<0&&(i=`-`,n*=r(-1));let a=r(60),o=[n%a];return n<60?o.unshift(0):(n=(n-o[0])/a,o.unshift(n%a),n>=60&&(n=(n-o[0])/a,o.unshift(n))),i+o.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}let i={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>n(e,r),stringify:r},a={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>n(e,!1),stringify:r},o={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(o.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,r,i,a,s,c,l]=t.map(Number),u=t[7]?Number((t[7]+`00`).substr(1,3)):0,d=Date.UTC(r,i-1,a,s||0,c||0,l||0,u),f=t[8];if(f&&f!==`Z`){let e=n(f,!1);Math.abs(e)<30&&(e*=60),d-=6e4*e}return new Date(d)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``};e.floatTime=a,e.intTime=i,e.timestamp=o})),xy=n((e=>{var t=ny(),n=oy(),r=iy(),i=ay(),a=py(),o=gy(),s=_y(),c=vy(),l=Zv(),u=hy(),d=my(),f=yy(),p=by();e.schema=[t.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,s.floatNaN,s.floatExp,s.float,a.binary,l.merge,u.omap,d.pairs,f.set,p.intTime,p.floatTime,p.timestamp]})),Sy=n((e=>{var t=ny(),n=oy(),r=iy(),i=ay(),a=sy(),o=ly(),s=uy(),c=dy(),l=fy(),u=py(),d=Zv(),f=hy(),p=my(),m=xy(),h=yy(),g=by();let _=new Map([[`core`,c.schema],[`failsafe`,[t.map,r.seq,i.string]],[`json`,l.schema],[`yaml11`,m.schema],[`yaml-1.1`,m.schema]]),v={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:g.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:g.intTime,map:t.map,merge:d.merge,null:n.nullTag,omap:f.omap,pairs:p.pairs,seq:r.seq,set:h.set,timestamp:g.timestamp},y={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":d.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":h.set,"tag:yaml.org,2002:timestamp":g.timestamp};function b(e,t,n){let r=_.get(t);if(r&&!e)return n&&!r.includes(d.merge)?r.concat(d.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(_.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(d.merge)),i.reduce((e,t)=>{let n=typeof t==`string`?v[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(v).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}e.coreKnownTags=y,e.getTags=b})),Cy=n((e=>{var t=Q(),n=ny(),r=iy(),i=ay(),a=Sy();let o=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;e.Schema=class e{constructor({compat:e,customTags:s,merge:c,resolveKnownTags:l,schema:u,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(e)?a.getTags(e,`compat`):e?a.getTags(null,e):null,this.name=typeof u==`string`&&u||`core`,this.knownTags=l?a.coreKnownTags:{},this.tags=a.getTags(s,this.name,c),this.toStringOptions=f??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:i.string}),Object.defineProperty(this,t.SEQ,{value:r.seq}),this.sortMapEntries=typeof d==`function`?d:d===!0?o:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}})),wy=n((e=>{var t=Q(),n=Jv(),r=Gv();function i(e,i){let a=[],o=i.directives===!0;if(i.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(a.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&a.push(`---`);let s=n.createStringifyContext(e,i),{commentString:c}=s.options;if(e.commentBefore){a.length!==1&&a.unshift(``);let t=c(e.commentBefore);a.unshift(r.indentComment(t,``))}let l=!1,u=null;if(e.contents){if(t.isNode(e.contents)){if(e.contents.spaceBefore&&o&&a.push(``),e.contents.commentBefore){let t=c(e.contents.commentBefore);a.push(r.indentComment(t,``))}s.forceBlockIndent=!!e.comment,u=e.contents.comment}let i=u?void 0:()=>l=!0,d=n.stringify(e.contents,s,()=>u=null,i);u&&(d+=r.lineComment(d,``,c(u))),(d[0]===`|`||d[0]===`>`)&&a[a.length-1]===`---`?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(n.stringify(e.contents,s));if(e.directives?.docEnd)if(e.comment){let t=c(e.comment);t.includes(`
|
|
249
249
|
`)?(a.push(`...`),a.push(r.indentComment(t,``))):a.push(`... ${t}`)}else a.push(`...`);else{let t=e.comment;t&&l&&(t=t.replace(/^\n+/,``)),t&&((!l||u)&&a[a.length-1]!==``&&a.push(``),a.push(r.indentComment(c(t),``)))}return a.join(`
|
|
250
250
|
`)+`
|
|
251
|
-
`}e.stringifyDocument=i})),
|
|
252
|
-
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}}})),
|
|
253
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let n of e.items){for(let e of n.start)if(e.type===`newline`)return!0;if(n.sep){for(let e of n.sep)if(e.type===`newline`)return!0}if(t(n.key)||t(n.value))return!0}return!1;default:return!0}}e.containsNewline=t})),
|
|
251
|
+
`}e.stringifyDocument=i})),Ty=n((e=>{var t=Hv(),n=Wv(),r=Q(),i=$v(),a=Bv(),o=Cy(),s=wy(),c=Rv(),l=zv(),u=Uv(),d=Lv(),f=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let i=null;typeof t==`function`||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=a;let{version:o}=a;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new d.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let t=Object.create(e.prototype,{[r.NODE_TYPE]:{value:r.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=r.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){p(this.contents)&&this.contents.add(e)}addIn(e,t){p(this.contents)&&this.contents.addIn(e,t)}createAlias(e,n){if(!e.anchor){let t=c.anchorNames(this);e.anchor=!n||t.has(n)?c.findNewAnchor(n||`a`,t):n}return new t.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t==`function`)e=t.call({"":e},``,e),i=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:l,onTagObj:d,tag:f}=n??{},{onAnchor:p,setAnchors:m,sourceObjects:h}=c.createNodeAnchors(this,o||`a`),g={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:p,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:h},_=u.createNode(e,f,g);return s&&r.isCollection(_)&&(_.flow=!0),m(),_}createPair(e,t,n={}){let r=this.createNode(e,null,n),a=this.createNode(t,null,n);return new i.Pair(r,a)}delete(e){return p(this.contents)?this.contents.delete(e):!1}deleteIn(e){return n.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):p(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&r.isScalar(this.contents)?this.contents.value:this.contents:r.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return r.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return n.isEmptyPath(e)?this.contents!==void 0:r.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=n.collectionFromPath(this.schema,[e],t):p(this.contents)&&this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=n.collectionFromPath(this.schema,Array.from(e),t):p(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new d.Directives({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new d.Directives({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new o.Schema(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},c=a.toJS(this.contents,t??``,s);if(typeof i==`function`)for(let{count:e,res:t}of s.anchors.values())i(t,e);return typeof o==`function`?l.applyReviver(o,{"":c},``,c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return s.stringifyDocument(this,e)}};function p(e){if(r.isCollection(e))return!0;throw Error(`Expected a YAML collection as document contents`)}e.Document=f})),Ey=n((e=>{var t=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},n=class extends t{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},r=class extends t{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}};e.YAMLError=t,e.YAMLParseError=n,e.YAMLWarning=r,e.prettifyError=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
|
252
|
+
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}}})),Dy=n((e=>{function t(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}e.resolveProps=t})),Oy=n((e=>{function t(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
|
253
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let n of e.items){for(let e of n.start)if(e.type===`newline`)return!0;if(n.sep){for(let e of n.sep)if(e.type===`newline`)return!0}if(t(n.key)||t(n.value))return!0}return!1;default:return!0}}e.containsNewline=t})),ky=n((e=>{var t=Oy();function n(e,n,r){if(n?.type===`flow-collection`){let i=n.end[0];i.indent===e&&(i.source===`]`||i.source===`}`)&&t.containsNewline(n)&&r(i,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}e.flowIndentCheck=n})),Ay=n((e=>{var t=Q();function n(e,n,r){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let a=typeof i==`function`?i:(e,n)=>e===n||t.isScalar(e)&&t.isScalar(n)&&e.value===n.value;return n.some(e=>a(e.key,r))}e.mapIncludes=n})),jy=n((e=>{var t=$v(),n=ty(),r=Dy(),i=Oy(),a=ky(),o=Ay();let s=`All mapping items must start at the same column`;function c({composeNode:e,composeEmptyNode:c},l,u,d,f){let p=new(f?.nodeClass??n.YAMLMap)(l.schema);l.atRoot&&=!1;let m=u.offset,h=null;for(let n of u.items){let{start:f,key:g,sep:_,value:v}=n,y=r.resolveProps(f,{indicator:`explicit-key-ind`,next:g??_?.[0],offset:m,onError:d,parentIndent:u.indent,startOnNewline:!0}),b=!y.found;if(b){if(g&&(g.type===`block-seq`?d(m,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in g&&g.indent!==u.indent&&d(m,`BAD_INDENT`,s)),!y.anchor&&!y.tag&&!_){h=y.end,y.comment&&(p.comment?p.comment+=`
|
|
254
254
|
`+y.comment:p.comment=y.comment);continue}(y.newlineAfterProp||i.containsNewline(g))&&d(g??f[f.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else y.found?.indent!==u.indent&&d(m,`BAD_INDENT`,s);l.atKey=!0;let x=y.end,S=g?e(l,g,y,d):c(l,x,f,null,y,d);l.schema.compat&&a.flowIndentCheck(u.indent,g,d),l.atKey=!1,o.mapIncludes(l,p.items,S)&&d(x,`DUPLICATE_KEY`,`Map keys must be unique`);let C=r.resolveProps(_??[],{indicator:`map-value-ind`,next:v,offset:S.range[2],onError:d,parentIndent:u.indent,startOnNewline:!g||g.type===`block-scalar`});if(m=C.end,C.found){b&&(v?.type===`block-map`&&!C.hasNewline&&d(m,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),l.options.strict&&y.start<C.found.offset-1024&&d(S.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let r=v?e(l,v,C,d):c(l,m,_,null,C,d);l.schema.compat&&a.flowIndentCheck(u.indent,v,d),m=r.range[2];let i=new t.Pair(S,r);l.options.keepSourceTokens&&(i.srcToken=n),p.items.push(i)}else{b&&d(S.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),C.comment&&(S.comment?S.comment+=`
|
|
255
|
-
`+C.comment:S.comment=C.comment);let e=new t.Pair(S);l.options.keepSourceTokens&&(e.srcToken=n),p.items.push(e)}}return h&&h<m&&d(h,`IMPOSSIBLE`,`Map comment with trailing content`),p.range=[u.offset,m,h??m],p}e.resolveBlockMap=c})),
|
|
255
|
+
`+C.comment:S.comment=C.comment);let e=new t.Pair(S);l.options.keepSourceTokens&&(e.srcToken=n),p.items.push(e)}}return h&&h<m&&d(h,`IMPOSSIBLE`,`Map comment with trailing content`),p.range=[u.offset,m,h??m],p}e.resolveBlockMap=c})),My=n((e=>{var t=ry(),n=Dy(),r=ky();function i({composeNode:e,composeEmptyNode:i},a,o,s,c){let l=new(c?.nodeClass??t.YAMLSeq)(a.schema);a.atRoot&&=!1,a.atKey&&=!1;let u=o.offset,d=null;for(let{start:t,value:c}of o.items){let f=n.resolveProps(t,{indicator:`seq-item-ind`,next:c,offset:u,onError:s,parentIndent:o.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||c)c?.type===`block-seq`?s(f.end,`BAD_INDENT`,`All sequence items must start at the same column`):s(u,`MISSING_CHAR`,`Sequence item without - indicator`);else{d=f.end,f.comment&&(l.comment=f.comment);continue}let p=c?e(a,c,f,s):i(a,f.end,t,null,f,s);a.schema.compat&&r.flowIndentCheck(o.indent,c,s),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,d??u],l}e.resolveBlockSeq=i})),Ny=n((e=>{function t(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}e.resolveEnd=t})),Py=n((e=>{var t=Q(),n=$v(),r=ty(),i=ry(),a=Ny(),o=Dy(),s=Oy(),c=Ay();let l=`Block collections are not allowed within flow collections`,u=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function d({composeNode:e,composeEmptyNode:d},f,p,m,h){let g=p.start.source===`{`,_=g?`flow map`:`flow sequence`,v=new(h?.nodeClass??(g?r.YAMLMap:i.YAMLSeq))(f.schema);v.flow=!0;let y=f.atRoot;y&&(f.atRoot=!1),f.atKey&&=!1;let b=p.offset+p.start.source.length;for(let i=0;i<p.items.length;++i){let a=p.items[i],{start:h,key:y,sep:x,value:S}=a,C=o.resolveProps(h,{flow:_,indicator:`explicit-key-ind`,next:y??x?.[0],offset:b,onError:m,parentIndent:p.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!S){i===0&&C.comma?m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`):i<p.items.length-1&&m(C.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${_}`),C.comment&&(v.comment?v.comment+=`
|
|
256
256
|
`+C.comment:v.comment=C.comment),b=C.end;continue}!g&&f.options.strict&&s.containsNewline(y)&&m(y,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(i===0)C.comma&&m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`);else if(C.comma||m(C.start,`MISSING_CHAR`,`Missing , between ${_} items`),C.comment){let e=``;loop:for(let t of h)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let n=v.items[v.items.length-1];t.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+=`
|
|
257
257
|
`+e:n.comment=e,C.comment=C.comment.substring(e.length+1)}}if(!g&&!x&&!C.found){let t=S?e(f,S,C,m):d(f,C.end,x,null,C,m);v.items.push(t),b=t.range[2],u(S)&&m(t.range,`BLOCK_IN_FLOW`,l)}else{f.atKey=!0;let t=C.end,i=y?e(f,y,C,m):d(f,t,h,null,C,m);u(y)&&m(i.range,`BLOCK_IN_FLOW`,l),f.atKey=!1;let s=o.resolveProps(x??[],{flow:_,indicator:`map-value-ind`,next:S,offset:i.range[2],onError:m,parentIndent:p.indent,startOnNewline:!1});if(s.found){if(!g&&!C.found&&f.options.strict){if(x)for(let e of x){if(e===s.found)break;if(e.type===`newline`){m(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}C.start<s.found.offset-1024&&m(s.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else S&&(`source`in S&&S.source?.[0]===`:`?m(S,`MISSING_CHAR`,`Missing space after : in ${_}`):m(s.start,`MISSING_CHAR`,`Missing , or : between ${_} items`));let w=S?e(f,S,s,m):s.found?d(f,s.end,x,null,s,m):null;w?u(S)&&m(w.range,`BLOCK_IN_FLOW`,l):s.comment&&(i.comment?i.comment+=`
|
|
258
258
|
`+s.comment:i.comment=s.comment);let T=new n.Pair(i,w);if(f.options.keepSourceTokens&&(T.srcToken=a),g){let e=v;c.mapIncludes(f,e.items,i)&&m(t,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(T)}else{let e=new r.YAMLMap(f.schema);e.flow=!0,e.items.push(T);let t=(w??i).range;e.range=[i.range[0],t[1],t[2]],v.items.push(e)}b=w?w.range[2]:s.end}}let x=g?`}`:`]`,[S,...C]=p.end,w=b;if(S?.source===x)w=S.offset+S.source.length;else{let e=_[0].toUpperCase()+_.substring(1),t=y?`${e} must end with a ${x}`:`${e} in block collection must be sufficiently indented and end with a ${x}`;m(b,y?`MISSING_CHAR`:`BAD_INDENT`,t),S&&S.source.length!==1&&C.unshift(S)}if(C.length>0){let e=a.resolveEnd(C,w,f.options.strict,m);e.comment&&(v.comment?v.comment+=`
|
|
259
|
-
`+e.comment:v.comment=e.comment),v.range=[p.offset,w,e.offset]}else v.range=[p.offset,w,w];return v}e.resolveFlowCollection=d})),
|
|
259
|
+
`+e.comment:v.comment=e.comment),v.range=[p.offset,w,e.offset]}else v.range=[p.offset,w,w];return v}e.resolveFlowCollection=d})),Fy=n((e=>{var t=Q(),n=$(),r=ty(),i=ry(),a=jy(),o=My(),s=Py();function c(e,t,n,r,i,c){let l=n.type===`block-map`?a.resolveBlockMap(e,t,n,r,c):n.type===`block-seq`?o.resolveBlockSeq(e,t,n,r,c):s.resolveFlowCollection(e,t,n,r,c),u=l.constructor;return i===`!`||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}function l(e,a,o,s,l){let u=s.tag,d=u?a.directives.tagName(u.source,e=>l(u,`TAG_RESOLVE_FAILED`,e)):null;if(o.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=s,n=e&&u?e.offset>u.offset?e:u:e??u;n&&(!t||t.offset<n.offset)&&l(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let f=o.type===`block-map`?`map`:o.type===`block-seq`?`seq`:o.start.source===`{`?`map`:`seq`;if(!u||!d||d===`!`||d===r.YAMLMap.tagName&&f===`map`||d===i.YAMLSeq.tagName&&f===`seq`)return c(e,a,o,l,d);let p=a.schema.tags.find(e=>e.tag===d&&e.collection===f);if(!p){let t=a.schema.knownTags[d];if(t?.collection===f)a.schema.tags.push(Object.assign({},t,{default:!1})),p=t;else return t?l(u,`BAD_COLLECTION_TYPE`,`${t.tag} used for ${f} collection, but expects ${t.collection??`scalar`}`,!0):l(u,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${d}`,!0),c(e,a,o,l,d)}let m=c(e,a,o,l,d,p),h=p.resolve?.(m,e=>l(u,`TAG_RESOLVE_FAILED`,e),a.options)??m,g=t.isNode(h)?h:new n.Scalar(h);return g.range=m.range,g.tag=d,p?.format&&(g.format=p.format),g}e.composeCollection=l})),Iy=n((e=>{var t=$();function n(e,n,a){let o=n.offset,s=r(n,e.options.strict,a);if(!s)return{value:``,type:null,comment:``,range:[o,o,o]};let c=s.mode===`>`?t.Scalar.BLOCK_FOLDED:t.Scalar.BLOCK_LITERAL,l=n.source?i(n.source):[],u=l.length;for(let e=l.length-1;e>=0;--e){let t=l[e][1];if(t===``||t===`\r`)u=e;else break}if(u===0){let e=s.chomp===`+`&&l.length>0?`
|
|
260
260
|
`.repeat(Math.max(1,l.length-1)):``,t=o+s.length;return n.source&&(t+=n.source.length),{value:e,type:c,comment:s.comment,range:[o,t,t]}}let d=n.indent+s.indent,f=n.offset+s.length,p=0;for(let t=0;t<u;++t){let[n,r]=l[t];if(r===``||r===`\r`)s.indent===0&&n.length>d&&(d=n.length);else{n.length<d&&a(f+n.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),s.indent===0&&(d=n.length),p=t,d===0&&!e.atRoot&&a(f,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}f+=n.length+r.length+1}for(let e=l.length-1;e>=u;--e)l[e][0].length>d&&(u=e+1);let m=``,h=``,g=!1;for(let e=0;e<p;++e)m+=l[e][0].slice(d)+`
|
|
261
261
|
`;for(let e=p;e<u;++e){let[n,r]=l[e];f+=n.length+r.length+1;let i=r[r.length-1]===`\r`;if(i&&(r=r.slice(0,-1)),r&&n.length<d){let e=`Block scalar lines must not be less indented than their ${s.indent?`explicit indentation indicator`:`first line`}`;a(f-r.length-(i?2:1),`BAD_INDENT`,e),n=``}c===t.Scalar.BLOCK_LITERAL?(m+=h+n.slice(d)+r,h=`
|
|
262
262
|
`):n.length>d||r[0]===` `?(h===` `?h=`
|
|
@@ -271,7 +271,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
271
271
|
`+l[e][0].slice(d);m[m.length-1]!==`
|
|
272
272
|
`&&(m+=`
|
|
273
273
|
`);break;default:m+=`
|
|
274
|
-
`}let _=o+s.length+n.source.length;return{value:m,type:c,comment:s.comment,range:[o,_,_]}}function r({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function i(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}e.resolveBlockScalar=n})),
|
|
274
|
+
`}let _=o+s.length+n.source.length;return{value:m,type:c,comment:s.comment,range:[o,_,_]}}function r({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function i(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}e.resolveBlockScalar=n})),Ly=n((e=>{var t=$(),n=Ny();function r(e,r,o){let{offset:c,type:l,source:u,end:d}=e,f,p,m=(e,t,n)=>o(c+e,t,n);switch(l){case`scalar`:f=t.Scalar.PLAIN,p=i(u,m);break;case`single-quoted-scalar`:f=t.Scalar.QUOTE_SINGLE,p=a(u,m);break;case`double-quoted-scalar`:f=t.Scalar.QUOTE_DOUBLE,p=s(u,m);break;default:return o(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${l}`),{value:``,type:null,comment:``,range:[c,c+u.length,c+u.length]}}let h=c+u.length,g=n.resolveEnd(d,h,r,o);return{value:p,type:f,comment:g.comment,range:[c,h,g.offset]}}function i(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),o(e)}function a(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),o(e.slice(1,-1)).replace(/''/g,`'`)}function o(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
275
275
|
`,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
276
276
|
`,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
|
|
277
277
|
`?i+=a:a=`
|
|
@@ -286,10 +286,10 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
286
286
|
`);)r===`
|
|
287
287
|
`&&(n+=`
|
|
288
288
|
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}let l={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
|
289
|
-
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function u(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}e.resolveFlowScalar=r})),
|
|
289
|
+
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function u(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}e.resolveFlowScalar=r})),Ry=n((e=>{var t=Q(),n=$(),r=Iy(),i=Ly();function a(e,a,c,l){let{value:u,type:d,comment:f,range:p}=a.type===`block-scalar`?r.resolveBlockScalar(e,a,l):i.resolveFlowScalar(a,e.options.strict,l),m=c?e.directives.tagName(c.source,e=>l(c,`TAG_RESOLVE_FAILED`,e)):null,h;h=e.options.stringKeys&&e.atKey?e.schema[t.SCALAR]:m?o(e.schema,u,m,c,l):a.type===`scalar`?s(e,u,a,l):e.schema[t.SCALAR];let g;try{let r=h.resolve(u,e=>l(c??a,`TAG_RESOLVE_FAILED`,e),e.options);g=t.isScalar(r)?r:new n.Scalar(r)}catch(e){let t=e instanceof Error?e.message:String(e);l(c??a,`TAG_RESOLVE_FAILED`,t),g=new n.Scalar(u)}return g.range=p,g.source=u,d&&(g.type=d),m&&(g.tag=m),h.format&&(g.format=h.format),f&&(g.comment=f),g}function o(e,n,r,i,a){if(r===`!`)return e[t.SCALAR];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===r)if(t.default&&t.test)o.push(t);else return t;for(let e of o)if(e.test?.test(n))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(i,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${r}`,r!==`tag:yaml.org,2002:str`),e[t.SCALAR])}function s({atKey:e,directives:n,schema:r},i,a,o){let s=r.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(i))||r[t.SCALAR];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(i))??r[t.SCALAR];s.tag!==e.tag&&o(a,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${n.tagString(s.tag)} or ${n.tagString(e.tag)}`,!0)}return s}e.composeScalar=a})),zy=n((e=>{function t(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}e.emptyScalarPosition=t})),By=n((e=>{var t=Hv(),n=Q(),r=Fy(),i=Ry(),a=Ny(),o=zy();let s={composeNode:c,composeEmptyNode:l};function c(e,t,a,o){let c=e.atKey,{spaceBefore:d,comment:f,anchor:p,tag:m}=a,h,g=!0;switch(t.type){case`alias`:h=u(e,t,o),(p||m)&&o(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:h=i.composeScalar(e,t,m,o),p&&(h.anchor=p.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:h=r.composeCollection(s,e,t,a,o),p&&(h.anchor=p.source.substring(1));break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),h=l(e,t.offset,void 0,null,a,o),g=!1}return p&&h.anchor===``&&o(p,`BAD_ALIAS`,`Anchor cannot be an empty string`),c&&e.options.stringKeys&&(!n.isScalar(h)||typeof h.value!=`string`||h.tag&&h.tag!==`tag:yaml.org,2002:str`)&&o(m??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),d&&(h.spaceBefore=!0),f&&(t.type===`scalar`&&t.source===``?h.comment=f:h.commentBefore=f),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function l(e,t,n,r,{spaceBefore:a,comment:s,anchor:c,tag:l,end:u},d){let f={type:`scalar`,offset:o.emptyScalarPosition(t,n,r),indent:-1,source:``},p=i.composeScalar(e,f,l,d);return c&&(p.anchor=c.source.substring(1),p.anchor===``&&d(c,`BAD_ALIAS`,`Anchor cannot be an empty string`)),a&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function u({options:e},{offset:n,source:r,end:i},o){let s=new t.Alias(r.substring(1));s.source===``&&o(n,`BAD_ALIAS`,`Alias cannot be an empty string`),s.source.endsWith(`:`)&&o(n+r.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let c=n+r.length,l=a.resolveEnd(i,c,e.strict,o);return s.range=[n,c,l.offset],l.comment&&(s.comment=l.comment),s}e.composeEmptyNode=l,e.composeNode=c})),Vy=n((e=>{var t=Ty(),n=By(),r=Ny(),i=Dy();function a(e,a,{offset:o,start:s,value:c,end:l},u){let d=Object.assign({_directives:a},e),f=new t.Document(void 0,d),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=i.resolveProps(s,{indicator:`doc-start`,next:c??l?.[0],offset:o,onError:u,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,c&&(c.type===`block-map`||c.type===`block-seq`)&&!m.hasNewline&&u(m.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),f.contents=c?n.composeNode(p,c,m,u):n.composeEmptyNode(p,m.end,s,null,m,u);let h=f.contents.range[2],g=r.resolveEnd(l,h,!1,u);return g.comment&&(f.comment=g.comment),f.range=[o,h,g.offset],f}e.composeDoc=a})),Hy=n((t=>{var n=e(`process`),r=Lv(),i=Ty(),a=Ey(),o=Q(),s=Vy(),c=Ny();function l(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function u(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
|
290
290
|
|
|
291
291
|
`:`
|
|
292
|
-
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}t.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=l(e);r?this.warnings.push(new a.YAMLWarning(i,t,n)):this.errors.push(new a.YAMLParseError(i,t,n))},this.directives=new r.Directives({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=u(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(o.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];o.isPair(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:u(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(n.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=l(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=s.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new a.YAMLParseError(l(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new a.YAMLParseError(l(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=c.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new a.YAMLParseError(l(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=Object.assign({_directives:this.directives},this.options),n=new i.Document(void 0,e);this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),n.range=[0,t,t],this.decorate(n,!1),yield n}}}})),
|
|
292
|
+
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}t.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=l(e);r?this.warnings.push(new a.YAMLWarning(i,t,n)):this.errors.push(new a.YAMLParseError(i,t,n))},this.directives=new r.Directives({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=u(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(o.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];o.isPair(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:u(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(n.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=l(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=s.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new a.YAMLParseError(l(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new a.YAMLParseError(l(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=c.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new a.YAMLParseError(l(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=Object.assign({_directives:this.directives},this.options),n=new i.Document(void 0,e);this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),n.range=[0,t,t],this.decorate(n,!1),yield n}}}})),Uy=n((e=>{var t=Iy(),n=Ly(),r=Ey(),i=qv();function a(e,i=!0,a){if(e){let o=(e,t,n)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(a)a(i,t,n);else throw new r.YAMLParseError([i,i+1],t,n)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return n.resolveFlowScalar(e,i,o);case`block-scalar`:return t.resolveBlockScalar({options:{strict:i}},e,o)}}return null}function o(e,t){let{implicitKey:n=!1,indent:r,inFlow:a=!1,offset:o=-1,type:s=`PLAIN`}=t,c=i.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),u=t.end??[{type:`newline`,offset:-1,indent:r,source:`
|
|
293
293
|
`}];switch(c[0]){case`|`:case`>`:{let e=c.indexOf(`
|
|
294
294
|
`),t=c.substring(0,e),n=c.substring(e+1)+`
|
|
295
295
|
`,i=[{type:`block-scalar-header`,offset:o,indent:r,source:t}];return l(i,u)||i.push({type:`newline`,offset:-1,indent:r,source:`
|
|
@@ -297,9 +297,9 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
297
297
|
`),r=t.substring(0,n),i=t.substring(n+1)+`
|
|
298
298
|
`;if(e.type===`block-scalar`){let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);t.source=r,e.source=i}else{let{offset:t}=e,n=`indent`in e?e.indent:-1,a=[{type:`block-scalar-header`,offset:t,indent:n,source:r}];l(a,`end`in e?e.end:void 0)||a.push({type:`newline`,offset:-1,indent:n,source:`
|
|
299
299
|
`});for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:`block-scalar`,indent:n,props:a,source:i})}}function l(e,t){if(t)for(let n of t)switch(n.type){case`space`:case`comment`:e.push(n);break;case`newline`:return e.push(n),!0}return!1}function u(e,t,n){switch(e.type){case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:e.type=n,e.source=t;break;case`block-scalar`:{let r=e.props.slice(1),i=t.length;e.props[0].type===`block-scalar-header`&&(i-=e.props[0].source.length);for(let e of r)e.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case`block-map`:case`block-seq`:{let r={type:`newline`,offset:e.offset+t.length,indent:e.indent,source:`
|
|
300
|
-
`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}e.createScalarToken=o,e.resolveAsScalar=a,e.setScalarValue=s})),
|
|
300
|
+
`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}e.createScalarToken=o,e.resolveAsScalar=a,e.setScalarValue=s})),Wy=n((e=>{let t=e=>`type`in e?n(e):r(e);function n(e){switch(e.type){case`block-scalar`:{let t=``;for(let r of e.props)t+=n(r);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=r(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=r(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=r(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function r({start:e,key:t,sep:r,value:i}){let a=``;for(let t of e)a+=t.source;if(t&&(a+=n(t)),r)for(let e of r)a+=e.source;return i&&(a+=n(i)),a}e.stringify=t})),Gy=n((e=>{let t=Symbol(`break visit`),n=Symbol(`skip children`),r=Symbol(`remove item`);function i(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),a(Object.freeze([]),e,t)}i.BREAK=t,i.SKIP=n,i.REMOVE=r,i.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},i.parentCollection=(e,t)=>{let n=i.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],a=n?.[r];if(a&&`items`in a)return a;throw Error(`Parent collection not found`)};function a(e,n,i){let o=i(n,e);if(typeof o==`symbol`)return o;for(let s of[`key`,`value`]){let c=n[s];if(c&&`items`in c){for(let n=0;n<c.items.length;++n){let o=a(Object.freeze(e.concat([[s,n]])),c.items[n],i);if(typeof o==`number`)n=o-1;else if(o===t)return t;else o===r&&(c.items.splice(n,1),--n)}typeof o==`function`&&s===`key`&&(o=o(n,e))}}return typeof o==`function`?o(n,e):o}e.visit=i})),Ky=n((e=>{var t=Uy(),n=Wy(),r=Gy();let i=e=>!!e&&`items`in e,a=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);function o(e){switch(e){case``:return`<BOM>`;case``:return`<DOC>`;case``:return`<FLOW_END>`;case``:return`<SCALAR>`;default:return JSON.stringify(e)}}function s(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
|
301
301
|
`:case`\r
|
|
302
|
-
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}e.createScalarToken=t.createScalarToken,e.resolveAsScalar=t.resolveAsScalar,e.setScalarValue=t.setScalarValue,e.stringify=n.stringify,e.visit=r.visit,e.BOM=``,e.DOCUMENT=``,e.FLOW_END=``,e.SCALAR=``,e.isCollection=i,e.isScalar=a,e.prettyToken=o,e.tokenType=s})),
|
|
302
|
+
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}e.createScalarToken=t.createScalarToken,e.resolveAsScalar=t.resolveAsScalar,e.setScalarValue=t.setScalarValue,e.stringify=n.stringify,e.visit=r.visit,e.BOM=``,e.DOCUMENT=``,e.FLOW_END=``,e.SCALAR=``,e.isCollection=i,e.isScalar=a,e.prettyToken=o,e.tokenType=s})),qy=n((e=>{var t=Ky();function n(e){switch(e){case void 0:case` `:case`
|
|
303
303
|
`:case`\r`:case` `:return!0;default:return!1}}let r=new Set(`0123456789ABCDEFabcdef`),i=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),a=new Set(`,[]{}`),o=new Set(` ,[]{}
|
|
304
304
|
\r `),s=e=>!e||o.has(e);e.Lexer=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
|
305
305
|
`?!0:t===`\r`?this.buffer[e+1]===`
|
|
@@ -318,8 +318,8 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
318
318
|
`,t=this.buffer[i+1]):r=i),t===`#`||e&&a.has(t))break;if(o===`
|
|
319
319
|
`){let e=this.continueScalar(i+1);if(e===-1)break;i=Math.max(i,e-2)}}else{if(e&&a.has(o))break;r=i}return!o&&!this.atEnd?this.setNext(`plain-scalar`):(yield t.SCALAR,yield*this.pushToIndex(r+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(s))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(n(t)||e&&a.has(t))return e?this.flowKey&&=!1:this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!n(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(i.has(t))t=this.buffer[++e];else if(t===`%`&&r.has(this.buffer[e+1])&&r.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
320
320
|
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
|
321
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}})),
|
|
321
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}})),Jy=n((e=>{e.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}})),Yy=n((t=>{var n=e(`process`),r=Ky(),i=qy();function a(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function o(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function s(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function c(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function l(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function u(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!a(t.start,`explicit-key-ind`)&&!a(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,s(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}t.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new i.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,n.env.LOG_TOKENS&&console.log(`|`,r.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=r.tokenType(e);if(t)if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&u(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&o(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:o(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=l(c(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
|
|
322
322
|
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
323
323
|
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(a(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(s(t.key)&&!a(t.sep,`newline`)){let e=l(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(a(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=l(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):a(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!a(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||a(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=l(c(t));u(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
324
324
|
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
325
|
-
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=l(c(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=l(c(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;case`space`:case`comment`:default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),
|
|
325
|
+
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=l(c(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=l(c(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;case`space`:case`comment`:default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),Xy=n((e=>{var t=Hy(),n=Ty(),r=Ey(),i=Xv(),a=Q(),o=Jy(),s=Yy();function c(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new o.LineCounter||null,prettyErrors:t}}function l(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=Array.from(l.compose(o.parse(e)));if(a&&i)for(let t of u)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return u.length>0?u:Object.assign([],{empty:!0},l.streamInfo())}function u(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=null;for(let t of l.compose(o.parse(e),!0,e.length))if(!u)u=t;else if(u.options.logLevel!==`silent`){u.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(u.errors.forEach(r.prettifyError(e,i)),u.warnings.forEach(r.prettifyError(e,i))),u}function d(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=u(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function f(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return a.isDocument(e)&&!i?e.toString(r):new n.Document(e,i,r).toString(r)}e.parse=d,e.parseAllDocuments=l,e.parseDocument=u,e.stringify=f})),Zy=n((e=>{var t=Hy(),n=Ty(),r=Cy(),i=Ey(),a=Hv(),o=Q(),s=$v(),c=$(),l=ty(),u=ry();Ky();var d=qy(),f=Jy(),p=Yy(),m=Xy(),h=Iv();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.Lexer=d.Lexer,e.LineCounter=f.LineCounter,e.Parser=p.Parser,e.parse=m.parse,e.parseAllDocuments=m.parseAllDocuments,e.parseDocument=m.parseDocument,e.stringify=m.stringify,e.visit=h.visit,e.visitAsync=h.visitAsync}))();async function Qy(){new F().source(`pnpm-workspace.yaml`).onFail(()=>``).onDone(e=>{let t=e.trim()?(0,Zy.parse)(e):{};return t.configDependencies??={"pnpm-plugin-nice-move":`0.1.0+sha512-M70sSpJmx0htcWXAYdd+VtlFthhQEHWsfLIINitKLVEWs4NyCOdiyd+zGkcqJE8PwqVPd6hpiNX9edIuvB9wjw==`},t.shamefullyHoist??=!0,t.allowBuilds??={},(0,Zy.stringify)(t,{singleQuote:!0})}).output().logger(`Set pnpm config`,Qt(`pnpm-workspace.yaml`)).catch(console.warn)}async function $y(){let{Dependencies:e,GitInit:t,info:n,options:{isRoot:r}={}}=await Fv();console.log(`-`.repeat(32));let i=[t,Qy(),()=>xi(n),Si,kr,nn,()=>t||r?Er():void 0,()=>e?e(t||r):void 0].filter(e=>typeof e==`function`);for(let e of i){let t=await e();t&&t.catch&&t.catch(e=>{console.warn(e.message)})}}export{$y as init};
|