@ripple-ts/cli 0.3.54 → 0.3.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -14
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as e}from"node:module";import{execSync as t}from"node:child_process";import{basename as n,dirname as r,join as i,relative as a,resolve as o}from"node:path";import{cpSync as s,existsSync as c,lstatSync as l,mkdirSync as u,readFileSync as d,readdirSync as f,rmSync as p,writeFileSync as m}from"node:fs";import h from"node:process";import{fileURLToPath as g}from"node:url";import _,{tmpdir as v}from"node:os";import{stripVTControlCharacters as y}from"node:util";import b from"node:tty";var x=Object.create,S=Object.defineProperty,C=Object.getOwnPropertyDescriptor,ee=Object.getOwnPropertyNames,w=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty,T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),E=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ee(t),a=0,o=i.length,s;a<o;a++)s=i[a],!te.call(e,s)&&s!==n&&S(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=C(t,s))||r.enumerable});return e},ne=(e,t,n)=>(n=e==null?{}:x(w(e)),E(t||!e||!e.__esModule?S(n,`default`,{value:e,enumerable:!0}):n,e)),D=e(import.meta.url),re=T((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),ie=T((e=>{let{InvalidArgumentError:t}=re();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),ae=T((e=>{let{humanReadableArgName:t}=ie();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
2
|
+
import{createRequire as e}from"node:module";import{execSync as t}from"node:child_process";import{basename as n,dirname as r,join as i,relative as a,resolve as o}from"node:path";import{cpSync as s,existsSync as c,lstatSync as l,mkdirSync as u,readFileSync as d,readdirSync as f,rmSync as p,writeFileSync as m}from"node:fs";import h from"node:process";import{fileURLToPath as g}from"node:url";import _,{tmpdir as v}from"node:os";import{stripVTControlCharacters as y}from"node:util";import b from"node:tty";var x=Object.create,S=Object.defineProperty,C=Object.getOwnPropertyDescriptor,ee=Object.getOwnPropertyNames,w=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty,T=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),E=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ee(t),a=0,o=i.length,s;a<o;a++)s=i[a],!te.call(e,s)&&s!==n&&S(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=C(t,s))||r.enumerable});return e},ne=(e,t,n)=>(n=e==null?{}:x(w(e)),E(t||!e||!e.__esModule?S(n,`default`,{value:e,enumerable:!0}):n,e)),D=e(import.meta.url),re=T((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),ie=T((e=>{let{InvalidArgumentError:t}=re();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),ae=T((e=>{let{humanReadableArgName:t}=ie();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
3
3
|
`)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
|
|
4
4
|
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
5
5
|
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),oe=T((e=>{let{InvalidArgumentError:t}=re();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r===void 0?!1:r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
@@ -10,16 +10,16 @@ import{createRequire as e}from"node:module";import{execSync as t}from"node:child
|
|
|
10
10
|
- too many long flags`):Error(`${n}
|
|
11
11
|
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),se=T((e=>{function t(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function n(e,n){if(!n||n.length===0)return``;n=Array.from(new Set(n));let r=e.startsWith(`--`);r&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],a=3;return n.forEach(n=>{if(n.length<=1)return;let r=t(e,n),o=Math.max(e.length,n.length);(o-r)/o>.4&&(r<a?(a=r,i=[n]):r===a&&i.push(n))}),i.sort((e,t)=>e.localeCompare(t)),r&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(`, `)}?)`:i.length===1?`\n(Did you mean ${i[0]}?)`:``}e.suggestSimilar=n})),ce=T((e=>{let t=D(`node:events`).EventEmitter,n=D(`node:child_process`),r=D(`node:path`),i=D(`node:fs`),a=D(`node:process`),{Argument:o,humanReadableArgName:s}=ie(),{CommanderError:c}=re(),{Help:l,stripColor:u}=ae(),{Option:d,DualOptions:f}=oe(),{suggestSimilar:p}=se();var m=class e extends t{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>a.stdout.write(e),writeErr:e=>a.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:void 0,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:void 0,getOutHasColors:()=>g()??(a.stdout.isTTY&&a.stdout.hasColors?.()),getErrHasColors:()=>g()??(a.stderr.isTTY&&a.stderr.hasColors?.()),stripColor:e=>u(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new l,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
|
|
12
12
|
- specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new o(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
|
|
13
|
-
Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new c(e,t,n)),a.exit(e)}action(e){
|
|
13
|
+
Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new c(e,t,n)),a.exit(e)}action(e){let t=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new d(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
14
14
|
- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,`default`)}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{r(t,`error: option '${e.flags}' argument '${t}' is invalid.`,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{r(t,`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof d)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){a.versions?.electron&&(t.from=`electron`);let e=a.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=a.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:a.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
15
15
|
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(i.existsSync(e))return;let r=`'${e}' does not exist
|
|
16
16
|
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
17
17
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
18
18
|
- ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let o=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function l(e,t){let n=r.resolve(e,t);if(i.existsSync(n))return n;if(s.includes(r.extname(t)))return;let a=s.find(e=>i.existsSync(`${n}${e}`));if(a)return`${n}${a}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=i.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=r.resolve(r.dirname(e),d)}if(d){let t=l(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=l(d,`${n}-${e._name}`))}u=t||u}o=s.includes(r.extname(u));let f;a.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=h(a.execArgv).concat(t),f=n.spawn(a.execPath,t,{stdio:`inherit`})):o?(t.unshift(u),t=h(a.execArgv).concat(t),f=n.spawn(a.argv[0],t,{stdio:`inherit`})):f=n.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{a.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new c(e,`commander.executeSubCommandAsync`,`(close)`)):a.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)a.exit(1);else{let e=new c(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)===void 0?!1:this.getOptionValueSource(t)!==`default`});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l))){this.emit(`option:${o.name()}`,l);continue}if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
19
19
|
`),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in a.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,a.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new f(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=p(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=p(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>s(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=r.basename(e,r.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(a.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
|
|
20
|
-
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function h(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function g(){if(a.env.NO_COLOR||a.env.FORCE_COLOR===`0`||a.env.FORCE_COLOR===`false`)return!1;if(a.env.FORCE_COLOR||a.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=m,e.useColor=g}));const{program:le,createCommand:ue,createArgument:de,createOption:fe,CommanderError:pe,InvalidArgumentError:me,InvalidOptionArgumentError:he,Command:ge,Argument:O,Option:_e,Help:ve}=ne(T((e=>{let{Argument:t}=ie(),{Command:n}=ce(),{CommanderError:r,InvalidArgumentError:i}=re(),{Help:a}=ae(),{Option:o}=oe();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i}))(),1).default;let ye,be,xe,Se,Ce=!0;typeof process<`u`&&({FORCE_COLOR:ye,NODE_DISABLE_COLORS:be,NO_COLOR:xe,TERM:Se}=process.env||{},Ce=process.stdout&&process.stdout.isTTY);const we={enabled:!be&&xe==null&&Se!==`dumb`&&(ye!=null&&ye!==`0`||Ce)};function k(e,t){let n=RegExp(`\\x1b\\[${t}m`,`g`),r=`\x1b[${e}m`,i=`\x1b[${t}m`;return function(e){return!we.enabled||e==null?e:r+(~(``+e).indexOf(i)?e.replace(n,i+r):e)+i}}k(0,0);const Te=k(1,22),Ee=k(2,22);k(3,23),k(4,24),k(7,27),k(8,28),k(9,29),k(30,39);const De=k(31,39),Oe=k(32,39);k(33,39);const A=k(34,39);k(35,39);const ke=k(36,39);k(37,39),k(90,39),k(90,39),k(40,49),k(41,49),k(42,49),k(43,49),k(44,49),k(45,49),k(46,49),k(47,49);function Ae(e){if(typeof e!=`string`||e==null)return{valid:!1,message:`Project name is required`};if(typeof e==`string`&&e.trim().length===0)return{valid:!1,message:`Project name cannot be empty`};let t=n(o(process.cwd(),e.trim()));return t.length>214?{valid:!1,message:`Project name must be less than 214 characters`}:/^[a-z0-9._-]+$/.test(t)?t.startsWith(`.`)||t.startsWith(`_`)?{valid:!1,message:`Project name cannot start with a dot or underscore`}:t.endsWith(`.`)?{valid:!1,message:`Project name cannot end with a dot`}:t.includes(`..`)?{valid:!1,message:`Project name cannot contain consecutive dots`}:[`node_modules`,`favicon.ico`,`con`,`prn`,`aux`,`nul`,`com1`,`com2`,`com3`,`com4`,`com5`,`com6`,`com7`,`com8`,`com9`,`lpt1`,`lpt2`,`lpt3`,`lpt4`,`lpt5`,`lpt6`,`lpt7`,`lpt8`,`lpt9`].includes(t.toLowerCase())?{valid:!1,message:`"${t}" is a reserved name and cannot be used`}:{valid:!0,message:``}:{valid:!1,message:`Project name can only contain lowercase letters, numbers, hyphens, dots, and underscores`}}var je=T((e=>{var t=D(`fs`),n=D(`path`),r=D(`events`),i=D(`stream`),a=D(`string_decoder`),o=D(`assert`),s=D(`buffer`),c=D(`zlib`),l=D(`util`),u=D(`crypto`),d=D(`os`),f=D(`tty`),p=D(`constants`),m=D(`https`),h=D(`child_process`),g=D(`url`),_=D(`net`),v=D(`tls`);function y(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var b=y(t),x=y(n),S=y(r),C=y(i),ee=y(a),w=y(o),te=y(s),T=y(c),E=y(l),ne=y(u),re=y(d),ie=y(f),ae=y(p),oe=y(m),se=y(h),ce=y(g),le=y(_),ue=y(v),de=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function fe(e){var t={exports:{}};return e(t,t.exports),t.exports}let pe=new Map([[`C`,`cwd`],[`f`,`file`],[`z`,`gzip`],[`P`,`preservePaths`],[`U`,`unlink`],[`strip-components`,`strip`],[`stripComponents`,`strip`],[`keep-newer`,`newer`],[`keepNewer`,`newer`],[`keep-newer-files`,`newer`],[`keepNewerFiles`,`newer`],[`k`,`keep`],[`keep-existing`,`keep`],[`keepExisting`,`keep`],[`m`,`noMtime`],[`no-mtime`,`noMtime`],[`p`,`preserveOwner`],[`L`,`follow`],[`h`,`follow`]]);var me=e=>e?Object.keys(e).map(t=>[pe.has(t)?pe.get(t):t,e[t]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{},he=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}},ge=O;O.Node=be,O.create=O;function O(e){var t=this;if(t instanceof O||(t=new O),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach==`function`)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}O.prototype.removeNode=function(e){if(e.list!==this)throw Error(`removing node which does not belong to this list`);var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},O.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||=e,this.length++}},O.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||=e,this.length++}},O.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)ve(this,arguments[e]);return this.length},O.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)ye(this,arguments[e]);return this.length},O.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},O.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},O.prototype.forEach=function(e,t){t||=this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next},O.prototype.forEachReverse=function(e,t){t||=this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev},O.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value},O.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value},O.prototype.map=function(e,t){t||=this;for(var n=new O,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n},O.prototype.mapReverse=function(e,t){t||=this;for(var n=new O,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n},O.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw TypeError(`Reduce of empty list with no initial value`);for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n},O.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw TypeError(`Reduce of empty list with no initial value`);for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n},O.prototype.toArray=function(){for(var e=Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e},O.prototype.toArrayReverse=function(){for(var e=Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e},O.prototype.slice=function(e,t){t||=this.length,t<0&&(t+=this.length),e||=0,e<0&&(e+=this.length);var n=new O;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(;i!==null&&r<t;r++,i=i.next)n.push(i.value);return n},O.prototype.sliceReverse=function(e,t){t||=this.length,t<0&&(t+=this.length),e||=0,e<0&&(e+=this.length);var n=new O;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n},O.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(var a=[],r=0;i&&r<t;r++)a.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=_e(this,i,n[r]);return a},O.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function _e(e,t,n){var r=t===e.head?new be(n,null,t,e):new be(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function ve(e,t){e.tail=new be(t,e.tail,null,e),e.head||=e.tail,e.length++}function ye(e,t){e.head=new be(t,null,e.head,e),e.tail||=e.head,e.length++}function be(e,t,n,r){if(!(this instanceof be))return new be(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{he(O)}catch{}let xe=ee.default.StringDecoder,Se=Symbol(`EOF`),Ce=Symbol(`maybeEmitEnd`),we=Symbol(`emittedEnd`),k=Symbol(`emittingEnd`),Te=Symbol(`closed`),Ee=Symbol(`read`),De=Symbol(`flush`),Oe=Symbol(`flushChunk`),A=Symbol(`encoding`),ke=Symbol(`decoder`),Ae=Symbol(`flowing`),je=Symbol(`paused`),Me=Symbol(`resume`),j=Symbol(`bufferLength`),Ne=Symbol(`bufferPush`),Pe=Symbol(`bufferShift`),M=Symbol(`objectMode`),N=Symbol(`destroyed`),Fe=de._MP_NO_ITERATOR_SYMBOLS_!==`1`,Ie=Fe&&Symbol.asyncIterator||Symbol(`asyncIterator not implemented`),Le=Fe&&Symbol.iterator||Symbol(`iterator not implemented`),Re=e=>e===`end`||e===`finish`||e===`prefinish`,P=e=>e instanceof ArrayBuffer||typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,ze=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e);var Be=class e extends C.default{constructor(e){super(),this[Ae]=!1,this[je]=!1,this.pipes=new ge,this.buffer=new ge,this[M]=e&&e.objectMode||!1,this[M]?this[A]=null:this[A]=e&&e.encoding||null,this[A]===`buffer`&&(this[A]=null),this[ke]=this[A]?new xe(this[A]):null,this[Se]=!1,this[we]=!1,this[k]=!1,this[Te]=!1,this.writable=!0,this.readable=!0,this[j]=0,this[N]=!1}get bufferLength(){return this[j]}get encoding(){return this[A]}set encoding(e){if(this[M])throw Error(`cannot set encoding in objectMode`);if(this[A]&&e!==this[A]&&(this[ke]&&this[ke].lastNeed||this[j]))throw Error(`cannot change encoding`);this[A]!==e&&(this[ke]=e?new xe(e):null,this.buffer.length&&(this.buffer=this.buffer.map(e=>this[ke].write(e)))),this[A]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[M]}set objectMode(e){this[M]=this[M]||!!e}write(e,t,n){if(this[Se])throw Error(`write after end`);return this[N]?(this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0):(typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`,!this[M]&&!Buffer.isBuffer(e)&&(ze(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):P(e)?e=Buffer.from(e):typeof e!=`string`&&(this.objectMode=!0)),!this.objectMode&&!e.length?(this[j]!==0&&this.emit(`readable`),n&&n(),this.flowing):(typeof e==`string`&&!this[M]&&!(t===this[A]&&!this[ke].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[A]&&(e=this[ke].write(e)),this.flowing?(this[j]!==0&&this[De](!0),this.emit(`data`,e)):this[Ne](e),this[j]!==0&&this.emit(`readable`),n&&n(),this.flowing))}read(e){if(this[N])return null;try{return this[j]===0||e===0||e>this[j]?null:(this[M]&&(e=null),this.buffer.length>1&&!this[M]&&(this.encoding?this.buffer=new ge([Array.from(this.buffer).join(``)]):this.buffer=new ge([Buffer.concat(Array.from(this.buffer),this[j])])),this[Ee](e||null,this.buffer.head.value))}finally{this[Ce]()}}[Ee](e,t){return e===t.length||e===null?this[Pe]():(this.buffer.head.value=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit(`data`,t),!this.buffer.length&&!this[Se]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=null),typeof t==`function`&&(n=t,t=`utf8`),e&&this.write(e,t),n&&this.once(`end`,n),this[Se]=!0,this.writable=!1,(this.flowing||!this[je])&&this[Ce](),this}[Me](){this[N]||(this[je]=!1,this[Ae]=!0,this.emit(`resume`),this.buffer.length?this[De]():this[Se]?this[Ce]():this.emit(`drain`))}resume(){return this[Me]()}pause(){this[Ae]=!1,this[je]=!0}get destroyed(){return this[N]}get flowing(){return this[Ae]}get paused(){return this[je]}[Ne](e){return this[M]?this[j]+=1:this[j]+=e.length,this.buffer.push(e)}[Pe](){return this.buffer.length&&(this[M]?--this[j]:this[j]-=this.buffer.head.value.length),this.buffer.shift()}[De](e){do;while(this[Oe](this[Pe]()));!e&&!this.buffer.length&&!this[Se]&&this.emit(`drain`)}[Oe](e){return e?(this.emit(`data`,e),this.flowing):!1}pipe(e,t){if(this[N])return;let n=this[we];t||={},e===process.stdout||e===process.stderr?t.end=!1:t.end=t.end!==!1;let r={dest:e,opts:t,ondrain:e=>this[Me]()};return this.pipes.push(r),e.on(`drain`,r.ondrain),this[Me](),n&&r.opts.end&&r.dest.end(),e}addListener(e,t){return this.on(e,t)}on(e,t){try{return super.on(e,t)}finally{e===`data`&&!this.pipes.length&&!this.flowing?this[Me]():Re(e)&&this[we]&&(super.emit(e),this.removeAllListeners(e))}}get emittedEnd(){return this[we]}[Ce](){!this[k]&&!this[we]&&!this[N]&&this.buffer.length===0&&this[Se]&&(this[k]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[Te]&&this.emit(`close`),this[k]=!1)}emit(e,t){if(e!==`error`&&e!==`close`&&e!==N&&this[N])return;if(e===`data`){if(!t)return;this.pipes.length&&this.pipes.forEach(e=>e.dest.write(t)===!1&&this.pause())}else if(e===`end`){if(this[we]===!0)return;this[we]=!0,this.readable=!1,this[ke]&&(t=this[ke].end(),t&&(this.pipes.forEach(e=>e.dest.write(t)),super.emit(`data`,t))),this.pipes.forEach(e=>{e.dest.removeListener(`drain`,e.ondrain),e.opts.end&&e.dest.end()})}else if(e===`close`&&(this[Te]=!0,!this[we]&&!this[N]))return;let n=Array(arguments.length);if(n[0]=e,n[1]=t,arguments.length>2)for(let e=2;e<arguments.length;e++)n[e]=arguments[e];try{return super.emit.apply(this,n)}finally{Re(e)?this.removeAllListeners(e):this[Ce]()}}collect(){let e=[];this[M]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[M]||(e.dataLength+=t.length)}),t.then(()=>e)}concat(){return this[M]?Promise.reject(Error(`cannot concat in objectMode`)):this.collect().then(e=>this[M]?Promise.reject(Error(`cannot concat in objectMode`)):this[A]?e.join(``):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(N,()=>t(Error(`stream destroyed`))),this.on(`end`,()=>e()),this.on(`error`,e=>t(e))})}[Ie](){return{next:()=>{let e=this.read();if(e!==null)return Promise.resolve({done:!1,value:e});if(this[Se])return Promise.resolve({done:!0});let t=null,n=null,r=e=>{this.removeListener(`data`,i),this.removeListener(`end`,a),n(e)},i=e=>{this.removeListener(`error`,r),this.removeListener(`end`,a),this.pause(),t({value:e,done:!!this[Se]})},a=()=>{this.removeListener(`error`,r),this.removeListener(`data`,i),t({done:!0})},o=()=>r(Error(`stream destroyed`));return new Promise((e,s)=>{n=s,t=e,this.once(N,o),this.once(`error`,r),this.once(`end`,a),this.once(`data`,i)})}}}[Le](){return{next:()=>{let e=this.read();return{value:e,done:e===null}}}}destroy(e){return this[N]?(e?this.emit(`error`,e):this.emit(N),this):(this[N]=!0,this.buffer=new ge,this[j]=0,typeof this.close==`function`&&!this[Te]&&this.close(),e?this.emit(`error`,e):this.emit(N),this)}static isStream(t){return!!t&&(t instanceof e||t instanceof C.default||t instanceof S.default&&(typeof t.pipe==`function`||typeof t.write==`function`&&typeof t.end==`function`))}};let F=T.default.constants||{ZLIB_VERNUM:4736};var Ve=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},F)),He=fe(function(e,t){let n=te.default.Buffer,r=t.constants=Ve,i=n.concat,a=Symbol(`_superWrite`);class o extends Error{constructor(e){super(`zlib: `+e.message),this.code=e.code,this.errno=e.errno,this.code||=`ZLIB_ERROR`,this.message=`zlib: `+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return`ZlibError`}}let s=Symbol(`opts`),c=Symbol(`flushFlag`),l=Symbol(`finishFlushFlag`),u=Symbol(`fullFlushFlag`),d=Symbol(`handle`),f=Symbol(`onError`),p=Symbol(`sawError`),m=Symbol(`level`),h=Symbol(`strategy`),g=Symbol(`ended`);class _ extends Be{constructor(e,t){if(!e||typeof e!=`object`)throw TypeError(`invalid options for ZlibBase constructor`);super(e),this[p]=!1,this[g]=!1,this[s]=e,this[c]=e.flush,this[l]=e.finishFlush;try{this[d]=new T.default[t](e)}catch(e){throw new o(e)}this[f]=e=>{this[p]||(this[p]=!0,this.close(),this.emit(`error`,e))},this[d].on(`error`,e=>this[f](new o(e))),this.once(`end`,()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit(`close`))}reset(){if(!this[p])return w.default(this[d],`zlib binding closed`),this[d].reset()}flush(e){this.ended||(typeof e!=`number`&&(e=this[u]),this.write(Object.assign(n.alloc(0),{[c]:e})))}end(e,t,n){return e&&this.write(e,t),this.flush(this[l]),this[g]=!0,super.end(null,null,n)}get ended(){return this[g]}write(e,t,r){if(typeof t==`function`&&(r=t,t=`utf8`),typeof e==`string`&&(e=n.from(e,t)),this[p])return;w.default(this[d],`zlib binding closed`);let s=this[d]._handle,l=s.close;s.close=()=>{};let u=this[d].close;this[d].close=()=>{},n.concat=e=>e;let m;try{let t=typeof e[c]==`number`?e[c]:this[c];m=this[d]._processChunk(e,t),n.concat=i}catch(e){n.concat=i,this[f](new o(e))}finally{this[d]&&(this[d]._handle=s,s.close=l,this[d].close=u,this[d].removeAllListeners(`error`))}this[d]&&this[d].on(`error`,e=>this[f](new o(e)));let h;if(m)if(Array.isArray(m)&&m.length>0){h=this[a](n.from(m[0]));for(let e=1;e<m.length;e++)h=this[a](m[e])}else h=this[a](n.from(m));return r&&r(),h}[a](e){return super.write(e)}}class v extends _{constructor(e,t){e||={},e.flush=e.flush||r.Z_NO_FLUSH,e.finishFlush=e.finishFlush||r.Z_FINISH,super(e,t),this[u]=r.Z_FULL_FLUSH,this[m]=e.level,this[h]=e.strategy}params(e,t){if(!this[p]){if(!this[d])throw Error(`cannot switch params when binding is closed`);if(!this[d].params)throw Error(`not supported in this implementation`);if(this[m]!==e||this[h]!==t){this.flush(r.Z_SYNC_FLUSH),w.default(this[d],`zlib binding closed`);let n=this[d].flush;this[d].flush=(e,t)=>{this.flush(e),t()};try{this[d].params(e,t)}finally{this[d].flush=n}this[d]&&(this[m]=e,this[h]=t)}}}}class y extends v{constructor(e){super(e,`Deflate`)}}class b extends v{constructor(e){super(e,`Inflate`)}}let x=Symbol(`_portable`);class S extends v{constructor(e){super(e,`Gzip`),this[x]=e&&!!e.portable}[a](e){return this[x]?(this[x]=!1,e[9]=255,super[a](e)):super[a](e)}}class C extends v{constructor(e){super(e,`Gunzip`)}}class ee extends v{constructor(e){super(e,`DeflateRaw`)}}class E extends v{constructor(e){super(e,`InflateRaw`)}}class ne extends v{constructor(e){super(e,`Unzip`)}}class D extends _{constructor(e,t){e||={},e.flush=e.flush||r.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||r.BROTLI_OPERATION_FINISH,super(e,t),this[u]=r.BROTLI_OPERATION_FLUSH}}class re extends D{constructor(e){super(e,`BrotliCompress`)}}class ie extends D{constructor(e){super(e,`BrotliDecompress`)}}t.Deflate=y,t.Inflate=b,t.Gzip=S,t.Gunzip=C,t.DeflateRaw=ee,t.InflateRaw=E,t.Unzip=ne,typeof T.default.BrotliCompress==`function`?(t.BrotliCompress=re,t.BrotliDecompress=ie):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw Error(`Brotli is not supported in this version of Node.js`)}}});let Ue=Symbol(`slurp`);var We=class extends Be{constructor(e,t,n){switch(super(),this.pause(),this.extended=t,this.globalExtended=n,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case`File`:case`OldFile`:case`Link`:case`SymbolicLink`:case`CharacterDevice`:case`BlockDevice`:case`Directory`:case`FIFO`:case`ContiguousFile`:case`GNUDumpDir`:break;case`NextFileHasLongLinkpath`:case`NextFileHasLongPath`:case`OldGnuLongPath`:case`GlobalExtendedHeader`:case`ExtendedHeader`:case`OldExtendedHeader`:this.meta=!0;break;default:this.ignore=!0}this.path=e.path,this.mode=e.mode,this.mode&&(this.mode&=4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath,this.uname=e.uname,this.gname=e.gname,t&&this[Ue](t),n&&this[Ue](n,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw Error(`writing more to entry than is appropriate`);let n=this.remain,r=this.blockRemain;return this.remain=Math.max(0,n-t),this.blockRemain=Math.max(0,r-t),this.ignore?!0:n>=t?super.write(e):super.write(e.slice(0,n))}[Ue](e,t){for(let n in e)e[n]!==null&&e[n]!==void 0&&!(t&&n===`path`)&&(this[n]=e[n])}},Ge=fe(function(e,t){t.name=new Map([[`0`,`File`],[``,`OldFile`],[`1`,`Link`],[`2`,`SymbolicLink`],[`3`,`CharacterDevice`],[`4`,`BlockDevice`],[`5`,`Directory`],[`6`,`FIFO`],[`7`,`ContiguousFile`],[`g`,`GlobalExtendedHeader`],[`x`,`ExtendedHeader`],[`A`,`SolarisACL`],[`D`,`GNUDumpDir`],[`I`,`Inode`],[`K`,`NextFileHasLongLinkpath`],[`L`,`NextFileHasLongPath`],[`M`,`ContinuationFile`],[`N`,`OldGnuLongPath`],[`S`,`SparseFile`],[`V`,`TapeVolumeHeader`],[`X`,`OldExtendedHeader`]]),t.code=new Map(Array.from(t.name).map(e=>[e[1],e[0]]))});let Ke=(e,t)=>{if(Number.isSafeInteger(e))e<0?Je(e,t):qe(e,t);else throw Error(`cannot encode number outside of javascript safe integer range`);return t},qe=(e,t)=>{t[0]=128;for(var n=t.length;n>1;n--)t[n-1]=e&255,e=Math.floor(e/256)},Je=(e,t)=>{t[0]=255;var n=!1;e*=-1;for(var r=t.length;r>1;r--){var i=e&255;e=Math.floor(e/256),n?t[r-1]=Qe(i):i===0?t[r-1]=0:(n=!0,t[r-1]=$e(i))}},Ye=e=>{let t=e[0],n=t===128?Ze(e.slice(1,e.length)):t===255?Xe(e):null;if(n===null)throw Error(`invalid base256 encoding`);if(!Number.isSafeInteger(n))throw Error(`parsed number outside of javascript safe integer range`);return n},Xe=e=>{for(var t=e.length,n=0,r=!1,i=t-1;i>-1;i--){var a=e[i],o;r?o=Qe(a):a===0?o=a:(r=!0,o=$e(a)),o!==0&&(n-=o*256**(t-i-1))}return n},Ze=e=>{for(var t=e.length,n=0,r=t-1;r>-1;r--){var i=e[r];i!==0&&(n+=i*256**(t-r-1))}return n},Qe=e=>(255^e)&255,$e=e=>(255^e)+1&255;var et={encode:Ke,parse:Ye};let tt=x.default.posix,nt=Symbol(`slurp`),I=Symbol(`type`);var rt=class{constructor(e,t,n,r){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[I]=`0`,this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,n,r):e&&this.set(e)}decode(e,t,n,r){if(t||=0,!e||!(e.length>=t+512))throw Error(`need 512 bytes for header`);if(this.path=at(e,t,100),this.mode=ct(e,t+100,8),this.uid=ct(e,t+108,8),this.gid=ct(e,t+116,8),this.size=ct(e,t+124,12),this.mtime=ot(e,t+136,12),this.cksum=ct(e,t+148,12),this[nt](n),this[nt](r,!0),this[I]=at(e,t+156,1),this[I]===``&&(this[I]=`0`),this[I]===`0`&&this.path.substr(-1)===`/`&&(this[I]=`5`),this[I]===`5`&&(this.size=0),this.linkpath=at(e,t+157,100),e.slice(t+257,t+265).toString()===`ustar\x0000`)if(this.uname=at(e,t+265,32),this.gname=at(e,t+297,32),this.devmaj=ct(e,t+329,8),this.devmin=ct(e,t+337,8),e[t+475]!==0)this.path=at(e,t+345,155)+`/`+this.path;else{let n=at(e,t+345,130);n&&(this.path=n+`/`+this.path),this.atime=ot(e,t+476,12),this.ctime=ot(e,t+488,12)}let i=256;for(let n=t;n<t+148;n++)i+=e[n];for(let n=t+156;n<t+512;n++)i+=e[n];this.cksumValid=i===this.cksum,this.cksum===null&&i===256&&(this.nullBlock=!0)}[nt](e,t){for(let n in e)e[n]!==null&&e[n]!==void 0&&!(t&&n===`path`)&&(this[n]=e[n])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||=0,!(e.length>=t+512))throw Error(`need 512 bytes for header`);let n=this.ctime||this.atime?130:155,r=it(this.path||``,n),i=r[0],a=r[1];this.needPax=r[2],this.needPax=vt(e,t,100,i)||this.needPax,this.needPax=ft(e,t+100,8,this.mode)||this.needPax,this.needPax=ft(e,t+108,8,this.uid)||this.needPax,this.needPax=ft(e,t+116,8,this.gid)||this.needPax,this.needPax=ft(e,t+124,12,this.size)||this.needPax,this.needPax=gt(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[I].charCodeAt(0),this.needPax=vt(e,t+157,100,this.linkpath)||this.needPax,e.write(`ustar\x0000`,t+257,8),this.needPax=vt(e,t+265,32,this.uname)||this.needPax,this.needPax=vt(e,t+297,32,this.gname)||this.needPax,this.needPax=ft(e,t+329,8,this.devmaj)||this.needPax,this.needPax=ft(e,t+337,8,this.devmin)||this.needPax,this.needPax=vt(e,t+345,n,a)||this.needPax,e[t+475]===0?(this.needPax=vt(e,t+345,130,a)||this.needPax,this.needPax=gt(e,t+476,12,this.atime)||this.needPax,this.needPax=gt(e,t+488,12,this.ctime)||this.needPax):this.needPax=vt(e,t+345,155,a)||this.needPax;let o=256;for(let n=t;n<t+148;n++)o+=e[n];for(let n=t+156;n<t+512;n++)o+=e[n];return this.cksum=o,ft(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return Ge.name.get(this[I])||this[I]}get typeKey(){return this[I]}set type(e){Ge.code.has(e)?this[I]=Ge.code.get(e):this[I]=e}};let it=(e,t)=>{let n=e,r=``,i,a=tt.parse(e).root||`.`;if(Buffer.byteLength(n)<100)i=[n,r,!1];else{r=tt.dirname(n),n=tt.basename(n);do Buffer.byteLength(n)<=100&&Buffer.byteLength(r)<=t?i=[n,r,!1]:Buffer.byteLength(n)>100&&Buffer.byteLength(r)<=t?i=[n.substr(0,99),r,!0]:(n=tt.join(tt.basename(r),n),r=tt.dirname(r));while(r!==a&&!i);i||=[e.substr(0,99),``,!0]}return i},at=(e,t,n)=>e.slice(t,t+n).toString(`utf8`).replace(/\0.*/,``),ot=(e,t,n)=>st(ct(e,t,n)),st=e=>e===null?null:new Date(e*1e3),ct=(e,t,n)=>e[t]&128?et.parse(e.slice(t,t+n)):ut(e,t,n),lt=e=>isNaN(e)?null:e,ut=(e,t,n)=>lt(parseInt(e.slice(t,t+n).toString(`utf8`).replace(/\0.*$/,``).trim(),8)),dt={12:8589934591,8:2097151},ft=(e,t,n,r)=>r===null?!1:r>dt[n]||r<0?(et.encode(r,e.slice(t,t+n)),!0):(pt(e,t,n,r),!1),pt=(e,t,n,r)=>e.write(mt(r,n),t,n,`ascii`),mt=(e,t)=>ht(Math.floor(e).toString(8),t),ht=(e,t)=>(e.length===t-1?e:Array(t-e.length-1).join(`0`)+e+` `)+`\0`,gt=(e,t,n,r)=>r===null?!1:ft(e,t,n,r.getTime()/1e3),_t=Array(156).join(`\0`),vt=(e,t,n,r)=>r===null?!1:(e.write(r+_t,t,n,`utf8`),r.length!==Buffer.byteLength(r)||r.length>n);var yt=rt,bt=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e===``)return null;let t=Buffer.byteLength(e),n=512*Math.ceil(1+t/512),r=Buffer.allocUnsafe(n);for(let e=0;e<512;e++)r[e]=0;new yt({path:(`PaxHeader/`+x.default.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?`GlobalExtendedHeader`:`ExtendedHeader`,linkpath:``,uname:this.uname||``,gname:this.gname||``,devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(r),r.write(e,512,t,`utf8`);for(let e=t+512;e<r.length;e++)r[e]=0;return r}encodeBody(){return this.encodeField(`path`)+this.encodeField(`ctime`)+this.encodeField(`atime`)+this.encodeField(`dev`)+this.encodeField(`ino`)+this.encodeField(`nlink`)+this.encodeField(`charset`)+this.encodeField(`comment`)+this.encodeField(`gid`)+this.encodeField(`gname`)+this.encodeField(`linkpath`)+this.encodeField(`mtime`)+this.encodeField(`size`)+this.encodeField(`uid`)+this.encodeField(`uname`)}encodeField(e){if(this[e]===null||this[e]===void 0)return``;let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],n=` `+(e===`dev`||e===`ino`||e===`nlink`?`SCHILY.`:``)+e+`=`+t+`
|
|
20
|
+
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function h(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function g(){if(a.env.NO_COLOR||a.env.FORCE_COLOR===`0`||a.env.FORCE_COLOR===`false`)return!1;if(a.env.FORCE_COLOR||a.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=m,e.useColor=g}));const{program:le,createCommand:ue,createArgument:de,createOption:fe,CommanderError:pe,InvalidArgumentError:me,InvalidOptionArgumentError:he,Command:ge,Argument:O,Option:_e,Help:ve}=ne(T((e=>{let{Argument:t}=ie(),{Command:n}=ce(),{CommanderError:r,InvalidArgumentError:i}=re(),{Help:a}=ae(),{Option:o}=oe();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i}))(),1).default;let ye,be,xe,Se,Ce=!0;typeof process<`u`&&({FORCE_COLOR:ye,NODE_DISABLE_COLORS:be,NO_COLOR:xe,TERM:Se}=process.env||{},Ce=process.stdout&&process.stdout.isTTY);const we={enabled:!be&&xe==null&&Se!==`dumb`&&(ye!=null&&ye!==`0`||Ce)};function k(e,t){let n=RegExp(`\\x1b\\[${t}m`,`g`),r=`\x1b[${e}m`,i=`\x1b[${t}m`;return function(e){return!we.enabled||e==null?e:r+(~(``+e).indexOf(i)?e.replace(n,i+r):e)+i}}k(0,0);const Te=k(1,22),Ee=k(2,22);k(3,23),k(4,24),k(7,27),k(8,28),k(9,29),k(30,39);const De=k(31,39),Oe=k(32,39);k(33,39);const A=k(34,39);k(35,39);const ke=k(36,39);k(37,39),k(90,39),k(90,39),k(40,49),k(41,49),k(42,49),k(43,49),k(44,49),k(45,49),k(46,49),k(47,49);function Ae(e){if(typeof e!=`string`||e==null)return{valid:!1,message:`Project name is required`};if(typeof e==`string`&&e.trim().length===0)return{valid:!1,message:`Project name cannot be empty`};let t=n(o(process.cwd(),e.trim()));return t.length>214?{valid:!1,message:`Project name must be less than 214 characters`}:/^[a-z0-9._-]+$/.test(t)?t.startsWith(`.`)||t.startsWith(`_`)?{valid:!1,message:`Project name cannot start with a dot or underscore`}:t.endsWith(`.`)?{valid:!1,message:`Project name cannot end with a dot`}:t.includes(`..`)?{valid:!1,message:`Project name cannot contain consecutive dots`}:[`node_modules`,`favicon.ico`,`con`,`prn`,`aux`,`nul`,`com1`,`com2`,`com3`,`com4`,`com5`,`com6`,`com7`,`com8`,`com9`,`lpt1`,`lpt2`,`lpt3`,`lpt4`,`lpt5`,`lpt6`,`lpt7`,`lpt8`,`lpt9`].includes(t.toLowerCase())?{valid:!1,message:`"${t}" is a reserved name and cannot be used`}:{valid:!0,message:``}:{valid:!1,message:`Project name can only contain lowercase letters, numbers, hyphens, dots, and underscores`}}var je=T((e=>{var t=D(`fs`),n=D(`path`),r=D(`events`),i=D(`stream`),a=D(`string_decoder`),o=D(`assert`),s=D(`buffer`),c=D(`zlib`),l=D(`util`),u=D(`crypto`),d=D(`os`),f=D(`tty`),p=D(`constants`),m=D(`https`),h=D(`child_process`),g=D(`url`),_=D(`net`),v=D(`tls`);function y(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var b=y(t),x=y(n),S=y(r),C=y(i),ee=y(a),w=y(o),te=y(s),T=y(c),E=y(l),ne=y(u),re=y(d),ie=y(f),ae=y(p),oe=y(m),se=y(h),ce=y(g),le=y(_),ue=y(v),de=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function fe(e){var t={exports:{}};return e(t,t.exports),t.exports}let pe=new Map([[`C`,`cwd`],[`f`,`file`],[`z`,`gzip`],[`P`,`preservePaths`],[`U`,`unlink`],[`strip-components`,`strip`],[`stripComponents`,`strip`],[`keep-newer`,`newer`],[`keepNewer`,`newer`],[`keep-newer-files`,`newer`],[`keepNewerFiles`,`newer`],[`k`,`keep`],[`keep-existing`,`keep`],[`keepExisting`,`keep`],[`m`,`noMtime`],[`no-mtime`,`noMtime`],[`p`,`preserveOwner`],[`L`,`follow`],[`h`,`follow`]]);var me=e=>e?Object.keys(e).map(t=>[pe.has(t)?pe.get(t):t,e[t]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{},he=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}},ge=O;O.Node=be,O.create=O;function O(e){var t=this;if(t instanceof O||(t=new O),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach==`function`)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}O.prototype.removeNode=function(e){if(e.list!==this)throw Error(`removing node which does not belong to this list`);var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},O.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||=e,this.length++}},O.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||=e,this.length++}},O.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)ve(this,arguments[e]);return this.length},O.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)ye(this,arguments[e]);return this.length},O.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},O.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},O.prototype.forEach=function(e,t){t||=this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next},O.prototype.forEachReverse=function(e,t){t||=this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev},O.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value},O.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value},O.prototype.map=function(e,t){t||=this;for(var n=new O,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n},O.prototype.mapReverse=function(e,t){t||=this;for(var n=new O,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n},O.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw TypeError(`Reduce of empty list with no initial value`);for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n},O.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw TypeError(`Reduce of empty list with no initial value`);for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n},O.prototype.toArray=function(){for(var e=Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e},O.prototype.toArrayReverse=function(){for(var e=Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e},O.prototype.slice=function(e,t){t||=this.length,t<0&&(t+=this.length),e||=0,e<0&&(e+=this.length);var n=new O;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(;i!==null&&r<t;r++,i=i.next)n.push(i.value);return n},O.prototype.sliceReverse=function(e,t){t||=this.length,t<0&&(t+=this.length),e||=0,e<0&&(e+=this.length);var n=new O;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n},O.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(var a=[],r=0;i&&r<t;r++)a.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=_e(this,i,n[r]);return a},O.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function _e(e,t,n){var r=t===e.head?new be(n,null,t,e):new be(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function ve(e,t){e.tail=new be(t,e.tail,null,e),e.head||=e.tail,e.length++}function ye(e,t){e.head=new be(t,null,e.head,e),e.tail||=e.head,e.length++}function be(e,t,n,r){if(!(this instanceof be))return new be(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{he(O)}catch{}let xe=ee.default.StringDecoder,Se=Symbol(`EOF`),Ce=Symbol(`maybeEmitEnd`),we=Symbol(`emittedEnd`),k=Symbol(`emittingEnd`),Te=Symbol(`closed`),Ee=Symbol(`read`),De=Symbol(`flush`),Oe=Symbol(`flushChunk`),A=Symbol(`encoding`),ke=Symbol(`decoder`),Ae=Symbol(`flowing`),je=Symbol(`paused`),Me=Symbol(`resume`),j=Symbol(`bufferLength`),Ne=Symbol(`bufferPush`),Pe=Symbol(`bufferShift`),M=Symbol(`objectMode`),N=Symbol(`destroyed`),Fe=de._MP_NO_ITERATOR_SYMBOLS_!==`1`,Ie=Fe&&Symbol.asyncIterator||Symbol(`asyncIterator not implemented`),Le=Fe&&Symbol.iterator||Symbol(`iterator not implemented`),Re=e=>e===`end`||e===`finish`||e===`prefinish`,P=e=>e instanceof ArrayBuffer||typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,ze=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e);var Be=class e extends C.default{constructor(e){super(),this[Ae]=!1,this[je]=!1,this.pipes=new ge,this.buffer=new ge,this[M]=e&&e.objectMode||!1,this[M]?this[A]=null:this[A]=e&&e.encoding||null,this[A]===`buffer`&&(this[A]=null),this[ke]=this[A]?new xe(this[A]):null,this[Se]=!1,this[we]=!1,this[k]=!1,this[Te]=!1,this.writable=!0,this.readable=!0,this[j]=0,this[N]=!1}get bufferLength(){return this[j]}get encoding(){return this[A]}set encoding(e){if(this[M])throw Error(`cannot set encoding in objectMode`);if(this[A]&&e!==this[A]&&(this[ke]&&this[ke].lastNeed||this[j]))throw Error(`cannot change encoding`);this[A]!==e&&(this[ke]=e?new xe(e):null,this.buffer.length&&(this.buffer=this.buffer.map(e=>this[ke].write(e)))),this[A]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[M]}set objectMode(e){this[M]=this[M]||!!e}write(e,t,n){if(this[Se])throw Error(`write after end`);return this[N]?(this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0):(typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`,!this[M]&&!Buffer.isBuffer(e)&&(ze(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):P(e)?e=Buffer.from(e):typeof e!=`string`&&(this.objectMode=!0)),!this.objectMode&&!e.length?(this[j]!==0&&this.emit(`readable`),n&&n(),this.flowing):(typeof e==`string`&&!this[M]&&!(t===this[A]&&!this[ke].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[A]&&(e=this[ke].write(e)),this.flowing?(this[j]!==0&&this[De](!0),this.emit(`data`,e)):this[Ne](e),this[j]!==0&&this.emit(`readable`),n&&n(),this.flowing))}read(e){if(this[N])return null;try{return this[j]===0||e===0||e>this[j]?null:(this[M]&&(e=null),this.buffer.length>1&&!this[M]&&(this.encoding?this.buffer=new ge([Array.from(this.buffer).join(``)]):this.buffer=new ge([Buffer.concat(Array.from(this.buffer),this[j])])),this[Ee](e||null,this.buffer.head.value))}finally{this[Ce]()}}[Ee](e,t){return e===t.length||e===null?this[Pe]():(this.buffer.head.value=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit(`data`,t),!this.buffer.length&&!this[Se]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=null),typeof t==`function`&&(n=t,t=`utf8`),e&&this.write(e,t),n&&this.once(`end`,n),this[Se]=!0,this.writable=!1,(this.flowing||!this[je])&&this[Ce](),this}[Me](){this[N]||(this[je]=!1,this[Ae]=!0,this.emit(`resume`),this.buffer.length?this[De]():this[Se]?this[Ce]():this.emit(`drain`))}resume(){return this[Me]()}pause(){this[Ae]=!1,this[je]=!0}get destroyed(){return this[N]}get flowing(){return this[Ae]}get paused(){return this[je]}[Ne](e){return this[M]?this[j]+=1:this[j]+=e.length,this.buffer.push(e)}[Pe](){return this.buffer.length&&(this[M]?--this[j]:this[j]-=this.buffer.head.value.length),this.buffer.shift()}[De](e){do;while(this[Oe](this[Pe]()));!e&&!this.buffer.length&&!this[Se]&&this.emit(`drain`)}[Oe](e){return e?(this.emit(`data`,e),this.flowing):!1}pipe(e,t){if(this[N])return;let n=this[we];t||={},e===process.stdout||e===process.stderr?t.end=!1:t.end=t.end!==!1;let r={dest:e,opts:t,ondrain:e=>this[Me]()};return this.pipes.push(r),e.on(`drain`,r.ondrain),this[Me](),n&&r.opts.end&&r.dest.end(),e}addListener(e,t){return this.on(e,t)}on(e,t){try{return super.on(e,t)}finally{e===`data`&&!this.pipes.length&&!this.flowing?this[Me]():Re(e)&&this[we]&&(super.emit(e),this.removeAllListeners(e))}}get emittedEnd(){return this[we]}[Ce](){!this[k]&&!this[we]&&!this[N]&&this.buffer.length===0&&this[Se]&&(this[k]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[Te]&&this.emit(`close`),this[k]=!1)}emit(e,t){if(e!==`error`&&e!==`close`&&e!==N&&this[N])return;if(e===`data`){if(!t)return;this.pipes.length&&this.pipes.forEach(e=>e.dest.write(t)===!1&&this.pause())}else if(e===`end`){if(this[we]===!0)return;this[we]=!0,this.readable=!1,this[ke]&&(t=this[ke].end(),t&&(this.pipes.forEach(e=>e.dest.write(t)),super.emit(`data`,t))),this.pipes.forEach(e=>{e.dest.removeListener(`drain`,e.ondrain),e.opts.end&&e.dest.end()})}else if(e===`close`&&(this[Te]=!0,!this[we]&&!this[N]))return;let n=Array(arguments.length);if(n[0]=e,n[1]=t,arguments.length>2)for(let e=2;e<arguments.length;e++)n[e]=arguments[e];try{return super.emit.apply(this,n)}finally{Re(e)?this.removeAllListeners(e):this[Ce]()}}collect(){let e=[];this[M]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[M]||(e.dataLength+=t.length)}),t.then(()=>e)}concat(){return this[M]?Promise.reject(Error(`cannot concat in objectMode`)):this.collect().then(e=>this[M]?Promise.reject(Error(`cannot concat in objectMode`)):this[A]?e.join(``):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(N,()=>t(Error(`stream destroyed`))),this.on(`end`,()=>e()),this.on(`error`,e=>t(e))})}[Ie](){return{next:()=>{let e=this.read();if(e!==null)return Promise.resolve({done:!1,value:e});if(this[Se])return Promise.resolve({done:!0});let t=null,n=null,r=e=>{this.removeListener(`data`,i),this.removeListener(`end`,a),n(e)},i=e=>{this.removeListener(`error`,r),this.removeListener(`end`,a),this.pause(),t({value:e,done:!!this[Se]})},a=()=>{this.removeListener(`error`,r),this.removeListener(`data`,i),t({done:!0})},o=()=>r(Error(`stream destroyed`));return new Promise((e,s)=>{n=s,t=e,this.once(N,o),this.once(`error`,r),this.once(`end`,a),this.once(`data`,i)})}}}[Le](){return{next:()=>{let e=this.read();return{value:e,done:e===null}}}}destroy(e){return this[N]?(e?this.emit(`error`,e):this.emit(N),this):(this[N]=!0,this.buffer=new ge,this[j]=0,typeof this.close==`function`&&!this[Te]&&this.close(),e?this.emit(`error`,e):this.emit(N),this)}static isStream(t){return!!t&&(t instanceof e||t instanceof C.default||t instanceof S.default&&(typeof t.pipe==`function`||typeof t.write==`function`&&typeof t.end==`function`))}};let F=T.default.constants||{ZLIB_VERNUM:4736};var Ve=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},F)),He=fe(function(e,t){let n=te.default.Buffer,r=t.constants=Ve,i=n.concat,a=Symbol(`_superWrite`);class o extends Error{constructor(e){super(`zlib: `+e.message),this.code=e.code,this.errno=e.errno,this.code||=`ZLIB_ERROR`,this.message=`zlib: `+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return`ZlibError`}}let s=Symbol(`opts`),c=Symbol(`flushFlag`),l=Symbol(`finishFlushFlag`),u=Symbol(`fullFlushFlag`),d=Symbol(`handle`),f=Symbol(`onError`),p=Symbol(`sawError`),m=Symbol(`level`),h=Symbol(`strategy`),g=Symbol(`ended`);class _ extends Be{constructor(e,t){if(!e||typeof e!=`object`)throw TypeError(`invalid options for ZlibBase constructor`);super(e),this[p]=!1,this[g]=!1,this[s]=e,this[c]=e.flush,this[l]=e.finishFlush;try{this[d]=new T.default[t](e)}catch(e){throw new o(e)}this[f]=e=>{this[p]||(this[p]=!0,this.close(),this.emit(`error`,e))},this[d].on(`error`,e=>this[f](new o(e))),this.once(`end`,()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit(`close`))}reset(){if(!this[p])return w.default(this[d],`zlib binding closed`),this[d].reset()}flush(e){this.ended||(typeof e!=`number`&&(e=this[u]),this.write(Object.assign(n.alloc(0),{[c]:e})))}end(e,t,n){return e&&this.write(e,t),this.flush(this[l]),this[g]=!0,super.end(null,null,n)}get ended(){return this[g]}write(e,t,r){if(typeof t==`function`&&(r=t,t=`utf8`),typeof e==`string`&&(e=n.from(e,t)),this[p])return;w.default(this[d],`zlib binding closed`);let s=this[d]._handle,l=s.close;s.close=()=>{};let u=this[d].close;this[d].close=()=>{},n.concat=e=>e;let m;try{let t=typeof e[c]==`number`?e[c]:this[c];m=this[d]._processChunk(e,t),n.concat=i}catch(e){n.concat=i,this[f](new o(e))}finally{this[d]&&(this[d]._handle=s,s.close=l,this[d].close=u,this[d].removeAllListeners(`error`))}this[d]&&this[d].on(`error`,e=>this[f](new o(e)));let h;if(m)if(Array.isArray(m)&&m.length>0){h=this[a](n.from(m[0]));for(let e=1;e<m.length;e++)h=this[a](m[e])}else h=this[a](n.from(m));return r&&r(),h}[a](e){return super.write(e)}}class v extends _{constructor(e,t){e||={},e.flush=e.flush||r.Z_NO_FLUSH,e.finishFlush=e.finishFlush||r.Z_FINISH,super(e,t),this[u]=r.Z_FULL_FLUSH,this[m]=e.level,this[h]=e.strategy}params(e,t){if(!this[p]){if(!this[d])throw Error(`cannot switch params when binding is closed`);if(!this[d].params)throw Error(`not supported in this implementation`);if(this[m]!==e||this[h]!==t){this.flush(r.Z_SYNC_FLUSH),w.default(this[d],`zlib binding closed`);let n=this[d].flush;this[d].flush=(e,t)=>{this.flush(e),t()};try{this[d].params(e,t)}finally{this[d].flush=n}this[d]&&(this[m]=e,this[h]=t)}}}}class y extends v{constructor(e){super(e,`Deflate`)}}class b extends v{constructor(e){super(e,`Inflate`)}}let x=Symbol(`_portable`);class S extends v{constructor(e){super(e,`Gzip`),this[x]=e&&!!e.portable}[a](e){return this[x]?(this[x]=!1,e[9]=255,super[a](e)):super[a](e)}}class C extends v{constructor(e){super(e,`Gunzip`)}}class ee extends v{constructor(e){super(e,`DeflateRaw`)}}class E extends v{constructor(e){super(e,`InflateRaw`)}}class ne extends v{constructor(e){super(e,`Unzip`)}}class D extends _{constructor(e,t){e||={},e.flush=e.flush||r.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||r.BROTLI_OPERATION_FINISH,super(e,t),this[u]=r.BROTLI_OPERATION_FLUSH}}class re extends D{constructor(e){super(e,`BrotliCompress`)}}class ie extends D{constructor(e){super(e,`BrotliDecompress`)}}t.Deflate=y,t.Inflate=b,t.Gzip=S,t.Gunzip=C,t.DeflateRaw=ee,t.InflateRaw=E,t.Unzip=ne,typeof T.default.BrotliCompress==`function`?(t.BrotliCompress=re,t.BrotliDecompress=ie):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw Error(`Brotli is not supported in this version of Node.js`)}}});let Ue=Symbol(`slurp`);var We=class extends Be{constructor(e,t,n){switch(super(),this.pause(),this.extended=t,this.globalExtended=n,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case`File`:case`OldFile`:case`Link`:case`SymbolicLink`:case`CharacterDevice`:case`BlockDevice`:case`Directory`:case`FIFO`:case`ContiguousFile`:case`GNUDumpDir`:break;case`NextFileHasLongLinkpath`:case`NextFileHasLongPath`:case`OldGnuLongPath`:case`GlobalExtendedHeader`:case`ExtendedHeader`:case`OldExtendedHeader`:this.meta=!0;break;default:this.ignore=!0}this.path=e.path,this.mode=e.mode,this.mode&&(this.mode&=4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath,this.uname=e.uname,this.gname=e.gname,t&&this[Ue](t),n&&this[Ue](n,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw Error(`writing more to entry than is appropriate`);let n=this.remain,r=this.blockRemain;return this.remain=Math.max(0,n-t),this.blockRemain=Math.max(0,r-t),this.ignore?!0:n>=t?super.write(e):super.write(e.slice(0,n))}[Ue](e,t){for(let n in e)e[n]!==null&&e[n]!==void 0&&!(t&&n===`path`)&&(this[n]=e[n])}},Ge=fe(function(e,t){t.name=new Map([[`0`,`File`],[``,`OldFile`],[`1`,`Link`],[`2`,`SymbolicLink`],[`3`,`CharacterDevice`],[`4`,`BlockDevice`],[`5`,`Directory`],[`6`,`FIFO`],[`7`,`ContiguousFile`],[`g`,`GlobalExtendedHeader`],[`x`,`ExtendedHeader`],[`A`,`SolarisACL`],[`D`,`GNUDumpDir`],[`I`,`Inode`],[`K`,`NextFileHasLongLinkpath`],[`L`,`NextFileHasLongPath`],[`M`,`ContinuationFile`],[`N`,`OldGnuLongPath`],[`S`,`SparseFile`],[`V`,`TapeVolumeHeader`],[`X`,`OldExtendedHeader`]]),t.code=new Map(Array.from(t.name).map(e=>[e[1],e[0]]))});let Ke=(e,t)=>{if(Number.isSafeInteger(e))e<0?Je(e,t):qe(e,t);else throw Error(`cannot encode number outside of javascript safe integer range`);return t},qe=(e,t)=>{t[0]=128;for(var n=t.length;n>1;n--)t[n-1]=e&255,e=Math.floor(e/256)},Je=(e,t)=>{t[0]=255;var n=!1;e*=-1;for(var r=t.length;r>1;r--){var i=e&255;e=Math.floor(e/256),n?t[r-1]=Qe(i):i===0?t[r-1]=0:(n=!0,t[r-1]=$e(i))}},Ye=e=>{let t=e[0],n=t===128?Ze(e.slice(1,e.length)):t===255?Xe(e):null;if(n===null)throw Error(`invalid base256 encoding`);if(!Number.isSafeInteger(n))throw Error(`parsed number outside of javascript safe integer range`);return n},Xe=e=>{for(var t=e.length,n=0,r=!1,i=t-1;i>-1;i--){var a=e[i],o;r?o=Qe(a):a===0?o=a:(r=!0,o=$e(a)),o!==0&&(n-=o*256**(t-i-1))}return n},Ze=e=>{for(var t=e.length,n=0,r=t-1;r>-1;r--){var i=e[r];i!==0&&(n+=i*256**(t-r-1))}return n},Qe=e=>(255^e)&255,$e=e=>(255^e)+1&255;var et={encode:Ke,parse:Ye};let tt=x.default.posix,nt=Symbol(`slurp`),I=Symbol(`type`);var rt=class{constructor(e,t,n,r){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[I]=`0`,this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,n,r):e&&this.set(e)}decode(e,t,n,r){if(t||=0,!e||!(e.length>=t+512))throw Error(`need 512 bytes for header`);if(this.path=at(e,t,100),this.mode=ct(e,t+100,8),this.uid=ct(e,t+108,8),this.gid=ct(e,t+116,8),this.size=ct(e,t+124,12),this.mtime=ot(e,t+136,12),this.cksum=ct(e,t+148,12),this[nt](n),this[nt](r,!0),this[I]=at(e,t+156,1),this[I]===``&&(this[I]=`0`),this[I]===`0`&&this.path.substr(-1)===`/`&&(this[I]=`5`),this[I]===`5`&&(this.size=0),this.linkpath=at(e,t+157,100),e.slice(t+257,t+265).toString()===`ustar\x0000`)if(this.uname=at(e,t+265,32),this.gname=at(e,t+297,32),this.devmaj=ct(e,t+329,8),this.devmin=ct(e,t+337,8),e[t+475]!==0){let n=at(e,t+345,155);this.path=n+`/`+this.path}else{let n=at(e,t+345,130);n&&(this.path=n+`/`+this.path),this.atime=ot(e,t+476,12),this.ctime=ot(e,t+488,12)}let i=256;for(let n=t;n<t+148;n++)i+=e[n];for(let n=t+156;n<t+512;n++)i+=e[n];this.cksumValid=i===this.cksum,this.cksum===null&&i===256&&(this.nullBlock=!0)}[nt](e,t){for(let n in e)e[n]!==null&&e[n]!==void 0&&!(t&&n===`path`)&&(this[n]=e[n])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||=0,!(e.length>=t+512))throw Error(`need 512 bytes for header`);let n=this.ctime||this.atime?130:155,r=it(this.path||``,n),i=r[0],a=r[1];this.needPax=r[2],this.needPax=vt(e,t,100,i)||this.needPax,this.needPax=ft(e,t+100,8,this.mode)||this.needPax,this.needPax=ft(e,t+108,8,this.uid)||this.needPax,this.needPax=ft(e,t+116,8,this.gid)||this.needPax,this.needPax=ft(e,t+124,12,this.size)||this.needPax,this.needPax=gt(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[I].charCodeAt(0),this.needPax=vt(e,t+157,100,this.linkpath)||this.needPax,e.write(`ustar\x0000`,t+257,8),this.needPax=vt(e,t+265,32,this.uname)||this.needPax,this.needPax=vt(e,t+297,32,this.gname)||this.needPax,this.needPax=ft(e,t+329,8,this.devmaj)||this.needPax,this.needPax=ft(e,t+337,8,this.devmin)||this.needPax,this.needPax=vt(e,t+345,n,a)||this.needPax,e[t+475]===0?(this.needPax=vt(e,t+345,130,a)||this.needPax,this.needPax=gt(e,t+476,12,this.atime)||this.needPax,this.needPax=gt(e,t+488,12,this.ctime)||this.needPax):this.needPax=vt(e,t+345,155,a)||this.needPax;let o=256;for(let n=t;n<t+148;n++)o+=e[n];for(let n=t+156;n<t+512;n++)o+=e[n];return this.cksum=o,ft(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return Ge.name.get(this[I])||this[I]}get typeKey(){return this[I]}set type(e){Ge.code.has(e)?this[I]=Ge.code.get(e):this[I]=e}};let it=(e,t)=>{let n=e,r=``,i,a=tt.parse(e).root||`.`;if(Buffer.byteLength(n)<100)i=[n,r,!1];else{r=tt.dirname(n),n=tt.basename(n);do Buffer.byteLength(n)<=100&&Buffer.byteLength(r)<=t?i=[n,r,!1]:Buffer.byteLength(n)>100&&Buffer.byteLength(r)<=t?i=[n.substr(0,99),r,!0]:(n=tt.join(tt.basename(r),n),r=tt.dirname(r));while(r!==a&&!i);i||=[e.substr(0,99),``,!0]}return i},at=(e,t,n)=>e.slice(t,t+n).toString(`utf8`).replace(/\0.*/,``),ot=(e,t,n)=>st(ct(e,t,n)),st=e=>e===null?null:new Date(e*1e3),ct=(e,t,n)=>e[t]&128?et.parse(e.slice(t,t+n)):ut(e,t,n),lt=e=>isNaN(e)?null:e,ut=(e,t,n)=>lt(parseInt(e.slice(t,t+n).toString(`utf8`).replace(/\0.*$/,``).trim(),8)),dt={12:8589934591,8:2097151},ft=(e,t,n,r)=>r===null?!1:r>dt[n]||r<0?(et.encode(r,e.slice(t,t+n)),!0):(pt(e,t,n,r),!1),pt=(e,t,n,r)=>e.write(mt(r,n),t,n,`ascii`),mt=(e,t)=>ht(Math.floor(e).toString(8),t),ht=(e,t)=>(e.length===t-1?e:Array(t-e.length-1).join(`0`)+e+` `)+`\0`,gt=(e,t,n,r)=>r===null?!1:ft(e,t,n,r.getTime()/1e3),_t=Array(156).join(`\0`),vt=(e,t,n,r)=>r===null?!1:(e.write(r+_t,t,n,`utf8`),r.length!==Buffer.byteLength(r)||r.length>n);var yt=rt,bt=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e===``)return null;let t=Buffer.byteLength(e),n=512*Math.ceil(1+t/512),r=Buffer.allocUnsafe(n);for(let e=0;e<512;e++)r[e]=0;new yt({path:(`PaxHeader/`+x.default.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?`GlobalExtendedHeader`:`ExtendedHeader`,linkpath:``,uname:this.uname||``,gname:this.gname||``,devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(r),r.write(e,512,t,`utf8`);for(let e=t+512;e<r.length;e++)r[e]=0;return r}encodeBody(){return this.encodeField(`path`)+this.encodeField(`ctime`)+this.encodeField(`atime`)+this.encodeField(`dev`)+this.encodeField(`ino`)+this.encodeField(`nlink`)+this.encodeField(`charset`)+this.encodeField(`comment`)+this.encodeField(`gid`)+this.encodeField(`gname`)+this.encodeField(`linkpath`)+this.encodeField(`mtime`)+this.encodeField(`size`)+this.encodeField(`uid`)+this.encodeField(`uname`)}encodeField(e){if(this[e]===null||this[e]===void 0)return``;let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],n=` `+(e===`dev`||e===`ino`||e===`nlink`?`SCHILY.`:``)+e+`=`+t+`
|
|
21
21
|
`,r=Buffer.byteLength(n),i=Math.floor(Math.log(r)/Math.log(10))+1;return r+i>=10**i&&(i+=1),i+r+n}};bt.parse=(e,t,n)=>new bt(xt(St(e),t),n);let xt=(e,t)=>t?Object.keys(e).reduce((t,n)=>(t[n]=e[n],t),t):e,St=e=>e.replace(/\n$/,``).split(`
|
|
22
|
-
`).reduce(Ct,Object.create(null)),Ct=(e,t)=>{let n=parseInt(t,10);if(n!==Buffer.byteLength(t)+1)return e;t=t.substr((n+` `).length);let r=t.split(`=`),i=r.shift().replace(/^SCHILY\.(dev|ino|nlink)/,`$1`);if(!i)return e;let a=r.join(`=`);return e[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(a*1e3):/^[0-9]+$/.test(a)?+a:a,e};var L=bt,wt=e=>class extends e{warn(e,t,n={}){this.file&&(n.file=this.file),this.cwd&&(n.cwd=this.cwd),n.code=t instanceof Error&&t.code||e,n.tarCode=e,!this.strict&&n.recoverable!==!1?(t instanceof Error&&(n=Object.assign(t,n),t=t.message),this.emit(`warn`,n.tarCode,t,n)):t instanceof Error?this.emit(`error`,Object.assign(t,n)):this.emit(`error`,Object.assign(Error(`${e}: ${t}`),n))}};let Tt=[`|`,`<`,`>`,`?`,`:`],Et=Tt.map(e=>String.fromCharCode(61440+e.charCodeAt(0))),Dt=new Map(Tt.map((e,t)=>[e,Et[t]])),Ot=new Map(Et.map((e,t)=>[e,Tt[t]]));var kt={encode:e=>Tt.reduce((e,t)=>e.split(t).join(Dt.get(t)),e),decode:e=>Et.reduce((e,t)=>e.split(t).join(Ot.get(t)),e)},At=(e,t,n)=>(e&=4095,n&&(e=(e|384)&-19),t&&(e&256&&(e|=64),e&32&&(e|=8),e&4&&(e|=1)),e);let jt=Symbol(`process`),Mt=Symbol(`file`),Nt=Symbol(`directory`),Pt=Symbol(`symlink`),Ft=Symbol(`hardlink`),It=Symbol(`header`),Lt=Symbol(`read`),Rt=Symbol(`lstat`),zt=Symbol(`onlstat`),Bt=Symbol(`onread`),Vt=Symbol(`onreadlink`),Ht=Symbol(`openfile`),Ut=Symbol(`onopenfile`),Wt=Symbol(`close`),Gt=Symbol(`mode`),Kt=wt(class extends Be{constructor(e,t){if(t||={},super(t),typeof e!=`string`)throw TypeError(`path is required`);this.path=e,this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid(),this.myuser=process.env.USER||``,this.maxReadSize=t.maxReadSize||16777216,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=t.cwd||process.cwd(),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,typeof t.onwarn==`function`&&this.on(`warn`,t.onwarn);let n=!1;if(!this.preservePaths&&x.default.win32.isAbsolute(e)){let t=x.default.win32.parse(e);this.path=e.substr(t.root.length),n=t.root}this.win32=!!t.win32||process.platform===`win32`,this.win32&&(this.path=kt.decode(this.path.replace(/\\/g,`/`)),e=e.replace(/\\/g,`/`)),this.absolute=t.absolute||x.default.resolve(this.cwd,e),this.path===``&&(this.path=`./`),n&&this.warn(`TAR_ENTRY_INFO`,`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.statCache.has(this.absolute)?this[zt](this.statCache.get(this.absolute)):this[Rt]()}[Rt](){b.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit(`error`,e);this[zt](t)})}[zt](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Yt(e),this.emit(`stat`,e),this[jt]()}[jt](){switch(this.type){case`File`:return this[Mt]();case`Directory`:return this[Nt]();case`SymbolicLink`:return this[Pt]();default:return this.end()}}[Gt](e){return At(e,this.type===`Directory`,this.portable)}[It](){this.type===`Directory`&&this.portable&&(this.noMtime=!0),this.header=new yt({path:this.path,linkpath:this.linkpath,mode:this[Gt](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:``,atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&this.write(new L({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),this.write(this.header.block)}[Nt](){this.path.substr(-1)!==`/`&&(this.path+=`/`),this.stat.size=0,this[It](),this.end()}[Pt](){b.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit(`error`,e);this[Vt](t)})}[Vt](e){this.linkpath=e.replace(/\\/g,`/`),this[It](),this.end()}[Ft](e){this.type=`Link`,this.linkpath=x.default.relative(this.cwd,e).replace(/\\/g,`/`),this.stat.size=0,this[It](),this.end()}[Mt](){if(this.stat.nlink>1){let e=this.stat.dev+`:`+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[Ft](t)}this.linkCache.set(e,this.absolute)}if(this[It](),this.stat.size===0)return this.end();this[Ht]()}[Ht](){b.default.open(this.absolute,`r`,(e,t)=>{if(e)return this.emit(`error`,e);this[Ut](t)})}[Ut](e){let t=512*Math.ceil(this.stat.size/512),n=Math.min(t,this.maxReadSize),r=Buffer.allocUnsafe(n);this[Lt](e,r,0,r.length,0,this.stat.size,t)}[Lt](e,t,n,r,i,a,o){b.default.read(e,t,n,r,i,(s,c)=>{if(s)return this[Wt](e,()=>this.emit(`error`,s));this[Bt](e,t,n,r,i,a,o,c)})}[Wt](e,t){b.default.close(e,t)}[Bt](e,t,n,r,i,a,o,s){if(s<=0&&a>0){let t=Error(`encountered unexpected EOF`);return t.path=this.absolute,t.syscall=`read`,t.code=`EOF`,this[Wt](e,()=>this.emit(`error`,t))}if(s>a){let t=Error(`did not encounter expected EOF`);return t.path=this.absolute,t.syscall=`read`,t.code=`EOF`,this[Wt](e,()=>this.emit(`error`,t))}if(s===a)for(let e=s;e<r&&s<o;e++)t[e+n]=0,s++,a++;let c=n===0&&s===t.length?t:t.slice(n,n+s);if(a-=s,o-=s,i+=s,n+=s,this.write(c),!a)return o&&this.write(Buffer.alloc(o)),this[Wt](e,e=>e?this.emit(`error`,e):this.end());n>=r&&(t=Buffer.allocUnsafe(r),n=0),r=t.length-n,this[Lt](e,t,n,r,i,a,o)}});var qt=class extends Kt{[Rt](){this[zt](b.default.lstatSync(this.absolute))}[Pt](){this[Vt](b.default.readlinkSync(this.absolute))}[Ht](){this[Ut](b.default.openSync(this.absolute,`r`))}[Lt](e,t,n,r,i,a,o){let s=!0;try{let c=b.default.readSync(e,t,n,r,i);this[Bt](e,t,n,r,i,a,o,c),s=!1}finally{if(s)try{this[Wt](e,()=>{})}catch{}}}[Wt](e,t){b.default.closeSync(e),t()}};let Jt=wt(class extends Be{constructor(e,t){t||={},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type===`Directory`&&this.portable&&(this.noMtime=!0),this.path=e.path,this.mode=this[Gt](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=e.linkpath,typeof t.onwarn==`function`&&this.on(`warn`,t.onwarn);let n=!1;if(x.default.isAbsolute(this.path)&&!this.preservePaths){let e=x.default.parse(this.path);n=e.root,this.path=this.path.substr(e.root.length)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new yt({path:this.path,linkpath:this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),n&&this.warn(`TAR_ENTRY_INFO`,`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new L({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this.path,linkpath:this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[Gt](e){return At(e,this.type===`Directory`,this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw Error(`writing more to entry than is appropriate`);return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&this.write(Buffer.alloc(this.blockRemain)),super.end()}});Kt.Sync=qt,Kt.Tar=Jt;let Yt=e=>e.isFile()?`File`:e.isDirectory()?`Directory`:e.isSymbolicLink()?`SymbolicLink`:`Unsupported`;var Xt=Kt,Zt=class{constructor(e,t){this.path=e||`./`,this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}};let Qt=Xt.Sync,$t=Xt.Tar,en=Buffer.alloc(1024),tn=Symbol(`onStat`),R=Symbol(`ended`),nn=Symbol(`queue`),rn=Symbol(`current`),an=Symbol(`process`),on=Symbol(`processing`),sn=Symbol(`processJob`),z=Symbol(`jobs`),cn=Symbol(`jobDone`),ln=Symbol(`addFSEntry`),un=Symbol(`addTarEntry`),dn=Symbol(`stat`),fn=Symbol(`readdir`),pn=Symbol(`onreaddir`),mn=Symbol(`pipe`),hn=Symbol(`entry`),gn=Symbol(`entryOpt`),_n=Symbol(`writeEntryClass`),vn=Symbol(`write`),yn=Symbol(`ondrain`),bn=wt(class extends Be{constructor(e){super(e),e||=Object.create(null),this.opt=e,this.file=e.file||``,this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(e.prefix||``).replace(/(\\|\/)+$/,``),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[_n]=Xt,typeof e.onwarn==`function`&&this.on(`warn`,e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!=`object`&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new He.Gzip(e.gzip),this.zip.on(`data`,e=>super.write(e)),this.zip.on(`end`,e=>super.end()),this.zip.on(`drain`,e=>this[yn]()),this.on(`resume`,e=>this.zip.resume())):this.on(`drain`,this[yn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter==`function`?e.filter:e=>!0,this[nn]=new ge,this[z]=0,this.jobs=+e.jobs||4,this[on]=!1,this[R]=!1}[vn](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[R]=!0,this[an](),this}write(e){if(this[R])throw Error(`write after end`);return e instanceof We?this[un](e):this[ln](e),this.flowing}[un](e){let t=x.default.resolve(this.cwd,e.path);if(this.prefix&&(e.path=this.prefix+`/`+e.path.replace(/^\.(\/+|$)/,``)),!this.filter(e.path,e))e.resume();else{let n=new Zt(e.path,t,!1);n.entry=new $t(e,this[gn](n)),n.entry.on(`end`,e=>this[cn](n)),this[z]+=1,this[nn].push(n)}this[an]()}[ln](e){let t=x.default.resolve(this.cwd,e);this.prefix&&(e=this.prefix+`/`+e.replace(/^\.(\/+|$)/,``)),this[nn].push(new Zt(e,t)),this[an]()}[dn](e){e.pending=!0,this[z]+=1;let t=this.follow?`stat`:`lstat`;b.default[t](e.absolute,(t,n)=>{e.pending=!1,--this[z],t?this.emit(`error`,t):this[tn](e,n)})}[tn](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[an]()}[fn](e){e.pending=!0,this[z]+=1,b.default.readdir(e.absolute,(t,n)=>{if(e.pending=!1,--this[z],t)return this.emit(`error`,t);this[pn](e,n)})}[pn](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[an]()}[an](){if(!this[on]){this[on]=!0;for(let e=this[nn].head;e!==null&&this[z]<this.jobs;e=e.next)if(this[sn](e.value),e.value.ignore){let t=e.next;this[nn].removeNode(e),e.next=t}this[on]=!1,this[R]&&!this[nn].length&&this[z]===0&&(this.zip?this.zip.end(en):(super.write(en),super.end()))}}get[rn](){return this[nn]&&this[nn].head&&this[nn].head.value}[cn](e){this[nn].shift(),--this[z],this[an]()}[sn](e){if(!e.pending){if(e.entry){e===this[rn]&&!e.piped&&this[mn](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[tn](e,this.statCache.get(e.absolute)):this[dn](e)),e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[pn](e,this.readdirCache.get(e.absolute)):this[fn](e),!e.readdir))){if(e.entry=this[hn](e),!e.entry){e.ignore=!0;return}e===this[rn]&&!e.piped&&this[mn](e)}}}[gn](e){return{onwarn:(e,t,n)=>this.warn(e,t,n),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime}}[hn](e){this[z]+=1;try{return new this[_n](e.path,this[gn](e)).on(`end`,()=>this[cn](e)).on(`error`,e=>this.emit(`error`,e))}catch(e){this.emit(`error`,e)}}[yn](){this[rn]&&this[rn].entry&&this[rn].entry.resume()}[mn](e){e.piped=!0,e.readdir&&e.readdir.forEach(t=>{let n=this.prefix?e.path.slice(this.prefix.length+1)||`./`:e.path,r=n===`./`?``:n.replace(/\/*$/,`/`);this[ln](r+t)});let t=e.entry,n=this.zip;n?t.on(`data`,e=>{n.write(e)||t.pause()}):t.on(`data`,e=>{super.write(e)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}});bn.Sync=class extends bn{constructor(e){super(e),this[_n]=Qt}pause(){}resume(){}[dn](e){let t=this.follow?`statSync`:`lstatSync`;this[tn](e,b.default[t](e.absolute))}[fn](e,t){this[pn](e,b.default.readdirSync(e.absolute))}[mn](e){let t=e.entry,n=this.zip;e.readdir&&e.readdir.forEach(t=>{let n=this.prefix?e.path.slice(this.prefix.length+1)||`./`:e.path,r=n===`./`?``:n.replace(/\/*$/,`/`);this[ln](r+t)}),n?t.on(`data`,e=>{n.write(e)}):t.on(`data`,e=>{super[vn](e)})}};var xn=bn;let Sn=S.default.EventEmitter,Cn=b.default.writev;if(!Cn){let e=process.binding(`fs`),t=e.FSReqWrap||e.FSReqCallback;Cn=(n,r,i,a)=>{let o=(e,t)=>a(e,t,r),s=new t;s.oncomplete=o,e.writeBuffers(n,r,i,s)}}let wn=Symbol(`_autoClose`),B=Symbol(`_close`),Tn=Symbol(`_ended`),V=Symbol(`_fd`),En=Symbol(`_finished`),Dn=Symbol(`_flags`),On=Symbol(`_flush`),kn=Symbol(`_handleChunk`),An=Symbol(`_makeBuf`),jn=Symbol(`_mode`),Mn=Symbol(`_needDrain`),Nn=Symbol(`_onerror`),Pn=Symbol(`_onopen`),Fn=Symbol(`_onread`),In=Symbol(`_onwrite`),Ln=Symbol(`_open`),Rn=Symbol(`_path`),zn=Symbol(`_pos`),H=Symbol(`_queue`),Bn=Symbol(`_read`),Vn=Symbol(`_readSize`),Hn=Symbol(`_reading`),Un=Symbol(`_remain`),Wn=Symbol(`_size`),Gn=Symbol(`_write`),Kn=Symbol(`_writing`),qn=Symbol(`_defaultFlag`),Jn=Symbol(`_errored`);var Yn=class extends Be{constructor(e,t){if(t||={},super(t),this.readable=!0,this.writable=!1,typeof e!=`string`)throw TypeError(`path must be a string`);this[Jn]=!1,this[V]=typeof t.fd==`number`?t.fd:null,this[Rn]=e,this[Vn]=t.readSize||16*1024*1024,this[Hn]=!1,this[Wn]=typeof t.size==`number`?t.size:1/0,this[Un]=this[Wn],this[wn]=typeof t.autoClose==`boolean`?t.autoClose:!0,typeof this[V]==`number`?this[Bn]():this[Ln]()}get fd(){return this[V]}get path(){return this[Rn]}write(){throw TypeError(`this is a readable stream`)}end(){throw TypeError(`this is a readable stream`)}[Ln](){b.default.open(this[Rn],`r`,(e,t)=>this[Pn](e,t))}[Pn](e,t){e?this[Nn](e):(this[V]=t,this.emit(`open`,t),this[Bn]())}[An](){return Buffer.allocUnsafe(Math.min(this[Vn],this[Un]))}[Bn](){if(!this[Hn]){this[Hn]=!0;let e=this[An]();if(e.length===0)return process.nextTick(()=>this[Fn](null,0,e));b.default.read(this[V],e,0,e.length,null,(e,t,n)=>this[Fn](e,t,n))}}[Fn](e,t,n){this[Hn]=!1,e?this[Nn](e):this[kn](t,n)&&this[Bn]()}[B](){if(this[wn]&&typeof this[V]==`number`){let e=this[V];this[V]=null,b.default.close(e,e=>e?this.emit(`error`,e):this.emit(`close`))}}[Nn](e){this[Hn]=!0,this[B](),this.emit(`error`,e)}[kn](e,t){let n=!1;return this[Un]-=e,e>0&&(n=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[Un]<=0)&&(n=!1,this[B](),super.end()),n}emit(e,t){switch(e){case`prefinish`:case`finish`:break;case`drain`:typeof this[V]==`number`&&this[Bn]();break;case`error`:return this[Jn]?void 0:(this[Jn]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Xn=class extends Yn{[Ln](){let e=!0;try{this[Pn](null,b.default.openSync(this[Rn],`r`)),e=!1}finally{e&&this[B]()}}[Bn](){let e=!0;try{if(!this[Hn]){this[Hn]=!0;do{let e=this[An](),t=e.length===0?0:b.default.readSync(this[V],e,0,e.length,null);if(!this[kn](t,e))break}while(!0);this[Hn]=!1}e=!1}finally{e&&this[B]()}}[B](){if(this[wn]&&typeof this[V]==`number`){let e=this[V];this[V]=null,b.default.closeSync(e),this.emit(`close`)}}},Zn=class extends Sn{constructor(e,t){t||={},super(t),this.readable=!1,this.writable=!0,this[Jn]=!1,this[Kn]=!1,this[Tn]=!1,this[Mn]=!1,this[H]=[],this[Rn]=e,this[V]=typeof t.fd==`number`?t.fd:null,this[jn]=t.mode===void 0?438:t.mode,this[zn]=typeof t.start==`number`?t.start:null,this[wn]=typeof t.autoClose==`boolean`?t.autoClose:!0;let n=this[zn]===null?`w`:`r+`;this[qn]=t.flags===void 0,this[Dn]=this[qn]?n:t.flags,this[V]===null&&this[Ln]()}emit(e,t){if(e===`error`){if(this[Jn])return;this[Jn]=!0}return super.emit(e,t)}get fd(){return this[V]}get path(){return this[Rn]}[Nn](e){this[B](),this[Kn]=!0,this.emit(`error`,e)}[Ln](){b.default.open(this[Rn],this[Dn],this[jn],(e,t)=>this[Pn](e,t))}[Pn](e,t){this[qn]&&this[Dn]===`r+`&&e&&e.code===`ENOENT`?(this[Dn]=`w`,this[Ln]()):e?this[Nn](e):(this[V]=t,this.emit(`open`,t),this[On]())}end(e,t){return e&&this.write(e,t),this[Tn]=!0,!this[Kn]&&!this[H].length&&typeof this[V]==`number`&&this[In](null,0),this}write(e,t){return typeof e==`string`&&(e=Buffer.from(e,t)),this[Tn]?(this.emit(`error`,Error(`write() after end()`)),!1):this[V]===null||this[Kn]||this[H].length?(this[H].push(e),this[Mn]=!0,!1):(this[Kn]=!0,this[Gn](e),!0)}[Gn](e){b.default.write(this[V],e,0,e.length,this[zn],(e,t)=>this[In](e,t))}[In](e,t){e?this[Nn](e):(this[zn]!==null&&(this[zn]+=t),this[H].length?this[On]():(this[Kn]=!1,this[Tn]&&!this[En]?(this[En]=!0,this[B](),this.emit(`finish`)):this[Mn]&&(this[Mn]=!1,this.emit(`drain`))))}[On](){if(this[H].length===0)this[Tn]&&this[In](null,0);else if(this[H].length===1)this[Gn](this[H].pop());else{let e=this[H];this[H]=[],Cn(this[V],e,this[zn],(e,t)=>this[In](e,t))}}[B](){if(this[wn]&&typeof this[V]==`number`){let e=this[V];this[V]=null,b.default.close(e,e=>e?this.emit(`error`,e):this.emit(`close`))}}},Qn={ReadStream:Yn,ReadStreamSync:Xn,WriteStream:Zn,WriteStreamSync:class extends Zn{[Ln](){let e;if(this[qn]&&this[Dn]===`r+`)try{e=b.default.openSync(this[Rn],this[Dn],this[jn])}catch(e){if(e.code===`ENOENT`)return this[Dn]=`w`,this[Ln]();throw e}else e=b.default.openSync(this[Rn],this[Dn],this[jn]);this[Pn](null,e)}[B](){if(this[wn]&&typeof this[V]==`number`){let e=this[V];this[V]=null,b.default.closeSync(e),this.emit(`close`)}}[Gn](e){let t=!0;try{this[In](null,b.default.writeSync(this[V],e,0,e.length,this[zn])),t=!1}finally{if(t)try{this[B]()}catch{}}}}};let $n=Buffer.from([31,139]),er=Symbol(`state`),tr=Symbol(`writeEntry`),U=Symbol(`readEntry`),nr=Symbol(`nextEntry`),rr=Symbol(`processEntry`),W=Symbol(`extendedHeader`),ir=Symbol(`globalExtendedHeader`),ar=Symbol(`meta`),or=Symbol(`emitMeta`),G=Symbol(`buffer`),sr=Symbol(`queue`),cr=Symbol(`ended`),lr=Symbol(`emittedEnd`),ur=Symbol(`emit`),K=Symbol(`unzip`),dr=Symbol(`consumeChunk`),fr=Symbol(`consumeChunkSub`),pr=Symbol(`consumeBody`),mr=Symbol(`consumeMeta`),hr=Symbol(`consumeHeader`),gr=Symbol(`consuming`),_r=Symbol(`bufferConcat`),vr=Symbol(`maybeEnd`),yr=Symbol(`writing`),br=Symbol(`aborted`),xr=Symbol(`onDone`),Sr=Symbol(`sawValidEntry`),Cr=Symbol(`sawNullBlock`),wr=Symbol(`sawEOF`),Tr=e=>!0;var Er=wt(class extends S.default{constructor(e){e||={},super(e),this.file=e.file||``,this[Sr]=null,this.on(xr,e=>{(this[er]===`begin`||this[Sr]===!1)&&this.warn(`TAR_BAD_ARCHIVE`,`Unrecognized archive format`)}),e.ondone?this.on(xr,e.ondone):this.on(xr,e=>{this.emit(`prefinish`),this.emit(`finish`),this.emit(`end`),this.emit(`close`)}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||1048576,this.filter=typeof e.filter==`function`?e.filter:Tr,this.writable=!0,this.readable=!1,this[sr]=new ge,this[G]=null,this[U]=null,this[tr]=null,this[er]=`begin`,this[ar]=``,this[W]=null,this[ir]=null,this[cr]=!1,this[K]=null,this[br]=!1,this[Cr]=!1,this[wr]=!1,typeof e.onwarn==`function`&&this.on(`warn`,e.onwarn),typeof e.onentry==`function`&&this.on(`entry`,e.onentry)}[hr](e,t){this[Sr]===null&&(this[Sr]=!1);let n;try{n=new yt(e,t,this[W],this[ir])}catch(e){return this.warn(`TAR_ENTRY_INVALID`,e)}if(n.nullBlock)this[Cr]?(this[wr]=!0,this[er]===`begin`&&(this[er]=`header`),this[ur](`eof`)):(this[Cr]=!0,this[ur](`nullBlock`));else if(this[Cr]=!1,!n.cksumValid)this.warn(`TAR_ENTRY_INVALID`,`checksum failure`,{header:n});else if(!n.path)this.warn(`TAR_ENTRY_INVALID`,`path is required`,{header:n});else{let e=n.type;if(/^(Symbolic)?Link$/.test(e)&&!n.linkpath)this.warn(`TAR_ENTRY_INVALID`,`linkpath required`,{header:n});else if(!/^(Symbolic)?Link$/.test(e)&&n.linkpath)this.warn(`TAR_ENTRY_INVALID`,`linkpath forbidden`,{header:n});else{let e=this[tr]=new We(n,this[W],this[ir]);this[Sr]||(e.remain?e.on(`end`,()=>{e.invalid||(this[Sr]=!0)}):this[Sr]=!0),e.meta?e.size>this.maxMetaEntrySize?(e.ignore=!0,this[ur](`ignoredEntry`,e),this[er]=`ignore`,e.resume()):e.size>0&&(this[ar]=``,e.on(`data`,e=>this[ar]+=e),this[er]=`meta`):(this[W]=null,e.ignore=e.ignore||!this.filter(e.path,e),e.ignore?(this[ur](`ignoredEntry`,e),this[er]=e.remain?`ignore`:`header`,e.resume()):(e.remain?this[er]=`body`:(this[er]=`header`,e.end()),this[U]?this[sr].push(e):(this[sr].push(e),this[nr]())))}}}[rr](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[U]=e,this.emit(`entry`,e),e.emittedEnd||(e.on(`end`,e=>this[nr]()),t=!1)):(this[U]=null,t=!1),t}[nr](){do;while(this[rr](this[sr].shift()));if(!this[sr].length){let e=this[U];!e||e.flowing||e.size===e.remain?this[yr]||this.emit(`drain`):e.once(`drain`,e=>this.emit(`drain`))}}[pr](e,t){let n=this[tr],r=n.blockRemain,i=r>=e.length&&t===0?e:e.slice(t,t+r);return n.write(i),n.blockRemain||(this[er]=`header`,this[tr]=null,n.end()),i.length}[mr](e,t){let n=this[tr],r=this[pr](e,t);return this[tr]||this[or](n),r}[ur](e,t,n){!this[sr].length&&!this[U]?this.emit(e,t,n):this[sr].push([e,t,n])}[or](e){switch(this[ur](`meta`,this[ar]),e.type){case`ExtendedHeader`:case`OldExtendedHeader`:this[W]=L.parse(this[ar],this[W],!1);break;case`GlobalExtendedHeader`:this[ir]=L.parse(this[ar],this[ir],!0);break;case`NextFileHasLongPath`:case`OldGnuLongPath`:this[W]=this[W]||Object.create(null),this[W].path=this[ar].replace(/\0.*/,``);break;case`NextFileHasLongLinkpath`:this[W]=this[W]||Object.create(null),this[W].linkpath=this[ar].replace(/\0.*/,``);break;default:throw Error(`unknown meta: `+e.type)}}abort(e){this[br]=!0,this.emit(`abort`,e),this.warn(`TAR_ABORT`,e,{recoverable:!1})}write(e){if(this[br])return;if(this[K]===null&&e){if(this[G]&&(e=Buffer.concat([this[G],e]),this[G]=null),e.length<$n.length)return this[G]=e,!0;for(let t=0;this[K]===null&&t<$n.length;t++)e[t]!==$n[t]&&(this[K]=!1);if(this[K]===null){let t=this[cr];this[cr]=!1,this[K]=new He.Unzip,this[K].on(`data`,e=>this[dr](e)),this[K].on(`error`,e=>this.abort(e)),this[K].on(`end`,e=>{this[cr]=!0,this[dr]()}),this[yr]=!0;let n=this[K][t?`end`:`write`](e);return this[yr]=!1,n}}this[yr]=!0,this[K]?this[K].write(e):this[dr](e),this[yr]=!1;let t=this[sr].length?!1:this[U]?this[U].flowing:!0;return!t&&!this[sr].length&&this[U].once(`drain`,e=>this.emit(`drain`)),t}[_r](e){e&&!this[br]&&(this[G]=this[G]?Buffer.concat([this[G],e]):e)}[vr](){if(this[cr]&&!this[lr]&&!this[br]&&!this[gr]){this[lr]=!0;let e=this[tr];if(e&&e.blockRemain){let t=this[G]?this[G].length:0;this.warn(`TAR_BAD_ARCHIVE`,`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[G]&&e.write(this[G]),e.end()}this[ur](xr)}}[dr](e){if(this[gr])this[_r](e);else if(!e&&!this[G])this[vr]();else{if(this[gr]=!0,this[G]){this[_r](e);let t=this[G];this[G]=null,this[fr](t)}else this[fr](e);for(;this[G]&&this[G].length>=512&&!this[br]&&!this[wr];){let e=this[G];this[G]=null,this[fr](e)}this[gr]=!1}(!this[G]||this[cr])&&this[vr]()}[fr](e){let t=0,n=e.length;for(;t+512<=n&&!this[br]&&!this[wr];)switch(this[er]){case`begin`:case`header`:this[hr](e,t),t+=512;break;case`ignore`:case`body`:t+=this[pr](e,t);break;case`meta`:t+=this[mr](e,t);break;default:throw Error(`invalid state: `+this[er])}t<n&&(this[G]?this[G]=Buffer.concat([e.slice(t),this[G]]):this[G]=e.slice(t))}end(e){this[br]||(this[K]?this[K].end(e):(this[cr]=!0,this.write(e)))}}),Dr=(e,t,n)=>{typeof e==`function`?(n=e,t=null,e={}):Array.isArray(e)&&(t=e,e={}),typeof t==`function`&&(n=t,t=null),t=t?Array.from(t):[];let r=me(e);if(r.sync&&typeof n==`function`)throw TypeError(`callback not supported for sync tar functions`);if(!r.file&&typeof n==`function`)throw TypeError(`callback only supported with file option`);return t.length&&kr(r,t),r.noResume||Or(r),r.file&&r.sync?Ar(r):r.file?jr(r,n):Mr(r)};let Or=e=>{let t=e.onentry;e.onentry=t?e=>{t(e),e.resume()}:e=>e.resume()},kr=(e,t)=>{let n=new Map(t.map(e=>[e.replace(/\/+$/,``),!0])),r=e.filter,i=(e,t)=>{let r=t||x.default.parse(e).root||`.`,a=e===r?!1:n.has(e)?n.get(e):i(x.default.dirname(e),r);return n.set(e,a),a};e.filter=r?(e,t)=>r(e,t)&&i(e.replace(/\/+$/,``)):e=>i(e.replace(/\/+$/,``))},Ar=e=>{let t=Mr(e),n=e.file,r=!0,i;try{let a=b.default.statSync(n),o=e.maxReadSize||16*1024*1024;if(a.size<o)t.end(b.default.readFileSync(n));else{let e=0,r=Buffer.allocUnsafe(o);for(i=b.default.openSync(n,`r`);e<a.size;){let n=b.default.readSync(i,r,0,o,e);e+=n,t.write(r.slice(0,n))}t.end()}r=!1}finally{if(r&&i)try{b.default.closeSync(i)}catch{}}},jr=(e,t)=>{let n=new Er(e),r=e.maxReadSize||16*1024*1024,i=e.file,a=new Promise((e,t)=>{n.on(`error`,t),n.on(`end`,e),b.default.stat(i,(e,a)=>{if(e)t(e);else{let e=new Qn.ReadStream(i,{readSize:r,size:a.size});e.on(`error`,t),e.pipe(n)}})});return t?a.then(t,t):a},Mr=e=>new Er(e);var Nr=(e,t,n)=>{if(typeof t==`function`&&(n=t),Array.isArray(e)&&(t=e,e={}),!t||!Array.isArray(t)||!t.length)throw TypeError(`no files or directories specified`);t=Array.from(t);let r=me(e);if(r.sync&&typeof n==`function`)throw TypeError(`callback not supported for sync tar functions`);if(!r.file&&typeof n==`function`)throw TypeError(`callback only supported with file option`);return r.file&&r.sync?Pr(r,t):r.file?Fr(r,t,n):r.sync?Rr(r,t):zr(r,t)};let Pr=(e,t)=>{let n=new xn.Sync(e),r=new Qn.WriteStreamSync(e.file,{mode:e.mode||438});n.pipe(r),Ir(n,t)},Fr=(e,t,n)=>{let r=new xn(e),i=new Qn.WriteStream(e.file,{mode:e.mode||438});r.pipe(i);let a=new Promise((e,t)=>{i.on(`error`,t),i.on(`close`,e),r.on(`error`,t)});return Lr(r,t),n?a.then(n,n):a},Ir=(e,t)=>{t.forEach(t=>{t.charAt(0)===`@`?Dr({file:x.default.resolve(e.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:t=>e.add(t)}):e.add(t)}),e.end()},Lr=(e,t)=>{for(;t.length;){let n=t.shift();if(n.charAt(0)===`@`)return Dr({file:x.default.resolve(e.cwd,n.substr(1)),noResume:!0,onentry:t=>e.add(t)}).then(n=>Lr(e,t));e.add(n)}e.end()},Rr=(e,t)=>{let n=new xn.Sync(e);return Ir(n,t),n},zr=(e,t)=>{let n=new xn(e);return Lr(n,t),n};var Br=(e,t,n)=>{let r=me(e);if(!r.file)throw TypeError(`file is required`);if(r.gzip)throw TypeError(`cannot append to compressed archives`);if(!t||!Array.isArray(t)||!t.length)throw TypeError(`no files or directories specified`);return t=Array.from(t),r.sync?Vr(r,t):Ur(r,t,n)};let Vr=(e,t)=>{let n=new xn.Sync(e),r=!0,i,a;try{try{i=b.default.openSync(e.file,`r+`)}catch(t){if(t.code===`ENOENT`)i=b.default.openSync(e.file,`w+`);else throw t}let o=b.default.fstatSync(i),s=Buffer.alloc(512);POSITION:for(a=0;a<o.size;a+=512){for(let e=0,t=0;e<512;e+=t){if(t=b.default.readSync(i,s,e,s.length-e,a+e),a===0&&s[0]===31&&s[1]===139)throw Error(`cannot append to compressed archives`);if(!t)break POSITION}let t=new yt(s);if(!t.cksumValid)break;let n=512*Math.ceil(t.size/512);if(a+n+512>o.size)break;a+=n,e.mtimeCache&&e.mtimeCache.set(t.path,t.mtime)}r=!1,Hr(e,n,a,i,t)}finally{if(r)try{b.default.closeSync(i)}catch{}}},Hr=(e,t,n,r,i)=>{let a=new Qn.WriteStreamSync(e.file,{fd:r,start:n});t.pipe(a),Wr(t,i)},Ur=(e,t,n)=>{t=Array.from(t);let r=new xn(e),i=(t,n,r)=>{let i=(e,n)=>{e?b.default.close(t,t=>r(e)):r(null,n)},a=0;if(n===0)return i(null,0);let o=0,s=Buffer.alloc(512),c=(r,l)=>{if(r)return i(r);if(o+=l,o<512&&l)return b.default.read(t,s,o,s.length-o,a+o,c);if(a===0&&s[0]===31&&s[1]===139)return i(Error(`cannot append to compressed archives`));if(o<512)return i(null,a);let u=new yt(s);if(!u.cksumValid)return i(null,a);let d=512*Math.ceil(u.size/512);if(a+d+512>n||(a+=d+512,a>=n))return i(null,a);e.mtimeCache&&e.mtimeCache.set(u.path,u.mtime),o=0,b.default.read(t,s,0,512,a,c)};b.default.read(t,s,0,512,a,c)},a=new Promise((n,a)=>{r.on(`error`,a);let o=`r+`,s=(c,l)=>{if(c&&c.code===`ENOENT`&&o===`r+`)return o=`w+`,b.default.open(e.file,o,s);if(c)return a(c);b.default.fstat(l,(o,s)=>{if(o)return a(o);i(l,s.size,(i,o)=>{if(i)return a(i);let s=new Qn.WriteStream(e.file,{fd:l,start:o});r.pipe(s),s.on(`error`,a),s.on(`close`,n),Gr(r,t)})})};b.default.open(e.file,o,s)});return n?a.then(n,n):a},Wr=(e,t)=>{t.forEach(t=>{t.charAt(0)===`@`?Dr({file:x.default.resolve(e.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:t=>e.add(t)}):e.add(t)}),e.end()},Gr=(e,t)=>{for(;t.length;){let n=t.shift();if(n.charAt(0)===`@`)return Dr({file:x.default.resolve(e.cwd,n.substr(1)),noResume:!0,onentry:t=>e.add(t)}).then(n=>Gr(e,t));e.add(n)}e.end()};var Kr=(e,t,n)=>{let r=me(e);if(!r.file)throw TypeError(`file is required`);if(r.gzip)throw TypeError(`cannot append to compressed archives`);if(!t||!Array.isArray(t)||!t.length)throw TypeError(`no files or directories specified`);return t=Array.from(t),qr(r),Br(r,t,n)};let qr=e=>{let t=e.filter;e.mtimeCache||=new Map,e.filter=t?(n,r)=>t(n,r)&&!(e.mtimeCache.get(n)>r.mtime):(t,n)=>!(e.mtimeCache.get(t)>n.mtime)},{promisify:Jr}=E.default;var Yr=e=>{if(!e)e={mode:511,fs:b.default};else if(typeof e==`object`)e={mode:511,fs:b.default,...e};else if(typeof e==`number`)e={mode:e,fs:b.default};else if(typeof e==`string`)e={mode:parseInt(e,8),fs:b.default};else throw TypeError(`invalid options argument`);return e.mkdir=e.mkdir||e.fs.mkdir||b.default.mkdir,e.mkdirAsync=Jr(e.mkdir),e.stat=e.stat||e.fs.stat||b.default.stat,e.statAsync=Jr(e.stat),e.statSync=e.statSync||e.fs.statSync||b.default.statSync,e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||b.default.mkdirSync,e};let Xr=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Zr,parse:Qr}=x.default;var $r=e=>{if(/\0/.test(e))throw Object.assign(TypeError(`path must be a string without null bytes`),{path:e,code:`ERR_INVALID_ARG_VALUE`});if(e=Zr(e),Xr===`win32`){let t=/[*|"<>?:]/,{root:n}=Qr(e);if(t.test(e.substr(n.length)))throw Object.assign(Error(`Illegal characters in path.`),{path:e,code:`EINVAL`})}return e};let{dirname:ei}=x.default,ti=(e,t,n=void 0)=>n===t?Promise.resolve():e.statAsync(t).then(e=>e.isDirectory()?n:void 0,n=>n.code===`ENOENT`?ti(e,ei(t),t):void 0),ni=(e,t,n=void 0)=>{if(n!==t)try{return e.statSync(t).isDirectory()?n:void 0}catch(n){return n.code===`ENOENT`?ni(e,ei(t),t):void 0}};var ri={findMade:ti,findMadeSync:ni};let{dirname:ii}=x.default,ai=(e,t,n)=>{t.recursive=!1;let r=ii(e);return r===e?t.mkdirAsync(e,t).catch(e=>{if(e.code!==`EISDIR`)throw e}):t.mkdirAsync(e,t).then(()=>n||e,i=>{if(i.code===`ENOENT`)return ai(r,t).then(n=>ai(e,t,n));if(i.code!==`EEXIST`&&i.code!==`EROFS`)throw i;return t.statAsync(e).then(e=>{if(e.isDirectory())return n;throw i},()=>{throw i})})},oi=(e,t,n)=>{let r=ii(e);if(t.recursive=!1,r===e)try{return t.mkdirSync(e,t)}catch(e){if(e.code!==`EISDIR`)throw e;return}try{return t.mkdirSync(e,t),n||e}catch(i){if(i.code===`ENOENT`)return oi(e,t,oi(r,t,n));if(i.code!==`EEXIST`&&i.code!==`EROFS`)throw i;try{if(!t.statSync(e).isDirectory())throw i}catch{throw i}}};var si={mkdirpManual:ai,mkdirpManualSync:oi};let{dirname:ci}=x.default,{findMade:li,findMadeSync:ui}=ri,{mkdirpManual:di,mkdirpManualSync:fi}=si;var pi={mkdirpNative:(e,t)=>(t.recursive=!0,ci(e)===e?t.mkdirAsync(e,t):li(t,e).then(n=>t.mkdirAsync(e,t).then(()=>n).catch(n=>{if(n.code===`ENOENT`)return di(e,t);throw n}))),mkdirpNativeSync:(e,t)=>{if(t.recursive=!0,ci(e)===e)return t.mkdirSync(e,t);let n=ui(t,e);try{return t.mkdirSync(e,t),n}catch(n){if(n.code===`ENOENT`)return fi(e,t);throw n}}};let mi=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,``).split(`.`),hi=+mi[0]>10||+mi[0]==10&&+mi[1]>=12;var gi={useNative:hi?e=>e.mkdir===b.default.mkdir:()=>!1,useNativeSync:hi?e=>e.mkdirSync===b.default.mkdirSync:()=>!1};let{mkdirpNative:_i,mkdirpNativeSync:vi}=pi,{mkdirpManual:yi,mkdirpManualSync:bi}=si,{useNative:xi,useNativeSync:Si}=gi,Ci=(e,t)=>(e=$r(e),t=Yr(t),xi(t)?_i(e,t):yi(e,t));Ci.sync=(e,t)=>(e=$r(e),t=Yr(t),Si(t)?vi(e,t):bi(e,t)),Ci.native=(e,t)=>_i($r(e),Yr(t)),Ci.manual=(e,t)=>yi($r(e),Yr(t)),Ci.nativeSync=(e,t)=>vi($r(e),Yr(t)),Ci.manualSync=(e,t)=>bi($r(e),Yr(t));var wi=Ci;let Ti=b.default.lchown?`lchown`:`chown`,Ei=b.default.lchownSync?`lchownSync`:`chownSync`,Di=b.default.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Oi=(e,t,n)=>{try{return b.default[Ei](e,t,n)}catch(e){if(e.code!==`ENOENT`)throw e}},ki=(e,t,n)=>{try{return b.default.chownSync(e,t,n)}catch(e){if(e.code!==`ENOENT`)throw e}},Ai=Di?(e,t,n,r)=>i=>{!i||i.code!==`EISDIR`?r(i):b.default.chown(e,t,n,r)}:(e,t,n,r)=>r,ji=Di?(e,t,n)=>{try{return Oi(e,t,n)}catch(r){if(r.code!==`EISDIR`)throw r;ki(e,t,n)}}:(e,t,n)=>Oi(e,t,n),Mi=process.version,Ni=(e,t,n)=>b.default.readdir(e,t,n),Pi=(e,t)=>b.default.readdirSync(e,t);/^v4\./.test(Mi)&&(Ni=(e,t,n)=>b.default.readdir(e,n));let Fi=(e,t,n,r)=>{b.default[Ti](e,t,n,Ai(e,t,n,e=>{r(e&&e.code!==`ENOENT`?e:null)}))},Ii=(e,t,n,r,i)=>{if(typeof t==`string`)return b.default.lstat(x.default.resolve(e,t),(a,o)=>{if(a)return i(a.code===`ENOENT`?null:a);o.name=t,Ii(e,o,n,r,i)});t.isDirectory()?Li(x.default.resolve(e,t.name),n,r,a=>{if(a)return i(a);Fi(x.default.resolve(e,t.name),n,r,i)}):Fi(x.default.resolve(e,t.name),n,r,i)},Li=(e,t,n,r)=>{Ni(e,{withFileTypes:!0},(i,a)=>{if(i){if(i.code===`ENOENT`)return r();if(i.code!==`ENOTDIR`&&i.code!==`ENOTSUP`)return r(i)}if(i||!a.length)return Fi(e,t,n,r);let o=a.length,s=null,c=i=>{if(!s){if(i)return r(s=i);if(--o===0)return Fi(e,t,n,r)}};a.forEach(r=>Ii(e,r,t,n,c))})},Ri=(e,t,n,r)=>{if(typeof t==`string`)try{let n=b.default.lstatSync(x.default.resolve(e,t));n.name=t,t=n}catch(e){if(e.code===`ENOENT`)return;throw e}t.isDirectory()&&zi(x.default.resolve(e,t.name),n,r),ji(x.default.resolve(e,t.name),n,r)},zi=(e,t,n)=>{let r;try{r=Pi(e,{withFileTypes:!0})}catch(r){if(r.code===`ENOENT`)return;if(r.code===`ENOTDIR`||r.code===`ENOTSUP`)return ji(e,t,n);throw r}return r&&r.length&&r.forEach(r=>Ri(e,r,t,n)),ji(e,t,n)};var Bi=Li;Li.sync=zi;var Vi=class extends Error{constructor(e,t){super(`Cannot extract through symbolic link`),this.path=t,this.symlink=e}get name(){return`SylinkError`}},Hi=class extends Error{constructor(e,t){super(t+`: Cannot cd into '`+e+`'`),this.path=e,this.code=t}get name(){return`CwdError`}},Ui=(e,t,n)=>{let r=t.umask,i=t.mode|448,a=(i&r)!==0,o=t.uid,s=t.gid,c=typeof o==`number`&&typeof s==`number`&&(o!==t.processUid||s!==t.processGid),l=t.preserve,u=t.unlink,d=t.cache,f=t.cwd,p=(t,r)=>{t?n(t):(d.set(e,!0),r&&c?Bi(r,o,s,e=>p(e)):a?b.default.chmod(e,i,n):n())};if(d&&d.get(e)===!0)return p();if(e===f)return b.default.stat(e,(t,n)=>{(t||!n.isDirectory())&&(t=new Hi(e,t&&t.code||`ENOTDIR`)),p(t)});if(l)return wi(e,{mode:i}).then(e=>p(null,e),p);Wi(f,x.default.relative(f,e).split(/\/|\\/),i,d,u,f,null,p)};let Wi=(e,t,n,r,i,a,o,s)=>{if(!t.length)return s(null,o);let c=t.shift(),l=e+`/`+c;if(r.get(l))return Wi(l,t,n,r,i,a,o,s);b.default.mkdir(l,n,Gi(l,t,n,r,i,a,o,s))},Gi=(e,t,n,r,i,a,o,s)=>c=>{if(c){if(c.path&&x.default.dirname(c.path)===a&&(c.code===`ENOTDIR`||c.code===`ENOENT`))return s(new Hi(a,c.code));b.default.lstat(e,(l,u)=>{if(l)s(l);else if(u.isDirectory())Wi(e,t,n,r,i,a,o,s);else if(i)b.default.unlink(e,c=>{if(c)return s(c);b.default.mkdir(e,n,Gi(e,t,n,r,i,a,o,s))});else if(u.isSymbolicLink())return s(new Vi(e,e+`/`+t.join(`/`)));else s(c)})}else o||=e,Wi(e,t,n,r,i,a,o,s)};Ui.sync=(e,t)=>{let n=t.umask,r=t.mode|448,i=(r&n)!==0,a=t.uid,o=t.gid,s=typeof a==`number`&&typeof o==`number`&&(a!==t.processUid||o!==t.processGid),c=t.preserve,l=t.unlink,u=t.cache,d=t.cwd,f=t=>{u.set(e,!0),t&&s&&Bi.sync(t,a,o),i&&b.default.chmodSync(e,r)};if(u&&u.get(e)===!0)return f();if(e===d){let t=!1,n=`ENOTDIR`;try{t=b.default.statSync(e).isDirectory()}catch(e){n=e.code}finally{if(!t)throw new Hi(e,n)}f();return}if(c)return f(wi.sync(e,r));let p=x.default.relative(d,e).split(/\/|\\/),m=null;for(let e=p.shift(),t=d;e&&(t+=`/`+e);e=p.shift())if(!u.get(t))try{b.default.mkdirSync(t,r),m||=t,u.set(t,!0)}catch(e){if(e.path&&x.default.dirname(e.path)===d&&(e.code===`ENOTDIR`||e.code===`ENOENT`))return new Hi(d,e.code);let n=b.default.lstatSync(t);if(n.isDirectory()){u.set(t,!0);continue}else if(l){b.default.unlinkSync(t),b.default.mkdirSync(t,r),m||=t,u.set(t,!0);continue}else if(n.isSymbolicLink())return new Vi(t,t+`/`+p.join(`/`))}return f(m)};var Ki=()=>{let e=new Map,t=new Map,{join:n}=x.default,r=e=>n(e).split(/[\\/]/).slice(0,-1).reduce((e,t)=>e.length?e.concat(n(e[e.length-1],t)):[t],[]),i=new Set,a=n=>{let r=t.get(n);if(!r)throw Error(`function does not have any path reservations`);return{paths:r.paths.map(t=>e.get(t)),dirs:[...r.dirs].map(t=>e.get(t))}},o=e=>{let{paths:t,dirs:n}=a(e);return t.every(t=>t[0]===e)&&n.every(t=>t[0]instanceof Set&&t[0].has(e))},s=e=>i.has(e)||!o(e)?!1:(i.add(e),e(()=>c(e)),!0),c=n=>{if(!i.has(n))return!1;let{paths:r,dirs:a}=t.get(n),o=new Set;return r.forEach(t=>{let r=e.get(t);w.default.equal(r[0],n),r.length===1?e.delete(t):(r.shift(),typeof r[0]==`function`?o.add(r[0]):r[0].forEach(e=>o.add(e)))}),a.forEach(t=>{let r=e.get(t);w.default(r[0]instanceof Set),r[0].size===1&&r.length===1?e.delete(t):r[0].size===1?(r.shift(),o.add(r[0])):r[0].delete(n)}),i.delete(n),o.forEach(e=>s(e)),!0};return{check:o,reserve:(n,i)=>{let a=new Set(n.map(e=>r(e)).reduce((e,t)=>e.concat(t)));return t.set(i,{dirs:a,paths:n}),n.forEach(t=>{let n=e.get(t);n?n.push(i):e.set(t,[i])}),a.forEach(t=>{let n=e.get(t);n?n[n.length-1]instanceof Set?n[n.length-1].add(i):n.push(new Set([i])):e.set(t,[new Set([i])])}),s(i)}}};let qi=(process.env.__FAKE_PLATFORM__||process.platform)===`win32`,{O_CREAT:Ji,O_TRUNC:Yi,O_WRONLY:Xi,UV_FS_O_FILEMAP:Zi=0}=(de.__FAKE_TESTING_FS__||b.default).constants,Qi=qi&&!!Zi,$i=Zi|Yi|Ji|Xi;var ea=Qi?e=>e<524288?$i:`w`:()=>`w`;let ta=Symbol(`onEntry`),na=Symbol(`checkFs`),ra=Symbol(`checkFs2`),ia=Symbol(`isReusable`),aa=Symbol(`makeFs`),oa=Symbol(`file`),sa=Symbol(`directory`),ca=Symbol(`link`),la=Symbol(`symlink`),ua=Symbol(`hardlink`),da=Symbol(`unsupported`),fa=Symbol(`checkPath`),pa=Symbol(`mkdir`),q=Symbol(`onError`),ma=Symbol(`pending`),ha=Symbol(`pend`),ga=Symbol(`unpend`),_a=Symbol(`ended`),va=Symbol(`maybeClose`),ya=Symbol(`skip`),ba=Symbol(`doChown`),xa=Symbol(`uid`),Sa=Symbol(`gid`),Ca=()=>{throw Error(`sync function called cb somehow?!?`)},wa=(e,t)=>{if(process.platform!==`win32`)return b.default.unlink(e,t);let n=e+`.DELETE.`+ne.default.randomBytes(16).toString(`hex`);b.default.rename(e,n,e=>{if(e)return t(e);b.default.unlink(n,t)})},Ta=e=>{if(process.platform!==`win32`)return b.default.unlinkSync(e);let t=e+`.DELETE.`+ne.default.randomBytes(16).toString(`hex`);b.default.renameSync(e,t),b.default.unlinkSync(t)},Ea=(e,t,n)=>e===e>>>0?e:t===t>>>0?t:n;var Da=class extends Er{constructor(e){if(e||={},e.ondone=e=>{this[_a]=!0,this[va]()},super(e),this.reservations=Ki(),this.transform=typeof e.transform==`function`?e.transform:null,this.writable=!0,this.readable=!1,this[ma]=0,this[_a]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid==`number`||typeof e.gid==`number`){if(typeof e.uid!=`number`||typeof e.gid!=`number`)throw TypeError(`cannot set owner without number uid and gid`);if(e.preserveOwner)throw TypeError(`cannot preserve owner in archive and also set owner explicitly`);this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!=`number`?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||process.platform===`win32`,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=x.default.resolve(e.cwd||process.cwd()),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask==`number`?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on(`entry`,e=>this[ta](e))}warn(e,t,n={}){return(e===`TAR_BAD_ARCHIVE`||e===`TAR_ABORT`)&&(n.recoverable=!1),super.warn(e,t,n)}[va](){this[_a]&&this[ma]===0&&(this.emit(`prefinish`),this.emit(`finish`),this.emit(`end`),this.emit(`close`))}[fa](e){if(this.strip){let t=e.path.split(/\/|\\/);if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join(`/`),e.type===`Link`){let t=e.linkpath.split(/\/|\\/);t.length>=this.strip&&(e.linkpath=t.slice(this.strip).join(`/`))}}if(!this.preservePaths){let t=e.path;if(t.match(/(^|\/|\\)\.\.(\\|\/|$)/))return this.warn(`TAR_ENTRY_ERROR`,`path contains '..'`,{entry:e,path:t}),!1;if(x.default.win32.isAbsolute(t)){let n=x.default.win32.parse(t);e.path=t.substr(n.root.length);let r=n.root;this.warn(`TAR_ENTRY_INFO`,`stripping ${r} from absolute path`,{entry:e,path:t})}}if(this.win32){let t=x.default.win32.parse(e.path);e.path=t.root===``?kt.encode(e.path):t.root+kt.encode(e.path.substr(t.root.length))}return x.default.isAbsolute(e.path)?e.absolute=e.path:e.absolute=x.default.resolve(this.cwd,e.path),!0}[ta](e){if(!this[fa](e))return e.resume();switch(w.default.equal(typeof e.absolute,`string`),e.type){case`Directory`:case`GNUDumpDir`:e.mode&&(e.mode|=448);case`File`:case`OldFile`:case`ContiguousFile`:case`Link`:case`SymbolicLink`:return this[na](e);default:return this[da](e)}}[q](e,t){e.name===`CwdError`?this.emit(`error`,e):(this.warn(`TAR_ENTRY_ERROR`,e,{entry:t}),this[ga](),t.resume())}[pa](e,t,n){Ui(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t,noChmod:this.noChmod},n)}[ba](e){return this.forceChown||this.preserveOwner&&(typeof e.uid==`number`&&e.uid!==this.processUid||typeof e.gid==`number`&&e.gid!==this.processGid)||typeof this.uid==`number`&&this.uid!==this.processUid||typeof this.gid==`number`&&this.gid!==this.processGid}[xa](e){return Ea(this.uid,e.uid,this.processUid)}[Sa](e){return Ea(this.gid,e.gid,this.processGid)}[oa](e,t){let n=e.mode&4095||this.fmode,r=new Qn.WriteStream(e.absolute,{flags:ea(e.size),mode:n,autoClose:!1});r.on(`error`,t=>this[q](t,e));let i=1,a=n=>{if(n)return this[q](n,e);--i===0&&b.default.close(r.fd,n=>{t(),n?this[q](n,e):this[ga]()})};r.on(`finish`,t=>{let n=e.absolute,o=r.fd;if(e.mtime&&!this.noMtime){i++;let t=e.atime||new Date,r=e.mtime;b.default.futimes(o,t,r,e=>e?b.default.utimes(n,t,r,t=>a(t&&e)):a())}if(this[ba](e)){i++;let t=this[xa](e),r=this[Sa](e);b.default.fchown(o,t,r,e=>e?b.default.chown(n,t,r,t=>a(t&&e)):a())}a()});let o=this.transform&&this.transform(e)||e;o!==e&&(o.on(`error`,t=>this[q](t,e)),e.pipe(o)),o.pipe(r)}[sa](e,t){let n=e.mode&4095||this.dmode;this[pa](e.absolute,n,n=>{if(n)return t(),this[q](n,e);let r=1,i=n=>{--r===0&&(t(),this[ga](),e.resume())};e.mtime&&!this.noMtime&&(r++,b.default.utimes(e.absolute,e.atime||new Date,e.mtime,i)),this[ba](e)&&(r++,b.default.chown(e.absolute,this[xa](e),this[Sa](e),i)),i()})}[da](e){e.unsupported=!0,this.warn(`TAR_ENTRY_UNSUPPORTED`,`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[la](e,t){this[ca](e,e.linkpath,`symlink`,t)}[ua](e,t){this[ca](e,x.default.resolve(this.cwd,e.linkpath),`link`,t)}[ha](){this[ma]++}[ga](){this[ma]--,this[va]()}[ya](e){this[ga](),e.resume()}[ia](e,t){return e.type===`File`&&!this.unlink&&t.isFile()&&t.nlink<=1&&process.platform!==`win32`}[na](e){this[ha]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,t=>this[ra](e,t))}[ra](e,t){this[pa](x.default.dirname(e.absolute),this.dmode,n=>{if(n)return t(),this[q](n,e);b.default.lstat(e.absolute,(n,r)=>{r&&(this.keep||this.newer&&r.mtime>e.mtime)?(this[ya](e),t()):n||this[ia](e,r)?this[aa](null,e,t):r.isDirectory()?e.type===`Directory`?!this.noChmod&&(!e.mode||(r.mode&4095)===e.mode)?this[aa](null,e,t):b.default.chmod(e.absolute,e.mode,n=>this[aa](n,e,t)):b.default.rmdir(e.absolute,n=>this[aa](n,e,t)):wa(e.absolute,n=>this[aa](n,e,t))})})}[aa](e,t,n){if(e)return this[q](e,t);switch(t.type){case`File`:case`OldFile`:case`ContiguousFile`:return this[oa](t,n);case`Link`:return this[ua](t,n);case`SymbolicLink`:return this[la](t,n);case`Directory`:case`GNUDumpDir`:return this[sa](t,n)}}[ca](e,t,n,r){b.default[n](t,e.absolute,t=>{if(t)return this[q](t,e);r(),this[ga](),e.resume()})}};Da.Sync=class extends Da{[na](e){let t=this[pa](x.default.dirname(e.absolute),this.dmode,Ca);if(t)return this[q](t,e);try{let t=b.default.lstatSync(e.absolute);if(this.keep||this.newer&&t.mtime>e.mtime)return this[ya](e);if(this[ia](e,t))return this[aa](null,e,Ca);try{return t.isDirectory()?e.type===`Directory`?!this.noChmod&&e.mode&&(t.mode&4095)!==e.mode&&b.default.chmodSync(e.absolute,e.mode):b.default.rmdirSync(e.absolute):Ta(e.absolute),this[aa](null,e,Ca)}catch(t){return this[q](t,e)}}catch{return this[aa](null,e,Ca)}}[oa](e,t){let n=e.mode&4095||this.fmode,r=t=>{let n;try{b.default.closeSync(i)}catch(e){n=e}(t||n)&&this[q](t||n,e)},i;try{i=b.default.openSync(e.absolute,ea(e.size),n)}catch(e){return r(e)}let a=this.transform&&this.transform(e)||e;a!==e&&(a.on(`error`,t=>this[q](t,e)),e.pipe(a)),a.on(`data`,e=>{try{b.default.writeSync(i,e,0,e.length)}catch(e){r(e)}}),a.on(`end`,t=>{let n=null;if(e.mtime&&!this.noMtime){let t=e.atime||new Date,r=e.mtime;try{b.default.futimesSync(i,t,r)}catch(i){try{b.default.utimesSync(e.absolute,t,r)}catch{n=i}}}if(this[ba](e)){let t=this[xa](e),r=this[Sa](e);try{b.default.fchownSync(i,t,r)}catch(i){try{b.default.chownSync(e.absolute,t,r)}catch{n||=i}}}r(n)})}[sa](e,t){let n=e.mode&4095||this.dmode,r=this[pa](e.absolute,n);if(r)return this[q](r,e);if(e.mtime&&!this.noMtime)try{b.default.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[ba](e))try{b.default.chownSync(e.absolute,this[xa](e),this[Sa](e))}catch{}e.resume()}[pa](e,t){try{return Ui.sync(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(e){return e}}[ca](e,t,n,r){try{b.default[n+`Sync`](t,e.absolute),e.resume()}catch(t){return this[q](t,e)}}};var Oa=Da,ka=(e,t,n)=>{typeof e==`function`?(n=e,t=null,e={}):Array.isArray(e)&&(t=e,e={}),typeof t==`function`&&(n=t,t=null),t=t?Array.from(t):[];let r=me(e);if(r.sync&&typeof n==`function`)throw TypeError(`callback not supported for sync tar functions`);if(!r.file&&typeof n==`function`)throw TypeError(`callback only supported with file option`);return t.length&&Aa(r,t),r.file&&r.sync?ja(r):r.file?Ma(r,n):r.sync?Na(r):Pa(r)};let Aa=(e,t)=>{let n=new Map(t.map(e=>[e.replace(/\/+$/,``),!0])),r=e.filter,i=(e,t)=>{let r=t||x.default.parse(e).root||`.`,a=e===r?!1:n.has(e)?n.get(e):i(x.default.dirname(e),r);return n.set(e,a),a};e.filter=r?(e,t)=>r(e,t)&&i(e.replace(/\/+$/,``)):e=>i(e.replace(/\/+$/,``))},ja=e=>{let t=new Oa.Sync(e),n=e.file,r=b.default.statSync(n),i=e.maxReadSize||16*1024*1024;new Qn.ReadStreamSync(n,{readSize:i,size:r.size}).pipe(t)},Ma=(e,t)=>{let n=new Oa(e),r=e.maxReadSize||16*1024*1024,i=e.file,a=new Promise((e,t)=>{n.on(`error`,t),n.on(`close`,e),b.default.stat(i,(e,a)=>{if(e)t(e);else{let e=new Qn.ReadStream(i,{readSize:r,size:a.size});e.on(`error`,t),e.pipe(n)}})});return t?a.then(t,t):a},Na=e=>new Oa.Sync(e),Pa=e=>new Oa(e);var Fa=fe(function(e,t){t.c=t.create=Nr,t.r=t.replace=Br,t.t=t.list=Dr,t.u=t.update=Kr,t.x=t.extract=ka,t.Pack=xn,t.Unpack=Oa,t.Parse=Er,t.ReadEntry=We,t.WriteEntry=Xt,t.Header=yt,t.Pax=L,t.types=Ge}),Ia={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};let La={};for(let e of Object.keys(Ia))La[Ia[e]]=e;let J={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},lch:{channels:3,labels:`lch`},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}};var Ra=J;for(let e of Object.keys(J)){if(!(`channels`in J[e]))throw Error(`missing channels property: `+e);if(!(`labels`in J[e]))throw Error(`missing channel labels property: `+e);if(J[e].labels.length!==J[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=J[e];delete J[e].channels,delete J[e].labels,Object.defineProperty(J[e],`channels`,{value:t}),Object.defineProperty(J[e],`labels`,{value:n})}J.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},J.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[i*360,a*100,l*100]},J.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=J.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,a*100,r*100]},J.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function za(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}J.rgb.keyword=function(e){let t=La[e];if(t)return t;let n=1/0,r;for(let t of Object.keys(Ia)){let i=Ia[t],a=za(e,i);a<n&&(n=a,r=t)}return r},J.keyword.rgb=function(e){return Ia[e]},J.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]},J.rgb.lab=function(e){let t=J.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(n-r),200*(r-i)]},J.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=r*255,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+(i-s)*6*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=o*255;return c},J.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},J.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},J.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},J.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},J.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},J.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]},J.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},J.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},J.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},J.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},J.rgb.ansi16=function(e,t=null){let[n,r,i]=e,a=t===null?J.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(o+=60),o},J.hsv.ansi16=function(e){return J.rgb.ansi16(J.hsv.rgb(e),e[2])},J.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},J.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},J.ansi256.rgb=function(e){if(e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},J.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.substring(t.length)+t},J.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split(``).map(e=>e+e).join(``));let r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},J.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[c*360,o*100,s*100]},J.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},J.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},J.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},J.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},J.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},J.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},J.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},J.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},J.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},J.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},J.gray.hsl=function(e){return[0,0,e[0]]},J.gray.hsv=J.gray.hsl,J.gray.hwb=function(e){return[0,100,e[0]]},J.gray.cmyk=function(e){return[0,0,0,e[0]]},J.gray.lab=function(e){return[e[0],0,0]},J.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},J.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function Ba(){let e={},t=Object.keys(Ra);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function Va(e){let t=Ba(),n=[e];for(t[e].distance=0;n.length;){let e=n.pop(),r=Object.keys(Ra[e]);for(let i=r.length,a=0;a<i;a++){let i=r[a],o=t[i];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(i))}}return t}function Ha(e,t){return function(n){return t(e(n))}}function Ua(e,t){let n=[t[e].parent,e],r=Ra[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=Ha(Ra[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}var Wa=function(e){let t=Va(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=Ua(e,t))}return n};let Ga={},Ka=Object.keys(Ra);function qa(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function Ja(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}Ka.forEach(e=>{Ga[e]={},Object.defineProperty(Ga[e],`channels`,{value:Ra[e].channels}),Object.defineProperty(Ga[e],`labels`,{value:Ra[e].labels});let t=Wa(e);Object.keys(t).forEach(n=>{let r=t[n];Ga[e][n]=Ja(r),Ga[e][n].raw=qa(r)})});var Ya=Ga,Xa=fe(function(e){let t=(e,t)=>(...n)=>`\u001B[${e(...n)+t}m`,n=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};5;${r}m`},r=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},i=e=>e,a=(e,t,n)=>[e,t,n],o=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{let r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},s,c=(e,t,n,r)=>{s===void 0&&(s=Ya);let i=r?10:0,a={};for(let[r,o]of Object.entries(s)){let s=r===`ansi16`?`ansi`:r;r===t?a[s]=e(n,i):typeof o==`object`&&(a[s]=e(o[t],i))}return a};function l(){let e=new Map,s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.gray=s.color.blackBright,s.bgColor.bgGray=s.bgColor.bgBlackBright,s.color.grey=s.color.blackBright,s.bgColor.bgGrey=s.bgColor.bgBlackBright;for(let[t,n]of Object.entries(s)){for(let[t,r]of Object.entries(n))s[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=s[t],e.set(r[0],r[1]);Object.defineProperty(s,t,{value:n,enumerable:!1})}return Object.defineProperty(s,`codes`,{value:e,enumerable:!1}),s.color.close=`\x1B[39m`,s.bgColor.close=`\x1B[49m`,o(s.color,`ansi`,()=>c(t,`ansi16`,i,!1)),o(s.color,`ansi256`,()=>c(n,`ansi256`,i,!1)),o(s.color,`ansi16m`,()=>c(r,`rgb`,a,!1)),o(s.bgColor,`ansi`,()=>c(t,`ansi16`,i,!0)),o(s.bgColor,`ansi256`,()=>c(n,`ansi256`,i,!0)),o(s.bgColor,`ansi16m`,()=>c(r,`rgb`,a,!0)),s}Object.defineProperty(e,`exports`,{enumerable:!0,get:l})}),Za=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)};let{env:Y}=process,Qa;Za(`no-color`)||Za(`no-colors`)||Za(`color=false`)||Za(`color=never`)?Qa=0:(Za(`color`)||Za(`colors`)||Za(`color=true`)||Za(`color=always`))&&(Qa=1),`FORCE_COLOR`in Y&&(Qa=Y.FORCE_COLOR===`true`?1:Y.FORCE_COLOR===`false`?0:Y.FORCE_COLOR.length===0?1:Math.min(parseInt(Y.FORCE_COLOR,10),3));function $a(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function eo(e,t){if(Qa===0)return 0;if(Za(`color=16m`)||Za(`color=full`)||Za(`color=truecolor`))return 3;if(Za(`color=256`))return 2;if(e&&!t&&Qa===void 0)return 0;let n=Qa||0;if(Y.TERM===`dumb`)return n;if(process.platform===`win32`){let e=re.default.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in Y)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in Y)||Y.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in Y)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Y.TEAMCITY_VERSION)?1:0;if(Y.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in Y){let e=parseInt((Y.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(Y.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(Y.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Y.TERM)||`COLORTERM`in Y?1:n}function to(e){return $a(eo(e,e&&e.isTTY))}var no={supportsColor:to,stdout:$a(eo(!0,ie.default.isatty(1))),stderr:$a(eo(!0,ie.default.isatty(2)))},ro={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.substr(a,r-a)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.substr(a),o},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.substr(i,(o?r-1:r)-i)+t+(o?`\r
|
|
22
|
+
`).reduce(Ct,Object.create(null)),Ct=(e,t)=>{let n=parseInt(t,10);if(n!==Buffer.byteLength(t)+1)return e;t=t.substr((n+` `).length);let r=t.split(`=`),i=r.shift().replace(/^SCHILY\.(dev|ino|nlink)/,`$1`);if(!i)return e;let a=r.join(`=`);return e[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(a*1e3):/^[0-9]+$/.test(a)?+a:a,e};var L=bt,wt=e=>class extends e{warn(e,t,n={}){this.file&&(n.file=this.file),this.cwd&&(n.cwd=this.cwd),n.code=t instanceof Error&&t.code||e,n.tarCode=e,!this.strict&&n.recoverable!==!1?(t instanceof Error&&(n=Object.assign(t,n),t=t.message),this.emit(`warn`,n.tarCode,t,n)):t instanceof Error?this.emit(`error`,Object.assign(t,n)):this.emit(`error`,Object.assign(Error(`${e}: ${t}`),n))}};let Tt=[`|`,`<`,`>`,`?`,`:`],Et=Tt.map(e=>String.fromCharCode(61440+e.charCodeAt(0))),Dt=new Map(Tt.map((e,t)=>[e,Et[t]])),Ot=new Map(Et.map((e,t)=>[e,Tt[t]]));var kt={encode:e=>Tt.reduce((e,t)=>e.split(t).join(Dt.get(t)),e),decode:e=>Et.reduce((e,t)=>e.split(t).join(Ot.get(t)),e)},At=(e,t,n)=>(e&=4095,n&&(e=(e|384)&-19),t&&(e&256&&(e|=64),e&32&&(e|=8),e&4&&(e|=1)),e);let jt=Symbol(`process`),Mt=Symbol(`file`),Nt=Symbol(`directory`),Pt=Symbol(`symlink`),Ft=Symbol(`hardlink`),It=Symbol(`header`),Lt=Symbol(`read`),Rt=Symbol(`lstat`),zt=Symbol(`onlstat`),Bt=Symbol(`onread`),Vt=Symbol(`onreadlink`),Ht=Symbol(`openfile`),Ut=Symbol(`onopenfile`),Wt=Symbol(`close`),Gt=Symbol(`mode`),Kt=wt(class extends Be{constructor(e,t){if(t||={},super(t),typeof e!=`string`)throw TypeError(`path is required`);this.path=e,this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid(),this.myuser=process.env.USER||``,this.maxReadSize=t.maxReadSize||16777216,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=t.cwd||process.cwd(),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,typeof t.onwarn==`function`&&this.on(`warn`,t.onwarn);let n=!1;if(!this.preservePaths&&x.default.win32.isAbsolute(e)){let t=x.default.win32.parse(e);this.path=e.substr(t.root.length),n=t.root}this.win32=!!t.win32||process.platform===`win32`,this.win32&&(this.path=kt.decode(this.path.replace(/\\/g,`/`)),e=e.replace(/\\/g,`/`)),this.absolute=t.absolute||x.default.resolve(this.cwd,e),this.path===``&&(this.path=`./`),n&&this.warn(`TAR_ENTRY_INFO`,`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.statCache.has(this.absolute)?this[zt](this.statCache.get(this.absolute)):this[Rt]()}[Rt](){b.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit(`error`,e);this[zt](t)})}[zt](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Yt(e),this.emit(`stat`,e),this[jt]()}[jt](){switch(this.type){case`File`:return this[Mt]();case`Directory`:return this[Nt]();case`SymbolicLink`:return this[Pt]();default:return this.end()}}[Gt](e){return At(e,this.type===`Directory`,this.portable)}[It](){this.type===`Directory`&&this.portable&&(this.noMtime=!0),this.header=new yt({path:this.path,linkpath:this.linkpath,mode:this[Gt](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:``,atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&this.write(new L({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),this.write(this.header.block)}[Nt](){this.path.substr(-1)!==`/`&&(this.path+=`/`),this.stat.size=0,this[It](),this.end()}[Pt](){b.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit(`error`,e);this[Vt](t)})}[Vt](e){this.linkpath=e.replace(/\\/g,`/`),this[It](),this.end()}[Ft](e){this.type=`Link`,this.linkpath=x.default.relative(this.cwd,e).replace(/\\/g,`/`),this.stat.size=0,this[It](),this.end()}[Mt](){if(this.stat.nlink>1){let e=this.stat.dev+`:`+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[Ft](t)}this.linkCache.set(e,this.absolute)}if(this[It](),this.stat.size===0)return this.end();this[Ht]()}[Ht](){b.default.open(this.absolute,`r`,(e,t)=>{if(e)return this.emit(`error`,e);this[Ut](t)})}[Ut](e){let t=512*Math.ceil(this.stat.size/512),n=Math.min(t,this.maxReadSize),r=Buffer.allocUnsafe(n);this[Lt](e,r,0,r.length,0,this.stat.size,t)}[Lt](e,t,n,r,i,a,o){b.default.read(e,t,n,r,i,(s,c)=>{if(s)return this[Wt](e,()=>this.emit(`error`,s));this[Bt](e,t,n,r,i,a,o,c)})}[Wt](e,t){b.default.close(e,t)}[Bt](e,t,n,r,i,a,o,s){if(s<=0&&a>0){let t=Error(`encountered unexpected EOF`);return t.path=this.absolute,t.syscall=`read`,t.code=`EOF`,this[Wt](e,()=>this.emit(`error`,t))}if(s>a){let t=Error(`did not encounter expected EOF`);return t.path=this.absolute,t.syscall=`read`,t.code=`EOF`,this[Wt](e,()=>this.emit(`error`,t))}if(s===a)for(let e=s;e<r&&s<o;e++)t[e+n]=0,s++,a++;let c=n===0&&s===t.length?t:t.slice(n,n+s);if(a-=s,o-=s,i+=s,n+=s,this.write(c),!a)return o&&this.write(Buffer.alloc(o)),this[Wt](e,e=>e?this.emit(`error`,e):this.end());n>=r&&(t=Buffer.allocUnsafe(r),n=0),r=t.length-n,this[Lt](e,t,n,r,i,a,o)}});var qt=class extends Kt{[Rt](){this[zt](b.default.lstatSync(this.absolute))}[Pt](){this[Vt](b.default.readlinkSync(this.absolute))}[Ht](){this[Ut](b.default.openSync(this.absolute,`r`))}[Lt](e,t,n,r,i,a,o){let s=!0;try{let c=b.default.readSync(e,t,n,r,i);this[Bt](e,t,n,r,i,a,o,c),s=!1}finally{if(s)try{this[Wt](e,()=>{})}catch{}}}[Wt](e,t){b.default.closeSync(e),t()}};let Jt=wt(class extends Be{constructor(e,t){t||={},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type===`Directory`&&this.portable&&(this.noMtime=!0),this.path=e.path,this.mode=this[Gt](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=e.linkpath,typeof t.onwarn==`function`&&this.on(`warn`,t.onwarn);let n=!1;if(x.default.isAbsolute(this.path)&&!this.preservePaths){let e=x.default.parse(this.path);n=e.root,this.path=this.path.substr(e.root.length)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new yt({path:this.path,linkpath:this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),n&&this.warn(`TAR_ENTRY_INFO`,`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new L({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this.path,linkpath:this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[Gt](e){return At(e,this.type===`Directory`,this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw Error(`writing more to entry than is appropriate`);return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&this.write(Buffer.alloc(this.blockRemain)),super.end()}});Kt.Sync=qt,Kt.Tar=Jt;let Yt=e=>e.isFile()?`File`:e.isDirectory()?`Directory`:e.isSymbolicLink()?`SymbolicLink`:`Unsupported`;var Xt=Kt,Zt=class{constructor(e,t){this.path=e||`./`,this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}};let Qt=Xt.Sync,$t=Xt.Tar,en=Buffer.alloc(1024),tn=Symbol(`onStat`),R=Symbol(`ended`),nn=Symbol(`queue`),rn=Symbol(`current`),an=Symbol(`process`),on=Symbol(`processing`),sn=Symbol(`processJob`),z=Symbol(`jobs`),cn=Symbol(`jobDone`),ln=Symbol(`addFSEntry`),un=Symbol(`addTarEntry`),dn=Symbol(`stat`),fn=Symbol(`readdir`),pn=Symbol(`onreaddir`),mn=Symbol(`pipe`),hn=Symbol(`entry`),gn=Symbol(`entryOpt`),_n=Symbol(`writeEntryClass`),vn=Symbol(`write`),yn=Symbol(`ondrain`),bn=wt(class extends Be{constructor(e){super(e),e||=Object.create(null),this.opt=e,this.file=e.file||``,this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(e.prefix||``).replace(/(\\|\/)+$/,``),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[_n]=Xt,typeof e.onwarn==`function`&&this.on(`warn`,e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!=`object`&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new He.Gzip(e.gzip),this.zip.on(`data`,e=>super.write(e)),this.zip.on(`end`,e=>super.end()),this.zip.on(`drain`,e=>this[yn]()),this.on(`resume`,e=>this.zip.resume())):this.on(`drain`,this[yn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter==`function`?e.filter:e=>!0,this[nn]=new ge,this[z]=0,this.jobs=+e.jobs||4,this[on]=!1,this[R]=!1}[vn](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[R]=!0,this[an](),this}write(e){if(this[R])throw Error(`write after end`);return e instanceof We?this[un](e):this[ln](e),this.flowing}[un](e){let t=x.default.resolve(this.cwd,e.path);if(this.prefix&&(e.path=this.prefix+`/`+e.path.replace(/^\.(\/+|$)/,``)),!this.filter(e.path,e))e.resume();else{let n=new Zt(e.path,t,!1);n.entry=new $t(e,this[gn](n)),n.entry.on(`end`,e=>this[cn](n)),this[z]+=1,this[nn].push(n)}this[an]()}[ln](e){let t=x.default.resolve(this.cwd,e);this.prefix&&(e=this.prefix+`/`+e.replace(/^\.(\/+|$)/,``)),this[nn].push(new Zt(e,t)),this[an]()}[dn](e){e.pending=!0,this[z]+=1;let t=this.follow?`stat`:`lstat`;b.default[t](e.absolute,(t,n)=>{e.pending=!1,--this[z],t?this.emit(`error`,t):this[tn](e,n)})}[tn](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[an]()}[fn](e){e.pending=!0,this[z]+=1,b.default.readdir(e.absolute,(t,n)=>{if(e.pending=!1,--this[z],t)return this.emit(`error`,t);this[pn](e,n)})}[pn](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[an]()}[an](){if(!this[on]){this[on]=!0;for(let e=this[nn].head;e!==null&&this[z]<this.jobs;e=e.next)if(this[sn](e.value),e.value.ignore){let t=e.next;this[nn].removeNode(e),e.next=t}this[on]=!1,this[R]&&!this[nn].length&&this[z]===0&&(this.zip?this.zip.end(en):(super.write(en),super.end()))}}get[rn](){return this[nn]&&this[nn].head&&this[nn].head.value}[cn](e){this[nn].shift(),--this[z],this[an]()}[sn](e){if(!e.pending){if(e.entry){e===this[rn]&&!e.piped&&this[mn](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[tn](e,this.statCache.get(e.absolute)):this[dn](e)),e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[pn](e,this.readdirCache.get(e.absolute)):this[fn](e),!e.readdir))){if(e.entry=this[hn](e),!e.entry){e.ignore=!0;return}e===this[rn]&&!e.piped&&this[mn](e)}}}[gn](e){return{onwarn:(e,t,n)=>this.warn(e,t,n),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime}}[hn](e){this[z]+=1;try{return new this[_n](e.path,this[gn](e)).on(`end`,()=>this[cn](e)).on(`error`,e=>this.emit(`error`,e))}catch(e){this.emit(`error`,e)}}[yn](){this[rn]&&this[rn].entry&&this[rn].entry.resume()}[mn](e){e.piped=!0,e.readdir&&e.readdir.forEach(t=>{let n=this.prefix?e.path.slice(this.prefix.length+1)||`./`:e.path,r=n===`./`?``:n.replace(/\/*$/,`/`);this[ln](r+t)});let t=e.entry,n=this.zip;n?t.on(`data`,e=>{n.write(e)||t.pause()}):t.on(`data`,e=>{super.write(e)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}});bn.Sync=class extends bn{constructor(e){super(e),this[_n]=Qt}pause(){}resume(){}[dn](e){let t=this.follow?`statSync`:`lstatSync`;this[tn](e,b.default[t](e.absolute))}[fn](e,t){this[pn](e,b.default.readdirSync(e.absolute))}[mn](e){let t=e.entry,n=this.zip;e.readdir&&e.readdir.forEach(t=>{let n=this.prefix?e.path.slice(this.prefix.length+1)||`./`:e.path,r=n===`./`?``:n.replace(/\/*$/,`/`);this[ln](r+t)}),n?t.on(`data`,e=>{n.write(e)}):t.on(`data`,e=>{super[vn](e)})}};var xn=bn;let Sn=S.default.EventEmitter,Cn=b.default.writev;if(!Cn){let e=process.binding(`fs`),t=e.FSReqWrap||e.FSReqCallback;Cn=(n,r,i,a)=>{let o=(e,t)=>a(e,t,r),s=new t;s.oncomplete=o,e.writeBuffers(n,r,i,s)}}let wn=Symbol(`_autoClose`),B=Symbol(`_close`),Tn=Symbol(`_ended`),V=Symbol(`_fd`),En=Symbol(`_finished`),Dn=Symbol(`_flags`),On=Symbol(`_flush`),kn=Symbol(`_handleChunk`),An=Symbol(`_makeBuf`),jn=Symbol(`_mode`),Mn=Symbol(`_needDrain`),Nn=Symbol(`_onerror`),Pn=Symbol(`_onopen`),Fn=Symbol(`_onread`),In=Symbol(`_onwrite`),Ln=Symbol(`_open`),Rn=Symbol(`_path`),zn=Symbol(`_pos`),H=Symbol(`_queue`),Bn=Symbol(`_read`),Vn=Symbol(`_readSize`),Hn=Symbol(`_reading`),Un=Symbol(`_remain`),Wn=Symbol(`_size`),Gn=Symbol(`_write`),Kn=Symbol(`_writing`),qn=Symbol(`_defaultFlag`),Jn=Symbol(`_errored`);var Yn=class extends Be{constructor(e,t){if(t||={},super(t),this.readable=!0,this.writable=!1,typeof e!=`string`)throw TypeError(`path must be a string`);this[Jn]=!1,this[V]=typeof t.fd==`number`?t.fd:null,this[Rn]=e,this[Vn]=t.readSize||16*1024*1024,this[Hn]=!1,this[Wn]=typeof t.size==`number`?t.size:1/0,this[Un]=this[Wn],this[wn]=typeof t.autoClose==`boolean`?t.autoClose:!0,typeof this[V]==`number`?this[Bn]():this[Ln]()}get fd(){return this[V]}get path(){return this[Rn]}write(){throw TypeError(`this is a readable stream`)}end(){throw TypeError(`this is a readable stream`)}[Ln](){b.default.open(this[Rn],`r`,(e,t)=>this[Pn](e,t))}[Pn](e,t){e?this[Nn](e):(this[V]=t,this.emit(`open`,t),this[Bn]())}[An](){return Buffer.allocUnsafe(Math.min(this[Vn],this[Un]))}[Bn](){if(!this[Hn]){this[Hn]=!0;let e=this[An]();if(e.length===0)return process.nextTick(()=>this[Fn](null,0,e));b.default.read(this[V],e,0,e.length,null,(e,t,n)=>this[Fn](e,t,n))}}[Fn](e,t,n){this[Hn]=!1,e?this[Nn](e):this[kn](t,n)&&this[Bn]()}[B](){if(this[wn]&&typeof this[V]==`number`){let e=this[V];this[V]=null,b.default.close(e,e=>e?this.emit(`error`,e):this.emit(`close`))}}[Nn](e){this[Hn]=!0,this[B](),this.emit(`error`,e)}[kn](e,t){let n=!1;return this[Un]-=e,e>0&&(n=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[Un]<=0)&&(n=!1,this[B](),super.end()),n}emit(e,t){switch(e){case`prefinish`:case`finish`:break;case`drain`:typeof this[V]==`number`&&this[Bn]();break;case`error`:return this[Jn]?void 0:(this[Jn]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Xn=class extends Yn{[Ln](){let e=!0;try{this[Pn](null,b.default.openSync(this[Rn],`r`)),e=!1}finally{e&&this[B]()}}[Bn](){let e=!0;try{if(!this[Hn]){this[Hn]=!0;do{let e=this[An](),t=e.length===0?0:b.default.readSync(this[V],e,0,e.length,null);if(!this[kn](t,e))break}while(!0);this[Hn]=!1}e=!1}finally{e&&this[B]()}}[B](){if(this[wn]&&typeof this[V]==`number`){let e=this[V];this[V]=null,b.default.closeSync(e),this.emit(`close`)}}},Zn=class extends Sn{constructor(e,t){t||={},super(t),this.readable=!1,this.writable=!0,this[Jn]=!1,this[Kn]=!1,this[Tn]=!1,this[Mn]=!1,this[H]=[],this[Rn]=e,this[V]=typeof t.fd==`number`?t.fd:null,this[jn]=t.mode===void 0?438:t.mode,this[zn]=typeof t.start==`number`?t.start:null,this[wn]=typeof t.autoClose==`boolean`?t.autoClose:!0;let n=this[zn]===null?`w`:`r+`;this[qn]=t.flags===void 0,this[Dn]=this[qn]?n:t.flags,this[V]===null&&this[Ln]()}emit(e,t){if(e===`error`){if(this[Jn])return;this[Jn]=!0}return super.emit(e,t)}get fd(){return this[V]}get path(){return this[Rn]}[Nn](e){this[B](),this[Kn]=!0,this.emit(`error`,e)}[Ln](){b.default.open(this[Rn],this[Dn],this[jn],(e,t)=>this[Pn](e,t))}[Pn](e,t){this[qn]&&this[Dn]===`r+`&&e&&e.code===`ENOENT`?(this[Dn]=`w`,this[Ln]()):e?this[Nn](e):(this[V]=t,this.emit(`open`,t),this[On]())}end(e,t){return e&&this.write(e,t),this[Tn]=!0,!this[Kn]&&!this[H].length&&typeof this[V]==`number`&&this[In](null,0),this}write(e,t){return typeof e==`string`&&(e=Buffer.from(e,t)),this[Tn]?(this.emit(`error`,Error(`write() after end()`)),!1):this[V]===null||this[Kn]||this[H].length?(this[H].push(e),this[Mn]=!0,!1):(this[Kn]=!0,this[Gn](e),!0)}[Gn](e){b.default.write(this[V],e,0,e.length,this[zn],(e,t)=>this[In](e,t))}[In](e,t){e?this[Nn](e):(this[zn]!==null&&(this[zn]+=t),this[H].length?this[On]():(this[Kn]=!1,this[Tn]&&!this[En]?(this[En]=!0,this[B](),this.emit(`finish`)):this[Mn]&&(this[Mn]=!1,this.emit(`drain`))))}[On](){if(this[H].length===0)this[Tn]&&this[In](null,0);else if(this[H].length===1)this[Gn](this[H].pop());else{let e=this[H];this[H]=[],Cn(this[V],e,this[zn],(e,t)=>this[In](e,t))}}[B](){if(this[wn]&&typeof this[V]==`number`){let e=this[V];this[V]=null,b.default.close(e,e=>e?this.emit(`error`,e):this.emit(`close`))}}},Qn={ReadStream:Yn,ReadStreamSync:Xn,WriteStream:Zn,WriteStreamSync:class extends Zn{[Ln](){let e;if(this[qn]&&this[Dn]===`r+`)try{e=b.default.openSync(this[Rn],this[Dn],this[jn])}catch(e){if(e.code===`ENOENT`)return this[Dn]=`w`,this[Ln]();throw e}else e=b.default.openSync(this[Rn],this[Dn],this[jn]);this[Pn](null,e)}[B](){if(this[wn]&&typeof this[V]==`number`){let e=this[V];this[V]=null,b.default.closeSync(e),this.emit(`close`)}}[Gn](e){let t=!0;try{this[In](null,b.default.writeSync(this[V],e,0,e.length,this[zn])),t=!1}finally{if(t)try{this[B]()}catch{}}}}};let $n=Buffer.from([31,139]),er=Symbol(`state`),tr=Symbol(`writeEntry`),U=Symbol(`readEntry`),nr=Symbol(`nextEntry`),rr=Symbol(`processEntry`),W=Symbol(`extendedHeader`),ir=Symbol(`globalExtendedHeader`),ar=Symbol(`meta`),or=Symbol(`emitMeta`),G=Symbol(`buffer`),sr=Symbol(`queue`),cr=Symbol(`ended`),lr=Symbol(`emittedEnd`),ur=Symbol(`emit`),K=Symbol(`unzip`),dr=Symbol(`consumeChunk`),fr=Symbol(`consumeChunkSub`),pr=Symbol(`consumeBody`),mr=Symbol(`consumeMeta`),hr=Symbol(`consumeHeader`),gr=Symbol(`consuming`),_r=Symbol(`bufferConcat`),vr=Symbol(`maybeEnd`),yr=Symbol(`writing`),br=Symbol(`aborted`),xr=Symbol(`onDone`),Sr=Symbol(`sawValidEntry`),Cr=Symbol(`sawNullBlock`),wr=Symbol(`sawEOF`),Tr=e=>!0;var Er=wt(class extends S.default{constructor(e){e||={},super(e),this.file=e.file||``,this[Sr]=null,this.on(xr,e=>{(this[er]===`begin`||this[Sr]===!1)&&this.warn(`TAR_BAD_ARCHIVE`,`Unrecognized archive format`)}),e.ondone?this.on(xr,e.ondone):this.on(xr,e=>{this.emit(`prefinish`),this.emit(`finish`),this.emit(`end`),this.emit(`close`)}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||1048576,this.filter=typeof e.filter==`function`?e.filter:Tr,this.writable=!0,this.readable=!1,this[sr]=new ge,this[G]=null,this[U]=null,this[tr]=null,this[er]=`begin`,this[ar]=``,this[W]=null,this[ir]=null,this[cr]=!1,this[K]=null,this[br]=!1,this[Cr]=!1,this[wr]=!1,typeof e.onwarn==`function`&&this.on(`warn`,e.onwarn),typeof e.onentry==`function`&&this.on(`entry`,e.onentry)}[hr](e,t){this[Sr]===null&&(this[Sr]=!1);let n;try{n=new yt(e,t,this[W],this[ir])}catch(e){return this.warn(`TAR_ENTRY_INVALID`,e)}if(n.nullBlock)this[Cr]?(this[wr]=!0,this[er]===`begin`&&(this[er]=`header`),this[ur](`eof`)):(this[Cr]=!0,this[ur](`nullBlock`));else if(this[Cr]=!1,!n.cksumValid)this.warn(`TAR_ENTRY_INVALID`,`checksum failure`,{header:n});else if(!n.path)this.warn(`TAR_ENTRY_INVALID`,`path is required`,{header:n});else{let e=n.type;if(/^(Symbolic)?Link$/.test(e)&&!n.linkpath)this.warn(`TAR_ENTRY_INVALID`,`linkpath required`,{header:n});else if(!/^(Symbolic)?Link$/.test(e)&&n.linkpath)this.warn(`TAR_ENTRY_INVALID`,`linkpath forbidden`,{header:n});else{let e=this[tr]=new We(n,this[W],this[ir]);this[Sr]||(e.remain?e.on(`end`,()=>{e.invalid||(this[Sr]=!0)}):this[Sr]=!0),e.meta?e.size>this.maxMetaEntrySize?(e.ignore=!0,this[ur](`ignoredEntry`,e),this[er]=`ignore`,e.resume()):e.size>0&&(this[ar]=``,e.on(`data`,e=>this[ar]+=e),this[er]=`meta`):(this[W]=null,e.ignore=e.ignore||!this.filter(e.path,e),e.ignore?(this[ur](`ignoredEntry`,e),this[er]=e.remain?`ignore`:`header`,e.resume()):(e.remain?this[er]=`body`:(this[er]=`header`,e.end()),this[U]?this[sr].push(e):(this[sr].push(e),this[nr]())))}}}[rr](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[U]=e,this.emit(`entry`,e),e.emittedEnd||(e.on(`end`,e=>this[nr]()),t=!1)):(this[U]=null,t=!1),t}[nr](){do;while(this[rr](this[sr].shift()));if(!this[sr].length){let e=this[U];!e||e.flowing||e.size===e.remain?this[yr]||this.emit(`drain`):e.once(`drain`,e=>this.emit(`drain`))}}[pr](e,t){let n=this[tr],r=n.blockRemain,i=r>=e.length&&t===0?e:e.slice(t,t+r);return n.write(i),n.blockRemain||(this[er]=`header`,this[tr]=null,n.end()),i.length}[mr](e,t){let n=this[tr],r=this[pr](e,t);return this[tr]||this[or](n),r}[ur](e,t,n){!this[sr].length&&!this[U]?this.emit(e,t,n):this[sr].push([e,t,n])}[or](e){switch(this[ur](`meta`,this[ar]),e.type){case`ExtendedHeader`:case`OldExtendedHeader`:this[W]=L.parse(this[ar],this[W],!1);break;case`GlobalExtendedHeader`:this[ir]=L.parse(this[ar],this[ir],!0);break;case`NextFileHasLongPath`:case`OldGnuLongPath`:this[W]=this[W]||Object.create(null),this[W].path=this[ar].replace(/\0.*/,``);break;case`NextFileHasLongLinkpath`:this[W]=this[W]||Object.create(null),this[W].linkpath=this[ar].replace(/\0.*/,``);break;default:throw Error(`unknown meta: `+e.type)}}abort(e){this[br]=!0,this.emit(`abort`,e),this.warn(`TAR_ABORT`,e,{recoverable:!1})}write(e){if(this[br])return;if(this[K]===null&&e){if(this[G]&&(e=Buffer.concat([this[G],e]),this[G]=null),e.length<$n.length)return this[G]=e,!0;for(let t=0;this[K]===null&&t<$n.length;t++)e[t]!==$n[t]&&(this[K]=!1);if(this[K]===null){let t=this[cr];this[cr]=!1,this[K]=new He.Unzip,this[K].on(`data`,e=>this[dr](e)),this[K].on(`error`,e=>this.abort(e)),this[K].on(`end`,e=>{this[cr]=!0,this[dr]()}),this[yr]=!0;let n=this[K][t?`end`:`write`](e);return this[yr]=!1,n}}this[yr]=!0,this[K]?this[K].write(e):this[dr](e),this[yr]=!1;let t=this[sr].length?!1:this[U]?this[U].flowing:!0;return!t&&!this[sr].length&&this[U].once(`drain`,e=>this.emit(`drain`)),t}[_r](e){e&&!this[br]&&(this[G]=this[G]?Buffer.concat([this[G],e]):e)}[vr](){if(this[cr]&&!this[lr]&&!this[br]&&!this[gr]){this[lr]=!0;let e=this[tr];if(e&&e.blockRemain){let t=this[G]?this[G].length:0;this.warn(`TAR_BAD_ARCHIVE`,`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[G]&&e.write(this[G]),e.end()}this[ur](xr)}}[dr](e){if(this[gr])this[_r](e);else if(!e&&!this[G])this[vr]();else{if(this[gr]=!0,this[G]){this[_r](e);let t=this[G];this[G]=null,this[fr](t)}else this[fr](e);for(;this[G]&&this[G].length>=512&&!this[br]&&!this[wr];){let e=this[G];this[G]=null,this[fr](e)}this[gr]=!1}(!this[G]||this[cr])&&this[vr]()}[fr](e){let t=0,n=e.length;for(;t+512<=n&&!this[br]&&!this[wr];)switch(this[er]){case`begin`:case`header`:this[hr](e,t),t+=512;break;case`ignore`:case`body`:t+=this[pr](e,t);break;case`meta`:t+=this[mr](e,t);break;default:throw Error(`invalid state: `+this[er])}t<n&&(this[G]?this[G]=Buffer.concat([e.slice(t),this[G]]):this[G]=e.slice(t))}end(e){this[br]||(this[K]?this[K].end(e):(this[cr]=!0,this.write(e)))}}),Dr=(e,t,n)=>{typeof e==`function`?(n=e,t=null,e={}):Array.isArray(e)&&(t=e,e={}),typeof t==`function`&&(n=t,t=null),t=t?Array.from(t):[];let r=me(e);if(r.sync&&typeof n==`function`)throw TypeError(`callback not supported for sync tar functions`);if(!r.file&&typeof n==`function`)throw TypeError(`callback only supported with file option`);return t.length&&kr(r,t),r.noResume||Or(r),r.file&&r.sync?Ar(r):r.file?jr(r,n):Mr(r)};let Or=e=>{let t=e.onentry;e.onentry=t?e=>{t(e),e.resume()}:e=>e.resume()},kr=(e,t)=>{let n=new Map(t.map(e=>[e.replace(/\/+$/,``),!0])),r=e.filter,i=(e,t)=>{let r=t||x.default.parse(e).root||`.`,a=e===r?!1:n.has(e)?n.get(e):i(x.default.dirname(e),r);return n.set(e,a),a};e.filter=r?(e,t)=>r(e,t)&&i(e.replace(/\/+$/,``)):e=>i(e.replace(/\/+$/,``))},Ar=e=>{let t=Mr(e),n=e.file,r=!0,i;try{let a=b.default.statSync(n),o=e.maxReadSize||16*1024*1024;if(a.size<o)t.end(b.default.readFileSync(n));else{let e=0,r=Buffer.allocUnsafe(o);for(i=b.default.openSync(n,`r`);e<a.size;){let n=b.default.readSync(i,r,0,o,e);e+=n,t.write(r.slice(0,n))}t.end()}r=!1}finally{if(r&&i)try{b.default.closeSync(i)}catch{}}},jr=(e,t)=>{let n=new Er(e),r=e.maxReadSize||16*1024*1024,i=e.file,a=new Promise((e,t)=>{n.on(`error`,t),n.on(`end`,e),b.default.stat(i,(e,a)=>{if(e)t(e);else{let e=new Qn.ReadStream(i,{readSize:r,size:a.size});e.on(`error`,t),e.pipe(n)}})});return t?a.then(t,t):a},Mr=e=>new Er(e);var Nr=(e,t,n)=>{if(typeof t==`function`&&(n=t),Array.isArray(e)&&(t=e,e={}),!t||!Array.isArray(t)||!t.length)throw TypeError(`no files or directories specified`);t=Array.from(t);let r=me(e);if(r.sync&&typeof n==`function`)throw TypeError(`callback not supported for sync tar functions`);if(!r.file&&typeof n==`function`)throw TypeError(`callback only supported with file option`);return r.file&&r.sync?Pr(r,t):r.file?Fr(r,t,n):r.sync?Rr(r,t):zr(r,t)};let Pr=(e,t)=>{let n=new xn.Sync(e),r=new Qn.WriteStreamSync(e.file,{mode:e.mode||438});n.pipe(r),Ir(n,t)},Fr=(e,t,n)=>{let r=new xn(e),i=new Qn.WriteStream(e.file,{mode:e.mode||438});r.pipe(i);let a=new Promise((e,t)=>{i.on(`error`,t),i.on(`close`,e),r.on(`error`,t)});return Lr(r,t),n?a.then(n,n):a},Ir=(e,t)=>{t.forEach(t=>{t.charAt(0)===`@`?Dr({file:x.default.resolve(e.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:t=>e.add(t)}):e.add(t)}),e.end()},Lr=(e,t)=>{for(;t.length;){let n=t.shift();if(n.charAt(0)===`@`)return Dr({file:x.default.resolve(e.cwd,n.substr(1)),noResume:!0,onentry:t=>e.add(t)}).then(n=>Lr(e,t));e.add(n)}e.end()},Rr=(e,t)=>{let n=new xn.Sync(e);return Ir(n,t),n},zr=(e,t)=>{let n=new xn(e);return Lr(n,t),n};var Br=(e,t,n)=>{let r=me(e);if(!r.file)throw TypeError(`file is required`);if(r.gzip)throw TypeError(`cannot append to compressed archives`);if(!t||!Array.isArray(t)||!t.length)throw TypeError(`no files or directories specified`);return t=Array.from(t),r.sync?Vr(r,t):Ur(r,t,n)};let Vr=(e,t)=>{let n=new xn.Sync(e),r=!0,i,a;try{try{i=b.default.openSync(e.file,`r+`)}catch(t){if(t.code===`ENOENT`)i=b.default.openSync(e.file,`w+`);else throw t}let o=b.default.fstatSync(i),s=Buffer.alloc(512);POSITION:for(a=0;a<o.size;a+=512){for(let e=0,t=0;e<512;e+=t){if(t=b.default.readSync(i,s,e,s.length-e,a+e),a===0&&s[0]===31&&s[1]===139)throw Error(`cannot append to compressed archives`);if(!t)break POSITION}let t=new yt(s);if(!t.cksumValid)break;let n=512*Math.ceil(t.size/512);if(a+n+512>o.size)break;a+=n,e.mtimeCache&&e.mtimeCache.set(t.path,t.mtime)}r=!1,Hr(e,n,a,i,t)}finally{if(r)try{b.default.closeSync(i)}catch{}}},Hr=(e,t,n,r,i)=>{let a=new Qn.WriteStreamSync(e.file,{fd:r,start:n});t.pipe(a),Wr(t,i)},Ur=(e,t,n)=>{t=Array.from(t);let r=new xn(e),i=(t,n,r)=>{let i=(e,n)=>{e?b.default.close(t,t=>r(e)):r(null,n)},a=0;if(n===0)return i(null,0);let o=0,s=Buffer.alloc(512),c=(r,l)=>{if(r)return i(r);if(o+=l,o<512&&l)return b.default.read(t,s,o,s.length-o,a+o,c);if(a===0&&s[0]===31&&s[1]===139)return i(Error(`cannot append to compressed archives`));if(o<512)return i(null,a);let u=new yt(s);if(!u.cksumValid)return i(null,a);let d=512*Math.ceil(u.size/512);if(a+d+512>n||(a+=d+512,a>=n))return i(null,a);e.mtimeCache&&e.mtimeCache.set(u.path,u.mtime),o=0,b.default.read(t,s,0,512,a,c)};b.default.read(t,s,0,512,a,c)},a=new Promise((n,a)=>{r.on(`error`,a);let o=`r+`,s=(c,l)=>{if(c&&c.code===`ENOENT`&&o===`r+`)return o=`w+`,b.default.open(e.file,o,s);if(c)return a(c);b.default.fstat(l,(o,s)=>{if(o)return a(o);i(l,s.size,(i,o)=>{if(i)return a(i);let s=new Qn.WriteStream(e.file,{fd:l,start:o});r.pipe(s),s.on(`error`,a),s.on(`close`,n),Gr(r,t)})})};b.default.open(e.file,o,s)});return n?a.then(n,n):a},Wr=(e,t)=>{t.forEach(t=>{t.charAt(0)===`@`?Dr({file:x.default.resolve(e.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:t=>e.add(t)}):e.add(t)}),e.end()},Gr=(e,t)=>{for(;t.length;){let n=t.shift();if(n.charAt(0)===`@`)return Dr({file:x.default.resolve(e.cwd,n.substr(1)),noResume:!0,onentry:t=>e.add(t)}).then(n=>Gr(e,t));e.add(n)}e.end()};var Kr=(e,t,n)=>{let r=me(e);if(!r.file)throw TypeError(`file is required`);if(r.gzip)throw TypeError(`cannot append to compressed archives`);if(!t||!Array.isArray(t)||!t.length)throw TypeError(`no files or directories specified`);return t=Array.from(t),qr(r),Br(r,t,n)};let qr=e=>{let t=e.filter;e.mtimeCache||=new Map,e.filter=t?(n,r)=>t(n,r)&&!(e.mtimeCache.get(n)>r.mtime):(t,n)=>!(e.mtimeCache.get(t)>n.mtime)},{promisify:Jr}=E.default;var Yr=e=>{if(!e)e={mode:511,fs:b.default};else if(typeof e==`object`)e={mode:511,fs:b.default,...e};else if(typeof e==`number`)e={mode:e,fs:b.default};else if(typeof e==`string`)e={mode:parseInt(e,8),fs:b.default};else throw TypeError(`invalid options argument`);return e.mkdir=e.mkdir||e.fs.mkdir||b.default.mkdir,e.mkdirAsync=Jr(e.mkdir),e.stat=e.stat||e.fs.stat||b.default.stat,e.statAsync=Jr(e.stat),e.statSync=e.statSync||e.fs.statSync||b.default.statSync,e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||b.default.mkdirSync,e};let Xr=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Zr,parse:Qr}=x.default;var $r=e=>{if(/\0/.test(e))throw Object.assign(TypeError(`path must be a string without null bytes`),{path:e,code:`ERR_INVALID_ARG_VALUE`});if(e=Zr(e),Xr===`win32`){let t=/[*|"<>?:]/,{root:n}=Qr(e);if(t.test(e.substr(n.length)))throw Object.assign(Error(`Illegal characters in path.`),{path:e,code:`EINVAL`})}return e};let{dirname:ei}=x.default,ti=(e,t,n=void 0)=>n===t?Promise.resolve():e.statAsync(t).then(e=>e.isDirectory()?n:void 0,n=>n.code===`ENOENT`?ti(e,ei(t),t):void 0),ni=(e,t,n=void 0)=>{if(n!==t)try{return e.statSync(t).isDirectory()?n:void 0}catch(n){return n.code===`ENOENT`?ni(e,ei(t),t):void 0}};var ri={findMade:ti,findMadeSync:ni};let{dirname:ii}=x.default,ai=(e,t,n)=>{t.recursive=!1;let r=ii(e);return r===e?t.mkdirAsync(e,t).catch(e=>{if(e.code!==`EISDIR`)throw e}):t.mkdirAsync(e,t).then(()=>n||e,i=>{if(i.code===`ENOENT`)return ai(r,t).then(n=>ai(e,t,n));if(i.code!==`EEXIST`&&i.code!==`EROFS`)throw i;return t.statAsync(e).then(e=>{if(e.isDirectory())return n;throw i},()=>{throw i})})},oi=(e,t,n)=>{let r=ii(e);if(t.recursive=!1,r===e)try{return t.mkdirSync(e,t)}catch(e){if(e.code!==`EISDIR`)throw e;return}try{return t.mkdirSync(e,t),n||e}catch(i){if(i.code===`ENOENT`)return oi(e,t,oi(r,t,n));if(i.code!==`EEXIST`&&i.code!==`EROFS`)throw i;try{if(!t.statSync(e).isDirectory())throw i}catch{throw i}}};var si={mkdirpManual:ai,mkdirpManualSync:oi};let{dirname:ci}=x.default,{findMade:li,findMadeSync:ui}=ri,{mkdirpManual:di,mkdirpManualSync:fi}=si;var pi={mkdirpNative:(e,t)=>(t.recursive=!0,ci(e)===e?t.mkdirAsync(e,t):li(t,e).then(n=>t.mkdirAsync(e,t).then(()=>n).catch(n=>{if(n.code===`ENOENT`)return di(e,t);throw n}))),mkdirpNativeSync:(e,t)=>{if(t.recursive=!0,ci(e)===e)return t.mkdirSync(e,t);let n=ui(t,e);try{return t.mkdirSync(e,t),n}catch(n){if(n.code===`ENOENT`)return fi(e,t);throw n}}};let mi=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,``).split(`.`),hi=+mi[0]>10||+mi[0]==10&&+mi[1]>=12;var gi={useNative:hi?e=>e.mkdir===b.default.mkdir:()=>!1,useNativeSync:hi?e=>e.mkdirSync===b.default.mkdirSync:()=>!1};let{mkdirpNative:_i,mkdirpNativeSync:vi}=pi,{mkdirpManual:yi,mkdirpManualSync:bi}=si,{useNative:xi,useNativeSync:Si}=gi,Ci=(e,t)=>(e=$r(e),t=Yr(t),xi(t)?_i(e,t):yi(e,t));Ci.sync=(e,t)=>(e=$r(e),t=Yr(t),Si(t)?vi(e,t):bi(e,t)),Ci.native=(e,t)=>_i($r(e),Yr(t)),Ci.manual=(e,t)=>yi($r(e),Yr(t)),Ci.nativeSync=(e,t)=>vi($r(e),Yr(t)),Ci.manualSync=(e,t)=>bi($r(e),Yr(t));var wi=Ci;let Ti=b.default.lchown?`lchown`:`chown`,Ei=b.default.lchownSync?`lchownSync`:`chownSync`,Di=b.default.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Oi=(e,t,n)=>{try{return b.default[Ei](e,t,n)}catch(e){if(e.code!==`ENOENT`)throw e}},ki=(e,t,n)=>{try{return b.default.chownSync(e,t,n)}catch(e){if(e.code!==`ENOENT`)throw e}},Ai=Di?(e,t,n,r)=>i=>{!i||i.code!==`EISDIR`?r(i):b.default.chown(e,t,n,r)}:(e,t,n,r)=>r,ji=Di?(e,t,n)=>{try{return Oi(e,t,n)}catch(r){if(r.code!==`EISDIR`)throw r;ki(e,t,n)}}:(e,t,n)=>Oi(e,t,n),Mi=process.version,Ni=(e,t,n)=>b.default.readdir(e,t,n),Pi=(e,t)=>b.default.readdirSync(e,t);/^v4\./.test(Mi)&&(Ni=(e,t,n)=>b.default.readdir(e,n));let Fi=(e,t,n,r)=>{b.default[Ti](e,t,n,Ai(e,t,n,e=>{r(e&&e.code!==`ENOENT`?e:null)}))},Ii=(e,t,n,r,i)=>{if(typeof t==`string`)return b.default.lstat(x.default.resolve(e,t),(a,o)=>{if(a)return i(a.code===`ENOENT`?null:a);o.name=t,Ii(e,o,n,r,i)});t.isDirectory()?Li(x.default.resolve(e,t.name),n,r,a=>{if(a)return i(a);Fi(x.default.resolve(e,t.name),n,r,i)}):Fi(x.default.resolve(e,t.name),n,r,i)},Li=(e,t,n,r)=>{Ni(e,{withFileTypes:!0},(i,a)=>{if(i){if(i.code===`ENOENT`)return r();if(i.code!==`ENOTDIR`&&i.code!==`ENOTSUP`)return r(i)}if(i||!a.length)return Fi(e,t,n,r);let o=a.length,s=null,c=i=>{if(!s){if(i)return r(s=i);if(--o===0)return Fi(e,t,n,r)}};a.forEach(r=>Ii(e,r,t,n,c))})},Ri=(e,t,n,r)=>{if(typeof t==`string`)try{let n=b.default.lstatSync(x.default.resolve(e,t));n.name=t,t=n}catch(e){if(e.code===`ENOENT`)return;throw e}t.isDirectory()&&zi(x.default.resolve(e,t.name),n,r),ji(x.default.resolve(e,t.name),n,r)},zi=(e,t,n)=>{let r;try{r=Pi(e,{withFileTypes:!0})}catch(r){if(r.code===`ENOENT`)return;if(r.code===`ENOTDIR`||r.code===`ENOTSUP`)return ji(e,t,n);throw r}return r&&r.length&&r.forEach(r=>Ri(e,r,t,n)),ji(e,t,n)};var Bi=Li;Li.sync=zi;var Vi=class extends Error{constructor(e,t){super(`Cannot extract through symbolic link`),this.path=t,this.symlink=e}get name(){return`SylinkError`}},Hi=class extends Error{constructor(e,t){super(t+`: Cannot cd into '`+e+`'`),this.path=e,this.code=t}get name(){return`CwdError`}},Ui=(e,t,n)=>{let r=t.umask,i=t.mode|448,a=(i&r)!==0,o=t.uid,s=t.gid,c=typeof o==`number`&&typeof s==`number`&&(o!==t.processUid||s!==t.processGid),l=t.preserve,u=t.unlink,d=t.cache,f=t.cwd,p=(t,r)=>{t?n(t):(d.set(e,!0),r&&c?Bi(r,o,s,e=>p(e)):a?b.default.chmod(e,i,n):n())};if(d&&d.get(e)===!0)return p();if(e===f)return b.default.stat(e,(t,n)=>{(t||!n.isDirectory())&&(t=new Hi(e,t&&t.code||`ENOTDIR`)),p(t)});if(l)return wi(e,{mode:i}).then(e=>p(null,e),p);Wi(f,x.default.relative(f,e).split(/\/|\\/),i,d,u,f,null,p)};let Wi=(e,t,n,r,i,a,o,s)=>{if(!t.length)return s(null,o);let c=t.shift(),l=e+`/`+c;if(r.get(l))return Wi(l,t,n,r,i,a,o,s);b.default.mkdir(l,n,Gi(l,t,n,r,i,a,o,s))},Gi=(e,t,n,r,i,a,o,s)=>c=>{if(c){if(c.path&&x.default.dirname(c.path)===a&&(c.code===`ENOTDIR`||c.code===`ENOENT`))return s(new Hi(a,c.code));b.default.lstat(e,(l,u)=>{if(l)s(l);else if(u.isDirectory())Wi(e,t,n,r,i,a,o,s);else if(i)b.default.unlink(e,c=>{if(c)return s(c);b.default.mkdir(e,n,Gi(e,t,n,r,i,a,o,s))});else if(u.isSymbolicLink())return s(new Vi(e,e+`/`+t.join(`/`)));else s(c)})}else o||=e,Wi(e,t,n,r,i,a,o,s)};Ui.sync=(e,t)=>{let n=t.umask,r=t.mode|448,i=(r&n)!==0,a=t.uid,o=t.gid,s=typeof a==`number`&&typeof o==`number`&&(a!==t.processUid||o!==t.processGid),c=t.preserve,l=t.unlink,u=t.cache,d=t.cwd,f=t=>{u.set(e,!0),t&&s&&Bi.sync(t,a,o),i&&b.default.chmodSync(e,r)};if(u&&u.get(e)===!0)return f();if(e===d){let t=!1,n=`ENOTDIR`;try{t=b.default.statSync(e).isDirectory()}catch(e){n=e.code}finally{if(!t)throw new Hi(e,n)}f();return}if(c)return f(wi.sync(e,r));let p=x.default.relative(d,e).split(/\/|\\/),m=null;for(let e=p.shift(),t=d;e&&(t+=`/`+e);e=p.shift())if(!u.get(t))try{b.default.mkdirSync(t,r),m||=t,u.set(t,!0)}catch(e){if(e.path&&x.default.dirname(e.path)===d&&(e.code===`ENOTDIR`||e.code===`ENOENT`))return new Hi(d,e.code);let n=b.default.lstatSync(t);if(n.isDirectory()){u.set(t,!0);continue}else if(l){b.default.unlinkSync(t),b.default.mkdirSync(t,r),m||=t,u.set(t,!0);continue}else if(n.isSymbolicLink())return new Vi(t,t+`/`+p.join(`/`))}return f(m)};var Ki=()=>{let e=new Map,t=new Map,{join:n}=x.default,r=e=>n(e).split(/[\\/]/).slice(0,-1).reduce((e,t)=>e.length?e.concat(n(e[e.length-1],t)):[t],[]),i=new Set,a=n=>{let r=t.get(n);if(!r)throw Error(`function does not have any path reservations`);return{paths:r.paths.map(t=>e.get(t)),dirs:[...r.dirs].map(t=>e.get(t))}},o=e=>{let{paths:t,dirs:n}=a(e);return t.every(t=>t[0]===e)&&n.every(t=>t[0]instanceof Set&&t[0].has(e))},s=e=>i.has(e)||!o(e)?!1:(i.add(e),e(()=>c(e)),!0),c=n=>{if(!i.has(n))return!1;let{paths:r,dirs:a}=t.get(n),o=new Set;return r.forEach(t=>{let r=e.get(t);w.default.equal(r[0],n),r.length===1?e.delete(t):(r.shift(),typeof r[0]==`function`?o.add(r[0]):r[0].forEach(e=>o.add(e)))}),a.forEach(t=>{let r=e.get(t);w.default(r[0]instanceof Set),r[0].size===1&&r.length===1?e.delete(t):r[0].size===1?(r.shift(),o.add(r[0])):r[0].delete(n)}),i.delete(n),o.forEach(e=>s(e)),!0};return{check:o,reserve:(n,i)=>{let a=new Set(n.map(e=>r(e)).reduce((e,t)=>e.concat(t)));return t.set(i,{dirs:a,paths:n}),n.forEach(t=>{let n=e.get(t);n?n.push(i):e.set(t,[i])}),a.forEach(t=>{let n=e.get(t);n?n[n.length-1]instanceof Set?n[n.length-1].add(i):n.push(new Set([i])):e.set(t,[new Set([i])])}),s(i)}}};let qi=(process.env.__FAKE_PLATFORM__||process.platform)===`win32`,{O_CREAT:Ji,O_TRUNC:Yi,O_WRONLY:Xi,UV_FS_O_FILEMAP:Zi=0}=(de.__FAKE_TESTING_FS__||b.default).constants,Qi=qi&&!!Zi,$i=Zi|Yi|Ji|Xi;var ea=Qi?e=>e<524288?$i:`w`:()=>`w`;let ta=Symbol(`onEntry`),na=Symbol(`checkFs`),ra=Symbol(`checkFs2`),ia=Symbol(`isReusable`),aa=Symbol(`makeFs`),oa=Symbol(`file`),sa=Symbol(`directory`),ca=Symbol(`link`),la=Symbol(`symlink`),ua=Symbol(`hardlink`),da=Symbol(`unsupported`),fa=Symbol(`checkPath`),pa=Symbol(`mkdir`),q=Symbol(`onError`),ma=Symbol(`pending`),ha=Symbol(`pend`),ga=Symbol(`unpend`),_a=Symbol(`ended`),va=Symbol(`maybeClose`),ya=Symbol(`skip`),ba=Symbol(`doChown`),xa=Symbol(`uid`),Sa=Symbol(`gid`),Ca=()=>{throw Error(`sync function called cb somehow?!?`)},wa=(e,t)=>{if(process.platform!==`win32`)return b.default.unlink(e,t);let n=e+`.DELETE.`+ne.default.randomBytes(16).toString(`hex`);b.default.rename(e,n,e=>{if(e)return t(e);b.default.unlink(n,t)})},Ta=e=>{if(process.platform!==`win32`)return b.default.unlinkSync(e);let t=e+`.DELETE.`+ne.default.randomBytes(16).toString(`hex`);b.default.renameSync(e,t),b.default.unlinkSync(t)},Ea=(e,t,n)=>e===e>>>0?e:t===t>>>0?t:n;var Da=class extends Er{constructor(e){if(e||={},e.ondone=e=>{this[_a]=!0,this[va]()},super(e),this.reservations=Ki(),this.transform=typeof e.transform==`function`?e.transform:null,this.writable=!0,this.readable=!1,this[ma]=0,this[_a]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid==`number`||typeof e.gid==`number`){if(typeof e.uid!=`number`||typeof e.gid!=`number`)throw TypeError(`cannot set owner without number uid and gid`);if(e.preserveOwner)throw TypeError(`cannot preserve owner in archive and also set owner explicitly`);this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!=`number`?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||process.platform===`win32`,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=x.default.resolve(e.cwd||process.cwd()),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask==`number`?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on(`entry`,e=>this[ta](e))}warn(e,t,n={}){return(e===`TAR_BAD_ARCHIVE`||e===`TAR_ABORT`)&&(n.recoverable=!1),super.warn(e,t,n)}[va](){this[_a]&&this[ma]===0&&(this.emit(`prefinish`),this.emit(`finish`),this.emit(`end`),this.emit(`close`))}[fa](e){if(this.strip){let t=e.path.split(/\/|\\/);if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join(`/`),e.type===`Link`){let t=e.linkpath.split(/\/|\\/);t.length>=this.strip&&(e.linkpath=t.slice(this.strip).join(`/`))}}if(!this.preservePaths){let t=e.path;if(t.match(/(^|\/|\\)\.\.(\\|\/|$)/))return this.warn(`TAR_ENTRY_ERROR`,`path contains '..'`,{entry:e,path:t}),!1;if(x.default.win32.isAbsolute(t)){let n=x.default.win32.parse(t);e.path=t.substr(n.root.length);let r=n.root;this.warn(`TAR_ENTRY_INFO`,`stripping ${r} from absolute path`,{entry:e,path:t})}}if(this.win32){let t=x.default.win32.parse(e.path);e.path=t.root===``?kt.encode(e.path):t.root+kt.encode(e.path.substr(t.root.length))}return x.default.isAbsolute(e.path)?e.absolute=e.path:e.absolute=x.default.resolve(this.cwd,e.path),!0}[ta](e){if(!this[fa](e))return e.resume();switch(w.default.equal(typeof e.absolute,`string`),e.type){case`Directory`:case`GNUDumpDir`:e.mode&&(e.mode|=448);case`File`:case`OldFile`:case`ContiguousFile`:case`Link`:case`SymbolicLink`:return this[na](e);default:return this[da](e)}}[q](e,t){e.name===`CwdError`?this.emit(`error`,e):(this.warn(`TAR_ENTRY_ERROR`,e,{entry:t}),this[ga](),t.resume())}[pa](e,t,n){Ui(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t,noChmod:this.noChmod},n)}[ba](e){return this.forceChown||this.preserveOwner&&(typeof e.uid==`number`&&e.uid!==this.processUid||typeof e.gid==`number`&&e.gid!==this.processGid)||typeof this.uid==`number`&&this.uid!==this.processUid||typeof this.gid==`number`&&this.gid!==this.processGid}[xa](e){return Ea(this.uid,e.uid,this.processUid)}[Sa](e){return Ea(this.gid,e.gid,this.processGid)}[oa](e,t){let n=e.mode&4095||this.fmode,r=new Qn.WriteStream(e.absolute,{flags:ea(e.size),mode:n,autoClose:!1});r.on(`error`,t=>this[q](t,e));let i=1,a=n=>{if(n)return this[q](n,e);--i===0&&b.default.close(r.fd,n=>{t(),n?this[q](n,e):this[ga]()})};r.on(`finish`,t=>{let n=e.absolute,o=r.fd;if(e.mtime&&!this.noMtime){i++;let t=e.atime||new Date,r=e.mtime;b.default.futimes(o,t,r,e=>e?b.default.utimes(n,t,r,t=>a(t&&e)):a())}if(this[ba](e)){i++;let t=this[xa](e),r=this[Sa](e);b.default.fchown(o,t,r,e=>e?b.default.chown(n,t,r,t=>a(t&&e)):a())}a()});let o=this.transform&&this.transform(e)||e;o!==e&&(o.on(`error`,t=>this[q](t,e)),e.pipe(o)),o.pipe(r)}[sa](e,t){let n=e.mode&4095||this.dmode;this[pa](e.absolute,n,n=>{if(n)return t(),this[q](n,e);let r=1,i=n=>{--r===0&&(t(),this[ga](),e.resume())};e.mtime&&!this.noMtime&&(r++,b.default.utimes(e.absolute,e.atime||new Date,e.mtime,i)),this[ba](e)&&(r++,b.default.chown(e.absolute,this[xa](e),this[Sa](e),i)),i()})}[da](e){e.unsupported=!0,this.warn(`TAR_ENTRY_UNSUPPORTED`,`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[la](e,t){this[ca](e,e.linkpath,`symlink`,t)}[ua](e,t){this[ca](e,x.default.resolve(this.cwd,e.linkpath),`link`,t)}[ha](){this[ma]++}[ga](){this[ma]--,this[va]()}[ya](e){this[ga](),e.resume()}[ia](e,t){return e.type===`File`&&!this.unlink&&t.isFile()&&t.nlink<=1&&process.platform!==`win32`}[na](e){this[ha]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,t=>this[ra](e,t))}[ra](e,t){this[pa](x.default.dirname(e.absolute),this.dmode,n=>{if(n)return t(),this[q](n,e);b.default.lstat(e.absolute,(n,r)=>{r&&(this.keep||this.newer&&r.mtime>e.mtime)?(this[ya](e),t()):n||this[ia](e,r)?this[aa](null,e,t):r.isDirectory()?e.type===`Directory`?!this.noChmod&&(!e.mode||(r.mode&4095)===e.mode)?this[aa](null,e,t):b.default.chmod(e.absolute,e.mode,n=>this[aa](n,e,t)):b.default.rmdir(e.absolute,n=>this[aa](n,e,t)):wa(e.absolute,n=>this[aa](n,e,t))})})}[aa](e,t,n){if(e)return this[q](e,t);switch(t.type){case`File`:case`OldFile`:case`ContiguousFile`:return this[oa](t,n);case`Link`:return this[ua](t,n);case`SymbolicLink`:return this[la](t,n);case`Directory`:case`GNUDumpDir`:return this[sa](t,n)}}[ca](e,t,n,r){b.default[n](t,e.absolute,t=>{if(t)return this[q](t,e);r(),this[ga](),e.resume()})}};Da.Sync=class extends Da{[na](e){let t=this[pa](x.default.dirname(e.absolute),this.dmode,Ca);if(t)return this[q](t,e);try{let t=b.default.lstatSync(e.absolute);if(this.keep||this.newer&&t.mtime>e.mtime)return this[ya](e);if(this[ia](e,t))return this[aa](null,e,Ca);try{return t.isDirectory()?e.type===`Directory`?!this.noChmod&&e.mode&&(t.mode&4095)!==e.mode&&b.default.chmodSync(e.absolute,e.mode):b.default.rmdirSync(e.absolute):Ta(e.absolute),this[aa](null,e,Ca)}catch(t){return this[q](t,e)}}catch{return this[aa](null,e,Ca)}}[oa](e,t){let n=e.mode&4095||this.fmode,r=t=>{let n;try{b.default.closeSync(i)}catch(e){n=e}(t||n)&&this[q](t||n,e)},i;try{i=b.default.openSync(e.absolute,ea(e.size),n)}catch(e){return r(e)}let a=this.transform&&this.transform(e)||e;a!==e&&(a.on(`error`,t=>this[q](t,e)),e.pipe(a)),a.on(`data`,e=>{try{b.default.writeSync(i,e,0,e.length)}catch(e){r(e)}}),a.on(`end`,t=>{let n=null;if(e.mtime&&!this.noMtime){let t=e.atime||new Date,r=e.mtime;try{b.default.futimesSync(i,t,r)}catch(i){try{b.default.utimesSync(e.absolute,t,r)}catch{n=i}}}if(this[ba](e)){let t=this[xa](e),r=this[Sa](e);try{b.default.fchownSync(i,t,r)}catch(i){try{b.default.chownSync(e.absolute,t,r)}catch{n||=i}}}r(n)})}[sa](e,t){let n=e.mode&4095||this.dmode,r=this[pa](e.absolute,n);if(r)return this[q](r,e);if(e.mtime&&!this.noMtime)try{b.default.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[ba](e))try{b.default.chownSync(e.absolute,this[xa](e),this[Sa](e))}catch{}e.resume()}[pa](e,t){try{return Ui.sync(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(e){return e}}[ca](e,t,n,r){try{b.default[n+`Sync`](t,e.absolute),e.resume()}catch(t){return this[q](t,e)}}};var Oa=Da,ka=(e,t,n)=>{typeof e==`function`?(n=e,t=null,e={}):Array.isArray(e)&&(t=e,e={}),typeof t==`function`&&(n=t,t=null),t=t?Array.from(t):[];let r=me(e);if(r.sync&&typeof n==`function`)throw TypeError(`callback not supported for sync tar functions`);if(!r.file&&typeof n==`function`)throw TypeError(`callback only supported with file option`);return t.length&&Aa(r,t),r.file&&r.sync?ja(r):r.file?Ma(r,n):r.sync?Na(r):Pa(r)};let Aa=(e,t)=>{let n=new Map(t.map(e=>[e.replace(/\/+$/,``),!0])),r=e.filter,i=(e,t)=>{let r=t||x.default.parse(e).root||`.`,a=e===r?!1:n.has(e)?n.get(e):i(x.default.dirname(e),r);return n.set(e,a),a};e.filter=r?(e,t)=>r(e,t)&&i(e.replace(/\/+$/,``)):e=>i(e.replace(/\/+$/,``))},ja=e=>{let t=new Oa.Sync(e),n=e.file,r=b.default.statSync(n),i=e.maxReadSize||16*1024*1024;new Qn.ReadStreamSync(n,{readSize:i,size:r.size}).pipe(t)},Ma=(e,t)=>{let n=new Oa(e),r=e.maxReadSize||16*1024*1024,i=e.file,a=new Promise((e,t)=>{n.on(`error`,t),n.on(`close`,e),b.default.stat(i,(e,a)=>{if(e)t(e);else{let e=new Qn.ReadStream(i,{readSize:r,size:a.size});e.on(`error`,t),e.pipe(n)}})});return t?a.then(t,t):a},Na=e=>new Oa.Sync(e),Pa=e=>new Oa(e);var Fa=fe(function(e,t){t.c=t.create=Nr,t.r=t.replace=Br,t.t=t.list=Dr,t.u=t.update=Kr,t.x=t.extract=ka,t.Pack=xn,t.Unpack=Oa,t.Parse=Er,t.ReadEntry=We,t.WriteEntry=Xt,t.Header=yt,t.Pax=L,t.types=Ge}),Ia={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};let La={};for(let e of Object.keys(Ia))La[Ia[e]]=e;let J={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},lch:{channels:3,labels:`lch`},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}};var Ra=J;for(let e of Object.keys(J)){if(!(`channels`in J[e]))throw Error(`missing channels property: `+e);if(!(`labels`in J[e]))throw Error(`missing channel labels property: `+e);if(J[e].labels.length!==J[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=J[e];delete J[e].channels,delete J[e].labels,Object.defineProperty(J[e],`channels`,{value:t}),Object.defineProperty(J[e],`labels`,{value:n})}J.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},J.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[i*360,a*100,l*100]},J.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=J.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,a*100,r*100]},J.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function za(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}J.rgb.keyword=function(e){let t=La[e];if(t)return t;let n=1/0,r;for(let t of Object.keys(Ia)){let i=Ia[t],a=za(e,i);a<n&&(n=a,r=t)}return r},J.keyword.rgb=function(e){return Ia[e]},J.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]},J.rgb.lab=function(e){let t=J.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(n-r),200*(r-i)]},J.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=r*255,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+(i-s)*6*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=o*255;return c},J.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},J.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},J.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},J.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},J.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},J.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]},J.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},J.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},J.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},J.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},J.rgb.ansi16=function(e,t=null){let[n,r,i]=e,a=t===null?J.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(o+=60),o},J.hsv.ansi16=function(e){return J.rgb.ansi16(J.hsv.rgb(e),e[2])},J.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},J.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},J.ansi256.rgb=function(e){if(e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},J.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.substring(t.length)+t},J.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split(``).map(e=>e+e).join(``));let r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},J.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[c*360,o*100,s*100]},J.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},J.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},J.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},J.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},J.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},J.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},J.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},J.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},J.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},J.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},J.gray.hsl=function(e){return[0,0,e[0]]},J.gray.hsv=J.gray.hsl,J.gray.hwb=function(e){return[0,100,e[0]]},J.gray.cmyk=function(e){return[0,0,0,e[0]]},J.gray.lab=function(e){return[e[0],0,0]},J.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},J.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function Ba(){let e={},t=Object.keys(Ra);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function Va(e){let t=Ba(),n=[e];for(t[e].distance=0;n.length;){let e=n.pop(),r=Object.keys(Ra[e]);for(let i=r.length,a=0;a<i;a++){let i=r[a],o=t[i];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(i))}}return t}function Ha(e,t){return function(n){return t(e(n))}}function Ua(e,t){let n=[t[e].parent,e],r=Ra[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=Ha(Ra[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}var Wa=function(e){let t=Va(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=Ua(e,t))}return n};let Ga={},Ka=Object.keys(Ra);function qa(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function Ja(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}Ka.forEach(e=>{Ga[e]={},Object.defineProperty(Ga[e],`channels`,{value:Ra[e].channels}),Object.defineProperty(Ga[e],`labels`,{value:Ra[e].labels});let t=Wa(e);Object.keys(t).forEach(n=>{let r=t[n];Ga[e][n]=Ja(r),Ga[e][n].raw=qa(r)})});var Ya=Ga,Xa=fe(function(e){let t=(e,t)=>(...n)=>`\u001B[${e(...n)+t}m`,n=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};5;${r}m`},r=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},i=e=>e,a=(e,t,n)=>[e,t,n],o=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{let r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},s,c=(e,t,n,r)=>{s===void 0&&(s=Ya);let i=r?10:0,a={};for(let[r,o]of Object.entries(s)){let s=r===`ansi16`?`ansi`:r;r===t?a[s]=e(n,i):typeof o==`object`&&(a[s]=e(o[t],i))}return a};function l(){let e=new Map,s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.gray=s.color.blackBright,s.bgColor.bgGray=s.bgColor.bgBlackBright,s.color.grey=s.color.blackBright,s.bgColor.bgGrey=s.bgColor.bgBlackBright;for(let[t,n]of Object.entries(s)){for(let[t,r]of Object.entries(n))s[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=s[t],e.set(r[0],r[1]);Object.defineProperty(s,t,{value:n,enumerable:!1})}return Object.defineProperty(s,`codes`,{value:e,enumerable:!1}),s.color.close=`\x1B[39m`,s.bgColor.close=`\x1B[49m`,o(s.color,`ansi`,()=>c(t,`ansi16`,i,!1)),o(s.color,`ansi256`,()=>c(n,`ansi256`,i,!1)),o(s.color,`ansi16m`,()=>c(r,`rgb`,a,!1)),o(s.bgColor,`ansi`,()=>c(t,`ansi16`,i,!0)),o(s.bgColor,`ansi256`,()=>c(n,`ansi256`,i,!0)),o(s.bgColor,`ansi16m`,()=>c(r,`rgb`,a,!0)),s}Object.defineProperty(e,`exports`,{enumerable:!0,get:l})}),Za=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)};let{env:Y}=process,Qa;Za(`no-color`)||Za(`no-colors`)||Za(`color=false`)||Za(`color=never`)?Qa=0:(Za(`color`)||Za(`colors`)||Za(`color=true`)||Za(`color=always`))&&(Qa=1),`FORCE_COLOR`in Y&&(Qa=Y.FORCE_COLOR===`true`?1:Y.FORCE_COLOR===`false`?0:Y.FORCE_COLOR.length===0?1:Math.min(parseInt(Y.FORCE_COLOR,10),3));function $a(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function eo(e,t){if(Qa===0)return 0;if(Za(`color=16m`)||Za(`color=full`)||Za(`color=truecolor`))return 3;if(Za(`color=256`))return 2;if(e&&!t&&Qa===void 0)return 0;let n=Qa||0;if(Y.TERM===`dumb`)return n;if(process.platform===`win32`){let e=re.default.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in Y)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in Y)||Y.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in Y)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Y.TEAMCITY_VERSION);if(Y.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in Y){let e=parseInt((Y.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(Y.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(Y.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Y.TERM)||`COLORTERM`in Y?1:n}function to(e){return $a(eo(e,e&&e.isTTY))}var no={supportsColor:to,stdout:$a(eo(!0,ie.default.isatty(1))),stderr:$a(eo(!0,ie.default.isatty(2)))},ro={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.substr(a,r-a)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.substr(a),o},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.substr(i,(o?r-1:r)-i)+t+(o?`\r
|
|
23
23
|
`:`
|
|
24
24
|
`)+n,i=r+1,r=e.indexOf(`
|
|
25
25
|
`,i)}while(r!==-1);return a+=e.substr(i),a}};let io=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,ao=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,oo=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,so=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,co=new Map([[`n`,`
|
|
@@ -34,17 +34,17 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof Q))re
|
|
|
34
34
|
`).join(`
|
|
35
35
|
`+a),t.push(i+`m+`+e.exports.humanize(this.diff)+`\x1B[0m`)}else t[0]=i()+n+` `+t[0]}function i(){return t.inspectOpts.hideDate?``:new Date().toISOString()+` `}function a(...e){return process.stderr.write(E.default.format(...e)+`
|
|
36
36
|
`)}function o(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function s(){return process.env.DEBUG}function c(e){e.inspectOpts={};let n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]}e.exports=Ql(t);let{formatters:l}=e.exports;l.o=function(e){return this.inspectOpts.colors=this.useColors,E.default.inspect(e,this.inspectOpts).split(`
|
|
37
|
-
`).map(e=>e.trim()).join(` `)},l.O=function(e){return this.inspectOpts.colors=this.useColors,E.default.inspect(e,this.inspectOpts)}}),tu=fe(function(e){typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?e.exports=$l:e.exports=eu});function nu(e){return function(t,n){return new Promise((r,i)=>{e.call(this,t,n,(e,t)=>{e?i(e):r(t)})})}}var ru=
|
|
38
|
-
`).some(e=>e.indexOf(`(https.js:`)!==-1||e.indexOf(`node:https:`)!==-1):!1}function
|
|
37
|
+
`).map(e=>e.trim()).join(` `)},l.O=function(e){return this.inspectOpts.colors=this.useColors,E.default.inspect(e,this.inspectOpts)}}),tu=fe(function(e){typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?e.exports=$l:e.exports=eu});function nu(e){return function(t,n){return new Promise((r,i)=>{e.call(this,t,n,(e,t)=>{e?i(e):r(t)})})}}var ru=Object.defineProperty({default:nu},`__esModule`,{value:!0}),iu=de&&de.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};let au=iu(tu),ou=iu(ru),su=au.default(`agent-base`);function cu(e){return!!e&&typeof e.addRequest==`function`}function lu(){let{stack:e}=Error();return typeof e==`string`?e.split(`
|
|
38
|
+
`).some(e=>e.indexOf(`(https.js:`)!==-1||e.indexOf(`node:https:`)!==-1):!1}function uu(e,t){return new uu.Agent(e,t)}(function(e){class t extends S.default.EventEmitter{constructor(e,t){super();let n=t;typeof e==`function`?this.callback=e:e&&(n=e),this.timeout=null,n&&typeof n.timeout==`number`&&(this.timeout=n.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort==`number`?this.explicitDefaultPort:lu()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return typeof this.explicitProtocol==`string`?this.explicitProtocol:lu()?`https:`:`http:`}set protocol(e){this.explicitProtocol=e}callback(e,t,n){throw Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,t){let n=Object.assign({},t);typeof n.secureEndpoint!=`boolean`&&(n.secureEndpoint=lu()),n.host??=`localhost`,n.port??=n.secureEndpoint?443:80,n.protocol??=n.secureEndpoint?`https:`:`http:`,n.host&&n.path&&delete n.path,delete n.agent,delete n.hostname,delete n._defaultAgent,delete n.defaultPort,delete n.createConnection,e._last=!0,e.shouldKeepAlive=!1;let r=!1,i=null,a=n.timeout||this.timeout,o=t=>{e._hadError||=(e.emit(`error`,t),!0)},s=()=>{i=null,r=!0;let e=Error(`A "socket" was not created for HTTP request before ${a}ms`);e.code=`ETIMEOUT`,o(e)},c=e=>{r||(i!==null&&(clearTimeout(i),i=null),o(e))},l=t=>{if(!r){if(i!=null&&(clearTimeout(i),i=null),cu(t)){su(`Callback returned another Agent instance %o`,t.constructor.name),t.addRequest(e,n);return}if(t){t.once(`free`,()=>{this.freeSocket(t,n)}),e.onSocket(t);return}o(Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``))}};if(typeof this.callback!=`function`){o(Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(su(`Converting legacy callback function to promise`),this.promisifiedCallback=ou.default(this.callback)):this.promisifiedCallback=this.callback),typeof a==`number`&&a>0&&(i=setTimeout(s,a)),`port`in n&&typeof n.port!=`number`&&(n.port=Number(n.port));try{su(`Resolving socket for %o request: %o`,n.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,n)).then(l,c)}catch(e){Promise.reject(e).catch(c)}}freeSocket(e,t){su(`Freeing socket %o %o`,e.constructor.name,t),e.destroy()}destroy(){su(`Destroying agent %o`,this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype})(uu||={});var du=uu;let fu=(de&&de.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(tu).default(`https-proxy-agent:parse-proxy-response`);function pu(e){return new Promise((t,n)=>{let r=0,i=[];function a(){let t=e.read();t?u(t):e.once(`readable`,a)}function o(){e.removeListener(`end`,c),e.removeListener(`error`,l),e.removeListener(`close`,s),e.removeListener(`readable`,a)}function s(e){fu(`onclose had error %o`,e)}function c(){fu(`onend`)}function l(e){o(),fu(`onerror %o`,e),n(e)}function u(e){i.push(e),r+=e.length;let n=Buffer.concat(i,r);if(n.indexOf(`\r
|
|
39
39
|
\r
|
|
40
|
-
`)===-1){
|
|
41
|
-
`)),s=+o.split(` `)[1];
|
|
42
|
-
`).filter(Boolean).map(e=>{let[t,n]=e.split(` `);if(n===`HEAD`)return{type:`HEAD`,hash:t};let r=/refs\/(\w+)\/(.+)/.exec(n);if(!r)throw new
|
|
40
|
+
`)===-1){fu(`have not received end of HTTP headers yet...`),a();return}let o=n.toString(`ascii`,0,n.indexOf(`\r
|
|
41
|
+
`)),s=+o.split(` `)[1];fu(`got proxy server response: %o`,o),t({statusCode:s,buffered:n})}e.on(`error`,l),e.on(`close`,s),e.on(`end`,c),a()})}var mu=Object.defineProperty({default:pu},`__esModule`,{value:!0}),hu=de&&de.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},gu=de&&de.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};let _u=gu(le.default),vu=gu(ue.default),yu=gu(ce.default),bu=gu(w.default),xu=gu(tu),Su=gu(mu),Cu=xu.default(`https-proxy-agent:agent`);var wu=class extends du.Agent{constructor(e){let t;if(t=typeof e==`string`?yu.default.parse(e):e,!t)throw Error("an HTTP(S) proxy server `host` and `port` must be specified!");Cu(`creating new HttpsProxyAgent instance: %o`,t),super(t);let n=Object.assign({},t);this.secureProxy=t.secureProxy||Du(n.protocol),n.host=n.hostname||n.host,typeof n.port==`string`&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!(`ALPNProtocols`in n)&&(n.ALPNProtocols=[`http 1.1`]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(e,t){return hu(this,void 0,void 0,function*(){let{proxy:n,secureProxy:r}=this,i;r?(Cu("Creating `tls.Socket`: %o",n),i=vu.default.connect(n)):(Cu("Creating `net.Socket`: %o",n),i=_u.default.connect(n));let a=Object.assign({},n.headers),o=`CONNECT ${`${t.host}:${t.port}`} HTTP/1.1\r\n`;n.auth&&(a[`Proxy-Authorization`]=`Basic ${Buffer.from(n.auth).toString(`base64`)}`);let{host:s,port:c,secureEndpoint:l}=t;Eu(c,l)||(s+=`:${c}`),a.Host=s,a.Connection=`close`;for(let e of Object.keys(a))o+=`${e}: ${a[e]}\r\n`;let u=Su.default(i);i.write(`${o}\r\n`);let{statusCode:d,buffered:f}=yield u;if(d===200){if(e.once(`socket`,Tu),t.secureEndpoint){let e=t.servername||t.host;if(!e)throw Error(`Could not determine "servername"`);return Cu(`Upgrading socket connection to TLS`),vu.default.connect(Object.assign(Object.assign({},Ou(t,`host`,`hostname`,`path`,`port`)),{socket:i,servername:e}))}return i}i.destroy();let p=new _u.default.Socket;return p.readable=!0,e.once(`socket`,e=>{Cu(`replaying proxy buffer for failed request`),bu.default(e.listenerCount(`data`)>0),e.push(f),e.push(null)}),p})}};function Tu(e){e.resume()}function Eu(e,t){return!!(!t&&e===80||t&&e===443)}function Du(e){return typeof e==`string`?/^https:?$/i.test(e):!1}function Ou(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}var ku=Object.defineProperty({default:wu},`__esModule`,{value:!0});let Au=(de&&de.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ku);function ju(e){return new Au.default(e)}(function(e){e.HttpsProxyAgent=Au.default,e.prototype=Au.default.prototype})(ju||={});var Mu=ju,Nu=class extends Error{constructor(e,t){super(e),Object.assign(this,t)}};function Pu(e,t){try{return t&&t.clearCache===!0&&delete D.cache[D.resolve(e)],D(e)}catch{return null}}function Fu(e){return new Promise((t,n)=>{se.default.exec(e,(e,r,i)=>{if(e){n(e);return}t({stdout:r,stderr:i})})})}function Iu(e){let t=x.default.dirname(e);if(t!==e){Iu(t);try{b.default.mkdirSync(e)}catch(e){if(e.code!==`EEXIST`)throw e}}}function Lu(e,t,n){return new Promise((r,i)=>{let a=e;if(n){let t=ce.default.parse(e);a={hostname:t.host,path:t.path,agent:new Mu(n)}}oe.default.get(a,e=>{let a=e.statusCode;a>=400?i({code:a,message:e.statusMessage}):a>=300?Lu(e.headers.location,t,n).then(r,i):e.pipe(b.default.createWriteStream(t)).on(`finish`,()=>r()).on(`error`,i)}).on(`error`,i)})}function Ru(e,t){let n=x.default.join(e,`tmp`);Rl(n),Iu(n),b.default.readdirSync(t).forEach(e=>{let r=x.default.join(t,e),i=x.default.join(n,e);b.default.lstatSync(r).isDirectory()?(Ll(r).to(i),Rl(r)):(b.default.copyFileSync(r,i),b.default.unlinkSync(r))})}function zu(e,t){let n=x.default.join(e,`tmp`);b.default.readdirSync(n).forEach(e=>{let r=x.default.join(n,e),i=x.default.join(t,e);b.default.lstatSync(r).isDirectory()?(Ll(r).to(i),Rl(r)):(e!==`degit.json`&&b.default.copyFileSync(r,i),b.default.unlinkSync(r))}),Rl(n)}let Bu=x.default.join(zl,`.degit`),Vu=new Set([`tar`,`git`]);function Hu(e,t){return new Uu(e,t)}var Uu=class extends S.default{constructor(e,t={}){if(super(),this.src=e,this.cache=t.cache,this.force=t.force,this.verbose=t.verbose,this.proxy=process.env.https_proxy,this.repo=Gu(e),this.mode=t.mode||this.repo.mode,!Vu.has(this.mode))throw Error(`Valid modes are ${Array.from(Vu).join(`, `)}`);this._hasStashed=!1,this.directiveActions={clone:async(e,t,n)=>{this._hasStashed===!1&&(Ru(e,t),this._hasStashed=!0);let r=Object.assign({force:!0},{cache:n.cache,verbose:n.verbose}),i=Hu(n.src,r);i.on(`info`,e=>{console.error(Po.cyan(`> ${e.message.replace(`options.`,`--`)}`))}),i.on(`warn`,e=>{console.error(Po.magenta(`! ${e.message.replace(`options.`,`--`)}`))}),await i.clone(t).catch(e=>{console.error(Po.red(`! ${e.message}`)),process.exit(1)})},remove:this.remove.bind(this)}}_getDirectives(e){let t=x.default.resolve(e,`degit.json`),n=Pu(t,{clearCache:!0})||!1;return n&&b.default.unlinkSync(t),n}async clone(e){this._checkDirIsEmpty(e);let{repo:t}=this,n=x.default.join(Bu,t.site,t.user,t.name);this.mode===`tar`?await this._cloneWithTar(n,e):await this._cloneWithGit(n,e),this._info({code:`SUCCESS`,message:`cloned ${Po.bold(t.user+`/`+t.name)}#${Po.bold(t.ref)}${e===`.`?``:` to ${e}`}`,repo:t,dest:e});let r=this._getDirectives(e);if(r){for(let t of r)await this.directiveActions[t.action](n,e,t);this._hasStashed===!0&&zu(n,e)}}remove(e,t,n){let r=n.files;Array.isArray(r)||(r=[r]);let i=r.map(e=>{let n=x.default.resolve(t,e);return b.default.existsSync(n)?b.default.lstatSync(n).isDirectory()?(Rl(n),e+`/`):(b.default.unlinkSync(n),e):(this._warn({code:`FILE_DOES_NOT_EXIST`,message:`action wants to remove ${Po.bold(e)} but it does not exist`}),null)}).filter(e=>e);i.length>0&&this._info({code:`REMOVED`,message:`removed: ${Po.bold(i.map(e=>Po.bold(e)).join(`, `))}`})}_checkDirIsEmpty(e){try{if(b.default.readdirSync(e).length>0)if(this.force)this._info({code:`DEST_NOT_EMPTY`,message:`destination directory is not empty. Using options.force, continuing`});else throw new Nu(`destination directory is not empty, aborting. Use options.force to override`,{code:`DEST_NOT_EMPTY`});else this._verbose({code:`DEST_IS_EMPTY`,message:`destination directory is empty`})}catch(e){if(e.code!==`ENOENT`)throw e}}_info(e){this.emit(`info`,e)}_warn(e){this.emit(`warn`,e)}_verbose(e){this.verbose&&this._info(e)}async _getHash(e,t){try{let t=await qu(e);return e.ref===`HEAD`?t.find(e=>e.type===`HEAD`).hash:this._selectRef(t,e.ref)}catch(n){return this._warn(n),this._verbose(n.original),this._getHashFromCache(e,t)}}_getHashFromCache(e,t){if(e.ref in t){let n=t[e.ref];return this._info({code:`USING_CACHE`,message:`using cached commit hash ${n}`}),n}}_selectRef(e,t){for(let n of e)if(n.name===t)return this._verbose({code:`FOUND_MATCH`,message:`found matching commit hash: ${n.hash}`}),n.hash;if(t.length<8)return null;for(let n of e)if(n.hash.startsWith(t))return n.hash}async _cloneWithTar(e,t){let{repo:n}=this,r=Pu(x.default.join(e,`map.json`))||{},i=this.cache?this._getHashFromCache(n,r):await this._getHash(n,r),a=n.subdir?`${n.name}-${i}${n.subdir}`:null;if(!i)throw new Nu(`could not find commit hash for ${n.ref}`,{code:`MISSING_REF`,ref:n.ref});let o=`${e}/${i}.tar.gz`,s=n.site===`gitlab`?`${n.url}/repository/archive.tar.gz?ref=${i}`:n.site===`bitbucket`?`${n.url}/get/${i}.tar.gz`:`${n.url}/archive/${i}.tar.gz`;try{if(!this.cache)try{b.default.statSync(o),this._verbose({code:`FILE_EXISTS`,message:`${o} already exists locally`})}catch{Iu(x.default.dirname(o)),this.proxy&&this._verbose({code:`PROXY`,message:`using proxy ${this.proxy}`}),this._verbose({code:`DOWNLOADING`,message:`downloading ${s} to ${o}`}),await Lu(s,o,this.proxy)}}catch(e){throw new Nu(`could not download ${s}`,{code:`COULD_NOT_DOWNLOAD`,url:s,original:e})}Ju(e,n,i,r),this._verbose({code:`EXTRACTING`,message:`extracting ${a?n.subdir+` from `:``}${o} to ${t}`}),Iu(t),await Ku(o,t,a)}async _cloneWithGit(e,t){await Fu(`git clone ${this.repo.ssh} ${t}`),await Fu(`rm -rf ${x.default.resolve(t,`.git`)}`)}};let Wu=new Set([`github`,`gitlab`,`bitbucket`,`git.sr.ht`]);function Gu(e){let t=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(e);if(!t)throw new Nu(`could not parse ${e}`,{code:`BAD_SRC`});let n=(t[1]||t[2]||t[3]||`github`).replace(/\.(com|org)$/,``);if(!Wu.has(n))throw new Nu(`degit supports GitHub, GitLab, Sourcehut and BitBucket`,{code:`UNSUPPORTED_HOST`});let r=t[4],i=t[5].replace(/\.git$/,``),a=t[6],o=t[7]||`HEAD`,s=`${n}.${n===`bitbucket`?`org`:n===`git.sr.ht`?``:`com`}`;return{site:n,user:r,name:i,ref:o,url:`https://${s}/${r}/${i}`,ssh:`git@${s}:${r}/${i}`,subdir:a,mode:Wu.has(n)?`tar`:`git`}}async function Ku(e,t,n=null){return Fa.extract({file:e,strip:n?n.split(`/`).length:1,C:t},n?[n]:[])}async function qu(e){try{let{stdout:t}=await Fu(`git ls-remote ${e.url}`);return t.split(`
|
|
42
|
+
`).filter(Boolean).map(e=>{let[t,n]=e.split(` `);if(n===`HEAD`)return{type:`HEAD`,hash:t};let r=/refs\/(\w+)\/(.+)/.exec(n);if(!r)throw new Nu(`could not parse ${n}`,{code:`BAD_REF`});return{type:r[1]===`heads`?`branch`:r[1]===`refs`?`ref`:r[1],name:r[2],hash:t}})}catch(t){throw new Nu(`could not fetch remote ${e.url}`,{code:`COULD_NOT_FETCH`,url:e.url,original:t})}}function Ju(e,t,n,r){let i=Pu(x.default.join(e,`access.json`))||{};if(i[t.ref]=new Date().toISOString(),b.default.writeFileSync(x.default.join(e,`access.json`),JSON.stringify(i,null,` `)),r[t.ref]===n)return;let a=r[t.ref];if(a){let t=!1;for(let e in r)if(r[e]===n){t=!0;break}if(!t)try{b.default.unlinkSync(x.default.join(e,`${a}.tar.gz`))}catch{}}r[t.ref]=n,b.default.writeFileSync(x.default.join(e,`map.json`),JSON.stringify(r,null,` `))}e.base=Bu,e.createCommonjsModule=fe,e.degit=Hu,e.source=Po,e.tryRequire=Pu})),Me=ne(T(((e,t)=>{D(`fs`),D(`path`);var n=je();D(`events`),D(`stream`),D(`string_decoder`),D(`assert`),D(`buffer`),D(`zlib`),D(`util`),D(`crypto`),D(`os`),D(`tty`),D(`constants`),D(`https`),D(`child_process`),D(`url`),D(`net`),D(`tls`),t.exports=n.degit}))(),1);const j=[{name:`basic`,display:`Basic Ripple App`,description:`A minimal Ripple application with Vite and TypeScript`}],Ne=r(g(import.meta.url));function Pe(e){return j.find(t=>t.name===e)||null}function M(){return j.map(e=>e.name)}function N(){return j.map(e=>({title:e.display,description:e.description,value:e.name}))}function Fe(e){return e?Pe(e)!==null:!1}async function Ie(e){if(!Fe(e))throw Error(`Template "${e}" not found`);let t=i(v(),`ripple-template-${e}-${Date.now()}`);u(t,{recursive:!0});let n=(0,Me.default)(`Ripple-TS/ripple/templates/${e}#main`,{cache:!1,force:!0,verbose:!1});try{return await n.clone(t),t}catch(t){throw Error(`Failed to download template "${e}": ${t.message}`)}}function Le(e){return i(i(Ne,`../../../../`),`templates`,e)}function Re(){return c(i(i(Ne,`../../../../`),`templates`))}var P=T(((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})),ze=T(((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}}})),Be=T(((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}})),F=T(((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`}})),Ve=T(((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.
|
|
43
43
|
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=Be(),o=F(),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)}})),He=T(((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})),Ue=T(((e,t)=>{let n=P(),r=He(),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)}})),We=T(((e,t)=>{let n=Be();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}})),Ge=T(((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(`
|
|
44
44
|
`)).join(`
|
|
45
45
|
`)}})),Ke=T(((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}}})),qe=T(((e,t)=>{t.exports={action:ze(),clear:Ve(),style:Ue(),strip:Be(),figures:He(),lines:We(),wrap:Ge(),entriesToDisplay:Ke()}})),Je=T(((e,t)=>{let n=D(`readline`),r=qe().action,i=D(`events`),a=F(),o=a.beep,s=a.cursor,c=P();t.exports=class extends i{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=n.createInterface({input:this.in,escapeCodeTimeout:50});n.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let i=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,a=(e,t)=>{let n=r(t,i);n===!1?this._&&this._(e,t):typeof this[n]==`function`?this[n](t):this.bell()};this.close=()=>{this.out.write(s.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(o)}render(){this.onRender(c),this.firstRender&&=!1}}})),Ye=T(((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=P(),a=Je(),o=F(),s=o.erase,c=o.cursor,l=qe(),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(`
|
|
46
46
|
`),this.close()}validate(){var e=this;return r(function*(){let t=yield e.validator(e.value);typeof t==`string`&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return r(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
|
|
47
|
-
`),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor);this.value=`${n}${e}${
|
|
47
|
+
`),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(c.down(f(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns)),this.out.write(d(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[u.symbol(this.done,this.aborted),i.bold(this.msg),u.delimiter(this.done),this.red?i.red(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
48
48
|
`).reduce((e,t,n)=>e+`\n${n?` `:p.pointerSmall} ${i.red().italic(t)}`,``)),this.out.write(s.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore+c.move(this.cursorOffset,0)))}}})),Xe=T(((e,t)=>{let n=P(),r=Je(),i=qe(),a=i.style,o=i.clear,s=i.figures,c=i.wrap,l=i.entriesToDisplay,u=F().cursor;t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||`- Use arrow-keys. Return to submit.`,this.warn=e.warn||`- This option is disabled`,this.cursor=e.initial||0,this.choices=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=o(``,this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
49
49
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
50
50
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===` `)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(u.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let e=l(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,r=e.endIndex;if(this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(!1),this.done?this.selection.title:this.selection.disabled?n.yellow(this.warn):n.gray(this.hint)].join(` `),!this.done){this.outputText+=`
|
|
@@ -68,7 +68,7 @@ Instructions:
|
|
|
68
68
|
`)}renderOptions(e){return this.done?``:this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions()];return this.value[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=[c.symbol(this.done,this.aborted),n.bold(this.msg),c.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=o(e,this.out.columns)}}})),ut=T(((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=P(),a=Je(),o=F(),s=o.erase,c=o.cursor,l=qe(),u=l.style,d=l.clear,f=l.figures,p=l.wrap,m=l.entriesToDisplay,h=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),g=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),_=(e,t)=>{let n=e.findIndex(e=>e.value===t||e.title===t);return n>-1?n:void 0};t.exports=class extends a{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial==`number`?e.initial:_(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||`no matches found`},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input=``,this.limit=e.limit||10,this.cursor=0,this.transform=u.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=d(``,this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb==`number`?e=this.choices[this._fb]:typeof this._fb==`string`&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=h(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return r(function*(){let n=t.completing=t.suggest(t.input,t.choices),r=yield n;if(t.completing!==n)return;t.suggestions=r.map((e,t,n)=>({title:g(n,t),value:h(n,t),description:e.description})),t.completing=!1;let i=Math.max(r.length-1,0);t.moveSelect(Math.min(i,t.select)),e&&e()})()}reset(){this.input=``,this.complete(()=>{this.moveSelect(this.initial===void 0?0:this.initial),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
69
69
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
70
70
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
71
|
-
`),this.close()}_(e,t){let n=this.input.slice(0,this.cursor);this.input=`${n}${e}${
|
|
71
|
+
`),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),--this.cursor,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();--this.cursor,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor+=1,this.render()}renderOption(e,t,n,r){let a,o=n?f.arrowUp:r?f.arrowDown:` `,s=t?i.cyan().underline(e.title):e.title;return o=(t?i.cyan(f.pointer)+` `:` `)+o,e.description&&(a=` - ${e.description}`,(o.length+s.length+a.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(a=`
|
|
72
72
|
`+p(e.description,{margin:3,width:this.out.columns}))),o+` `+s+i.gray(a||``)}render(){if(this.closed)return;this.firstRender?this.out.write(c.hide):this.out.write(d(this.outputText,this.out.columns)),super.render();let e=m(this.select,this.choices.length,this.limit),t=e.startIndex,n=e.endIndex;if(this.outputText=[u.symbol(this.done,this.aborted,this.exited),i.bold(this.msg),u.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(` `),!this.done){let e=this.suggestions.slice(t,n).map((e,r)=>this.renderOption(e,this.select===r+t,r===0&&t>0,r+t===n-1&&n<this.choices.length)).join(`
|
|
73
73
|
`);this.outputText+=`
|
|
74
74
|
`+(e||i.gray(this.fallback.title))}this.out.write(s.line+c.to(0)+this.outputText)}}})),dt=T(((e,t)=>{let n=P(),r=F().cursor,i=lt(),a=qe(),o=a.clear,s=a.style,c=a.figures;t.exports=class extends i{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=o(``,this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(e=>this.inputValue?!!(typeof e.title==`string`&&e.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof e.value==`string`&&e.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(t=>t===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}handleInputChange(e){this.inputValue+=e,this.updateFilteredOptions()}_(e,t){e===` `?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
|
|
@@ -85,7 +85,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
85
85
|
`)).join(`
|
|
86
86
|
`)}})),Ct=T(((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}}})),L=T(((e,t)=>{t.exports={action:gt(),clear:vt(),style:bt(),strip:_t(),figures:yt(),lines:xt(),wrap:St(),entriesToDisplay:Ct()}})),wt=T(((e,t)=>{let n=D(`readline`),{action:r}=L(),i=D(`events`),{beep:a,cursor:o}=F(),s=P();t.exports=class extends i{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=n.createInterface({input:this.in,escapeCodeTimeout:50});n.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let i=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,a=(e,t)=>{let n=r(t,i);n===!1?this._&&this._(e,t):typeof this[n]==`function`?this[n](t):this.bell()};this.close=()=>{this.out.write(o.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(a)}render(){this.onRender(s),this.firstRender&&=!1}}})),Tt=T(((e,t)=>{let n=P(),r=wt(),{erase:i,cursor:a}=F(),{style:o,clear:s,lines:c,figures:l}=L();t.exports=class extends r{constructor(e={}){super(e),this.transform=o.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=s(``,this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=n.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(`
|
|
87
87
|
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
88
|
-
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor);this.value=`${n}${e}${
|
|
88
|
+
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(a.down(c(this.outputError,this.out.columns)-1)+s(this.outputError,this.out.columns)),this.out.write(s(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(this.done),this.red?n.red(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
89
89
|
`).reduce((e,t,r)=>e+`\n${r?` `:l.pointerSmall} ${n.red().italic(t)}`,``)),this.out.write(i.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore+a.move(this.cursorOffset,0)))}}})),Et=T(((e,t)=>{let n=P(),r=wt(),{style:i,clear:a,figures:o,wrap:s,entriesToDisplay:c}=L(),{cursor:l}=F();t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||`- Use arrow-keys. Return to submit.`,this.warn=e.warn||`- This option is disabled`,this.cursor=e.initial||0,this.choices=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=a(``,this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
90
90
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
91
91
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===` `)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(l.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=c(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(!1),this.done?this.selection.title:this.selection.disabled?n.yellow(this.warn):n.gray(this.hint)].join(` `),!this.done){this.outputText+=`
|
|
@@ -109,7 +109,7 @@ Instructions:
|
|
|
109
109
|
`)}renderOptions(e){return this.done?``:this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions()];return this.value[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=[s.symbol(this.done,this.aborted),n.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=a(e,this.out.columns)}}})),Vt=T(((e,t)=>{let n=P(),r=wt(),{erase:i,cursor:a}=F(),{style:o,clear:s,figures:c,wrap:l,entriesToDisplay:u}=L(),d=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),f=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),p=(e,t)=>{let n=e.findIndex(e=>e.value===t||e.title===t);return n>-1?n:void 0};t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial==`number`?e.initial:p(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||`no matches found`},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input=``,this.limit=e.limit||10,this.cursor=0,this.transform=o.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=s(``,this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb==`number`?e=this.choices[this._fb]:typeof this._fb==`string`&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=d(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),n=await t;if(this.completing!==t)return;this.suggestions=n.map((e,t,n)=>({title:f(n,t),value:d(n,t),description:e.description})),this.completing=!1;let r=Math.max(n.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}reset(){this.input=``,this.complete(()=>{this.moveSelect(this.initial===void 0?0:this.initial),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
110
110
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
111
111
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
112
|
-
`),this.close()}_(e,t){let n=this.input.slice(0,this.cursor);this.input=`${n}${e}${
|
|
112
|
+
`),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),--this.cursor,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();--this.cursor,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor+=1,this.render()}renderOption(e,t,r,i){let a,o=r?c.arrowUp:i?c.arrowDown:` `,s=t?n.cyan().underline(e.title):e.title;return o=(t?n.cyan(c.pointer)+` `:` `)+o,e.description&&(a=` - ${e.description}`,(o.length+s.length+a.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(a=`
|
|
113
113
|
`+l(e.description,{margin:3,width:this.out.columns}))),o+` `+s+n.gray(a||``)}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(s(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=u(this.select,this.choices.length,this.limit);if(this.outputText=[o.symbol(this.done,this.aborted,this.exited),n.bold(this.msg),o.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(` `),!this.done){let r=this.suggestions.slice(e,t).map((n,r)=>this.renderOption(n,this.select===r+e,r===0&&e>0,r+e===t-1&&t<this.choices.length)).join(`
|
|
114
114
|
`);this.outputText+=`
|
|
115
115
|
`+(r||n.gray(this.fallback.title))}this.out.write(i.line+a.to(0)+this.outputText)}}})),Ht=T(((e,t)=>{let n=P(),{cursor:r}=F(),i=Bt(),{clear:a,style:o,figures:s}=L();t.exports=class extends i{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=a(``,this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(e=>this.inputValue?!!(typeof e.title==`string`&&e.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof e.value==`string`&&e.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(t=>t===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}handleInputChange(e){this.inputValue+=e,this.updateFilteredOptions()}_(e,t){e===` `?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
|
|
@@ -121,7 +121,7 @@ Instructions:
|
|
|
121
121
|
`:``}renderCurrentInput(){return`
|
|
122
122
|
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)}}})),Ut=T(((e,t)=>{let n=P(),r=wt(),{style:i,clear:a}=L(),{erase:o,cursor:s}=F();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(`
|
|
123
123
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
124
|
-
`),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))}}})),Wt=T(((e,t)=>{t.exports={TextPrompt:Tt(),SelectPrompt:Et(),TogglePrompt:Dt(),DatePrompt:Rt(),NumberPrompt:zt(),MultiselectPrompt:Bt(),AutocompletePrompt:Vt(),AutocompleteMultiselectPrompt:Ht(),ConfirmPrompt:Ut()}})),Gt=T((e=>{let t=e,n=Wt(),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))})),Kt=T(((e,t)=>{let n=Gt(),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})})),qt=ne(T(((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`)?ht():Kt()}))(),1);async function Jt(e=`my-ripple-app`){let t=await(0,qt.default)({type:`text`,name:`projectName`,message:`What is your project named?`,initial:e,validate:e=>{let t=Ae(e);return t.valid||t.message}});return t.projectName||(console.log(De(`✖ Operation cancelled`)),process.exit(1)),t.projectName}async function Yt(){let e=N();if(e.length===1)return e[0].value;let t=await(0,qt.default)({type:`select`,name:`template`,message:`Which template would you like to use?`,choices:e,initial:0});return t.template||(console.log(De(`✖ Operation cancelled`)),process.exit(1)),t.template}async function Xt(e){let t=await(0,qt.default)({type:`select`,name:`packageManager`,message:`Which package manager would you like to use?`,choices:[{title:`npm`,value:`npm`,description:`Use npm for dependency management`},{title:`yarn`,value:`yarn`,description:`Use Yarn for dependency management`},{title:`pnpm`,value:`pnpm`,description:`Use pnpm for dependency management`},{title:`bun`,value:`bun`,description:`Use bun for dependency management`}],initial:[`npm`,`yarn`,`pnpm`,`bun`].indexOf(e)});return t.packageManager||(console.log(De(`✖ Operation cancelled`)),process.exit(1)),t.packageManager}async function Zt(){let e=await(0,qt.default)({type:`confirm`,name:`gitInit`,message:`Initialize a new Git repository?`,initial:!0});return e.gitInit===void 0&&(console.log(De(`✖ Operation cancelled`)),process.exit(1)),e.gitInit}async function Qt(){let e=await(0,qt.default)({type:`select`,name:`stylingFramework`,message:`Which styling framework would you like to integrate with Ripple?`,choices:[{title:`Vanilla CSS`,value:`vanilla`,description:`Use Vanilla CSS for styling your components`},{title:`Bootstrap`,value:`bootstrap`,description:`Use Bootstrap classes to style your components`},{title:`TailwindCSS`,value:`tailwind`,description:`Use TailwindCSS to style your components`}]});return e.stylingFramework===void 0&&(console.log(De(`✖ Operation cancelled`)),process.exit(1)),e.stylingFramework}const $t=(e=0)=>t=>`\u001B[${t+e}m`,en=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,tn=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,R={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(R.modifier);const nn=Object.keys(R.color),rn=Object.keys(R.bgColor);[...nn,...rn];function an(){let e=new Map;for(let[t,n]of Object.entries(R)){for(let[t,r]of Object.entries(n))R[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=R[t],e.set(r[0],r[1]);Object.defineProperty(R,t,{value:n,enumerable:!1})}return Object.defineProperty(R,`codes`,{value:e,enumerable:!1}),R.color.close=`\x1B[39m`,R.bgColor.close=`\x1B[49m`,R.color.ansi=$t(),R.color.ansi256=en(),R.color.ansi16m=tn(),R.bgColor.ansi=$t(10),R.bgColor.ansi256=en(10),R.bgColor.ansi16m=tn(10),Object.defineProperties(R,{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=>R.rgbToAnsi256(...R.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)=>R.ansi256ToAnsi(R.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>R.ansi256ToAnsi(R.hexToAnsi256(e)),enumerable:!1}}),R}const on=an();function sn(e,t=globalThis.Deno?globalThis.Deno.args:h.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:z}=h;let cn;sn(`no-color`)||sn(`no-colors`)||sn(`color=false`)||sn(`color=never`)?cn=0:(sn(`color`)||sn(`colors`)||sn(`color=true`)||sn(`color=always`))&&(cn=1);function ln(){if(`FORCE_COLOR`in z)return z.FORCE_COLOR===`true`?1:z.FORCE_COLOR===`false`?0:z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(z.FORCE_COLOR,10),3)}function un(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function dn(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=ln();r!==void 0&&(cn=r);let i=n?cn:r;if(i===0)return 0;if(n){if(sn(`color=16m`)||sn(`color=full`)||sn(`color=truecolor`))return 3;if(sn(`color=256`))return 2}if(`TF_BUILD`in z&&`AGENT_NAME`in z)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(z.TERM===`dumb`)return a;if(h.platform===`win32`){let e=_.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in z)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in z)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in z)||z.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in z)return
|
|
124
|
+
`),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))}}})),Wt=T(((e,t)=>{t.exports={TextPrompt:Tt(),SelectPrompt:Et(),TogglePrompt:Dt(),DatePrompt:Rt(),NumberPrompt:zt(),MultiselectPrompt:Bt(),AutocompletePrompt:Vt(),AutocompleteMultiselectPrompt:Ht(),ConfirmPrompt:Ut()}})),Gt=T((e=>{let t=e,n=Wt(),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))})),Kt=T(((e,t)=>{let n=Gt(),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})})),qt=ne(T(((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`)?ht():Kt()}))(),1);async function Jt(e=`my-ripple-app`){let t=await(0,qt.default)({type:`text`,name:`projectName`,message:`What is your project named?`,initial:e,validate:e=>{let t=Ae(e);return t.valid||t.message}});return t.projectName||(console.log(De(`✖ Operation cancelled`)),process.exit(1)),t.projectName}async function Yt(){let e=N();if(e.length===1)return e[0].value;let t=await(0,qt.default)({type:`select`,name:`template`,message:`Which template would you like to use?`,choices:e,initial:0});return t.template||(console.log(De(`✖ Operation cancelled`)),process.exit(1)),t.template}async function Xt(e){let t=await(0,qt.default)({type:`select`,name:`packageManager`,message:`Which package manager would you like to use?`,choices:[{title:`npm`,value:`npm`,description:`Use npm for dependency management`},{title:`yarn`,value:`yarn`,description:`Use Yarn for dependency management`},{title:`pnpm`,value:`pnpm`,description:`Use pnpm for dependency management`},{title:`bun`,value:`bun`,description:`Use bun for dependency management`}],initial:[`npm`,`yarn`,`pnpm`,`bun`].indexOf(e)});return t.packageManager||(console.log(De(`✖ Operation cancelled`)),process.exit(1)),t.packageManager}async function Zt(){let e=await(0,qt.default)({type:`confirm`,name:`gitInit`,message:`Initialize a new Git repository?`,initial:!0});return e.gitInit===void 0&&(console.log(De(`✖ Operation cancelled`)),process.exit(1)),e.gitInit}async function Qt(){let e=await(0,qt.default)({type:`select`,name:`stylingFramework`,message:`Which styling framework would you like to integrate with Ripple?`,choices:[{title:`Vanilla CSS`,value:`vanilla`,description:`Use Vanilla CSS for styling your components`},{title:`Bootstrap`,value:`bootstrap`,description:`Use Bootstrap classes to style your components`},{title:`TailwindCSS`,value:`tailwind`,description:`Use TailwindCSS to style your components`}]});return e.stylingFramework===void 0&&(console.log(De(`✖ Operation cancelled`)),process.exit(1)),e.stylingFramework}const $t=(e=0)=>t=>`\u001B[${t+e}m`,en=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,tn=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,R={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(R.modifier);const nn=Object.keys(R.color),rn=Object.keys(R.bgColor);[...nn,...rn];function an(){let e=new Map;for(let[t,n]of Object.entries(R)){for(let[t,r]of Object.entries(n))R[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=R[t],e.set(r[0],r[1]);Object.defineProperty(R,t,{value:n,enumerable:!1})}return Object.defineProperty(R,`codes`,{value:e,enumerable:!1}),R.color.close=`\x1B[39m`,R.bgColor.close=`\x1B[49m`,R.color.ansi=$t(),R.color.ansi256=en(),R.color.ansi16m=tn(),R.bgColor.ansi=$t(10),R.bgColor.ansi256=en(10),R.bgColor.ansi16m=tn(10),Object.defineProperties(R,{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=>R.rgbToAnsi256(...R.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)=>R.ansi256ToAnsi(R.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>R.ansi256ToAnsi(R.hexToAnsi256(e)),enumerable:!1}}),R}const on=an();function sn(e,t=globalThis.Deno?globalThis.Deno.args:h.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:z}=h;let cn;sn(`no-color`)||sn(`no-colors`)||sn(`color=false`)||sn(`color=never`)?cn=0:(sn(`color`)||sn(`colors`)||sn(`color=true`)||sn(`color=always`))&&(cn=1);function ln(){if(`FORCE_COLOR`in z)return z.FORCE_COLOR===`true`?1:z.FORCE_COLOR===`false`?0:z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(z.FORCE_COLOR,10),3)}function un(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function dn(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=ln();r!==void 0&&(cn=r);let i=n?cn:r;if(i===0)return 0;if(n){if(sn(`color=16m`)||sn(`color=full`)||sn(`color=truecolor`))return 3;if(sn(`color=256`))return 2}if(`TF_BUILD`in z&&`AGENT_NAME`in z)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(z.TERM===`dumb`)return a;if(h.platform===`win32`){let e=_.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in z)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in z)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in z)||z.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in z)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(z.TEAMCITY_VERSION);if(z.COLORTERM===`truecolor`||z.TERM===`xterm-kitty`||z.TERM===`xterm-ghostty`||z.TERM===`wezterm`)return 3;if(`TERM_PROGRAM`in z){let e=Number.parseInt((z.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(z.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(z.TERM)||`COLORTERM`in z?1:a}function fn(e,t={}){return un(dn(e,{streamIsTTY:e&&e.isTTY,...t}))}const pn={stdout:fn({isTTY:b.isatty(1)}),stderr:fn({isTTY:b.isatty(2)})};function mn(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 hn(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
|
|
125
125
|
`:`
|
|
126
126
|
`)+n,i=r+1,r=e.indexOf(`
|
|
127
127
|
`,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:gn,stderr:_n}=pn,vn=Symbol(`GENERATOR`),yn=Symbol(`STYLER`),bn=Symbol(`IS_EMPTY`),xn=[`ansi`,`ansi`,`ansi256`,`ansi16m`],Sn=Object.create(null),Cn=(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=gn?gn.level:0;e.level=t.level===void 0?n:t.level},wn=e=>{let t=(...e)=>e.join(` `);return Cn(t,e),Object.setPrototypeOf(t,B.prototype),t};function B(e){return wn(e)}Object.setPrototypeOf(B.prototype,Function.prototype);for(let[e,t]of Object.entries(on))Sn[e]={get(){let n=Dn(this,En(t.open,t.close,this[yn]),this[bn]);return Object.defineProperty(this,e,{value:n}),n}};Sn.visible={get(){let e=Dn(this,this[yn],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const Tn=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?on[n].ansi16m(...r):t===`ansi256`?on[n].ansi256(on.rgbToAnsi256(...r)):on[n].ansi(on.rgbToAnsi(...r)):e===`hex`?Tn(`rgb`,t,n,...on.hexToRgb(...r)):on[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){Sn[e]={get(){let{level:t}=this;return function(...n){let r=En(Tn(e,xn[t],`color`,...n),on.color.close,this[yn]);return Dn(this,r,this[bn])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);Sn[t]={get(){let{level:t}=this;return function(...n){let r=En(Tn(e,xn[t],`bgColor`,...n),on.bgColor.close,this[yn]);return Dn(this,r,this[bn])}}}}const V=Object.defineProperties(()=>{},{...Sn,level:{enumerable:!0,get(){return this[vn].level},set(e){this[vn].level=e}}}),En=(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}},Dn=(e,t,n)=>{let r=(...e)=>On(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,V),r[vn]=e,r[yn]=t,r[bn]=n,r},On=(e,t)=>{if(e.level<=0||!t)return e[bn]?``:t;let n=e[yn];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=mn(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ripple-ts/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.57",
|
|
4
4
|
"description": "Interactive CLI tool for creating Ripple applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"ora": "^9.3.0",
|
|
45
45
|
"prettier": "^3.8.3",
|
|
46
46
|
"prompts": "^2.4.2",
|
|
47
|
-
"tsdown": "^0.
|
|
48
|
-
"vitest": "^4.1.
|
|
47
|
+
"tsdown": "^0.22.0",
|
|
48
|
+
"vitest": "^4.1.6"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsdown",
|