create-spree-app 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +76 -142
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,194 +1,128 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __createRequire } from "node:module";
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
|
-
var
|
|
4
|
+
var Dp=Object.create;var Jo=Object.defineProperty;var mp=Object.getOwnPropertyDescriptor;var fp=Object.getOwnPropertyNames;var hp=Object.getPrototypeOf,gp=Object.prototype.hasOwnProperty;var R=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var bp=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of fp(e))!gp.call(t,o)&&o!==r&&Jo(t,o,{get:()=>e[o],enumerable:!(n=mp(e,o))||n.enumerable});return t};var ue=(t,e,r)=>(r=t!=null?Dp(hp(t)):{},bp(e||!t||!t.__esModule?Jo(r,"default",{value:t,enumerable:!0}):r,t));var Ve=S(Nr=>{"use strict";var ct=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},jr=class extends ct{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Nr.CommanderError=ct;Nr.InvalidArgumentError=jr});var lt=S(Vr=>{"use strict";var{InvalidArgumentError:Cp}=Ve(),Ur=class{constructor(e,r){switch(this.description=r||"",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.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Cp(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function yp(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Vr.Argument=Ur;Vr.humanReadableArgName=yp});var Hr=S(Wr=>{"use strict";var{humanReadableArgName:Ep}=lt(),Gr=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 r=e.commands.filter(o=>!o._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((o,s)=>o.name().localeCompare(s.name())),r}compareOptions(e,r){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(o=>!o.hidden),n=e._getHelpOption();if(n&&!n.hidden){let o=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!o&&!s?r.push(n):n.long&&!s?r.push(e.createOption(n.long,n.description)):n.short&&!o&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let o=n.options.filter(s=>!s.hidden);r.push(...o)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Ep(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(o)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(o)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let o=e.parent;o;o=o.parent)n=o.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),o=r.helpWidth??80;function s(p,d){return r.formatItem(p,n,d,r)}let i=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(i=i.concat([r.boxWrap(r.styleCommandDescription(a),o),""]));let u=r.visibleArguments(e).map(p=>s(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));u.length>0&&(i=i.concat([r.styleTitle("Arguments:"),...u,""]));let c=r.visibleOptions(e).map(p=>s(r.styleOptionTerm(r.optionTerm(p)),r.styleOptionDescription(r.optionDescription(p))));if(c.length>0&&(i=i.concat([r.styleTitle("Options:"),...c,""])),r.showGlobalOptions){let p=r.visibleGlobalOptions(e).map(d=>s(r.styleOptionTerm(r.optionTerm(d)),r.styleOptionDescription(r.optionDescription(d))));p.length>0&&(i=i.concat([r.styleTitle("Global Options:"),...p,""]))}let l=r.visibleCommands(e).map(p=>s(r.styleSubcommandTerm(r.subcommandTerm(p)),r.styleSubcommandDescription(r.subcommandDescription(p))));return l.length>0&&(i=i.concat([r.styleTitle("Commands:"),...l,""])),i.join(`
|
|
5
5
|
`)}displayWidth(e){return Xo(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).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(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).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,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,o){let i=" ".repeat(2);if(!n)return i+e;let a=e.padEnd(r+e.length-o.displayWidth(e)),u=2,l=(this.helpWidth??80)-r-u-2,p;return l<this.minWidthToWrap||o.preformatted(n)?p=n:p=o.boxWrap(n,l).replace(/\n/g,`
|
|
6
6
|
`+" ".repeat(r+u)),i+a+" ".repeat(u)+p.replace(/\n/g,`
|
|
7
7
|
${i}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),o=/[\s]*[^\s]+/g,s=[];return n.forEach(i=>{let a=i.match(o);if(a===null){s.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let p=this.displayWidth(l);if(c+p<=r){u.push(l),c+=p;return}s.push(u.join(""));let d=l.trimStart();u=[d],c=this.displayWidth(d)}),s.push(u.join(""))}),s.join(`
|
|
8
|
-
`)}};function Xo(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Wr.Help=Gr;Wr.stripColor=Xo});var Kr=
|
|
8
|
+
`)}};function Xo(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Wr.Help=Gr;Wr.stripColor=Xo});var Kr=S(Yr=>{"use strict";var{InvalidArgumentError:wp}=Ve(),zr=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Fp(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}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),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}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new wp(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Zo(this.name().replace(/^no-/,"")):Zo(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},qr=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,s=o!==void 0?o:!1;return r.negate===(s===e)}};function Zo(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Fp(t){let e,r,n=/^-[^-]$/,o=/^--[^-]/,s=t.split(/[ |,]+/).concat("guard");if(n.test(s[0])&&(e=s.shift()),o.test(s[0])&&(r=s.shift()),!e&&n.test(s[0])&&(e=s.shift()),!e&&o.test(s[0])&&(e=r,r=s.shift()),s[0].startsWith("-")){let i=s[0],a=`option creation failed due to '${i}' in option flags '${t}'`;throw/^-[^-][^-]/.test(i)?new Error(`${a}
|
|
9
9
|
- a short flag is a single dash and a single character
|
|
10
10
|
- either use a single dash and a single character (for a short flag)
|
|
11
11
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(i)?new Error(`${a}
|
|
12
12
|
- too many short flags`):o.test(i)?new Error(`${a}
|
|
13
13
|
- too many long flags`):new Error(`${a}
|
|
14
|
-
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}Yr.Option=zr;Yr.DualOptions=qr});var ei=
|
|
14
|
+
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}Yr.Option=zr;Yr.DualOptions=qr});var ei=S(Qo=>{"use strict";function Sp(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let o=1;o<=t.length;o++){let s=1;t[o-1]===e[n-1]?s=0:s=1,r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+s),o>1&&n>1&&t[o-1]===e[n-2]&&t[o-2]===e[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[t.length][e.length]}function xp(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(i=>i.slice(2)));let n=[],o=3,s=.4;return e.forEach(i=>{if(i.length<=1)return;let a=Sp(t,i),u=Math.max(t.length,i.length);(u-a)/u>s&&(a<o?(o=a,n=[i]):a===o&&n.push(i))}),n.sort((i,a)=>i.localeCompare(a)),r&&(n=n.map(i=>`--${i}`)),n.length>1?`
|
|
15
15
|
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
16
|
-
(Did you mean ${n[0]}?)`:""}Qo.suggestSimilar=
|
|
17
|
-
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new
|
|
16
|
+
(Did you mean ${n[0]}?)`:""}Qo.suggestSimilar=xp});var oi=S(en=>{"use strict";var Ap=R("events").EventEmitter,Jr=R("child_process"),ee=R("path"),pt=R("fs"),b=R("process"),{Argument:Op,humanReadableArgName:$p}=lt(),{CommanderError:Xr}=Ve(),{Help:Bp,stripColor:_p}=Hr(),{Option:ti,DualOptions:vp}=Kr(),{suggestSimilar:ri}=ei(),Zr=class t extends Ap{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:r=>b.stdout.write(r),writeErr:r=>b.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>Qr()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>Qr()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:r=>_p(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}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 r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let o=r,s=n;typeof o=="object"&&o!==null&&(s=o,o=null),s=s||{};let[,i,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(i);return o&&(u.description(o),u._executableHandler=!0),s.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(s.noHelp||s.hidden),u._executableFile=s.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),o?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Bp,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(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,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
17
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Op(e,r)}argument(e,r,n,o){let s=this.createArgument(e,r);return typeof n=="function"?s.default(o).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,o]=e.match(/([^ ]+) *(.*)/),s=r??"display help for command",i=this.createCommand(n);return i.helpOption(!1),o&&i.arguments(o),s&&i.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=i,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,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,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
18
18
|
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Xr(e,r,n)),b.exit(e)}action(e){let r=n=>{let o=this.registeredArguments.length,s=n.slice(0,o);return this._storeOptionsAsProperties?s[o]=this:s[o]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=r,this}createOption(e,r){return new ti(e,r)}_callParseArg(e,r,n,o){try{return e.parseArg(r,n)}catch(s){if(s.code==="commander.invalidArgument"){let i=`${o} ${s.message}`;this.error(i,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
19
19
|
- already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=o=>[o.name()].concat(o.aliases()),n=r(e).find(o=>this._findCommand(o));if(n){let o=r(this._findCommand(n)).join("|"),s=r(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${o}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let o=(s,i,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let u=this.getOptionValue(n);s!==null&&e.parseArg?s=this._callParseArg(e,s,u,i):s!==null&&e.variadic&&(s=e._concatValue(s,u)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,a)};return this.on("option:"+r,s=>{let i=`error: option '${e.flags}' argument '${s}' is invalid.`;o(s,i,"cli")}),e.envVar&&this.on("optionEnv:"+r,s=>{let i=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;o(s,i,"env")}),this}_optionEx(e,r,n,o,s){if(typeof r=="object"&&r instanceof ti)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let i=this.createOption(r,n);if(i.makeOptionMandatory(!!e.mandatory),typeof o=="function")i.default(s).argParser(o);else if(o instanceof RegExp){let a=o;o=(u,c)=>{let l=a.exec(u);return l?l[0]:c},i.default(s).argParser(o)}else i.default(o);return this.addOption(i)}option(e,r,n,o){return this._optionEx({},e,r,n,o)}requiredOption(e,r,n,o){return this._optionEx({mandatory:!0},e,r,n,o)}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 new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){b.versions?.electron&&(r.from="electron");let o=b.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}e===void 0&&(e=b.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":b.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 new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);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 new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
20
20
|
- 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,r,n){if(pt.existsSync(e))return;let o=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
|
|
21
21
|
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
22
22
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
23
|
-
- ${o}`;throw new Error(s)}_executeSubCommand(e,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function s(l,p){let d=
|
|
23
|
+
- ${o}`;throw new Error(s)}_executeSubCommand(e,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function s(l,p){let d=ee.resolve(l,p);if(pt.existsSync(d))return d;if(o.includes(ee.extname(p)))return;let D=o.find(f=>pt.existsSync(`${d}${f}`));if(D)return`${d}${D}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=pt.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=ee.resolve(ee.dirname(l),a)}if(a){let l=s(a,i);if(!l&&!e._executableFile&&this._scriptPath){let p=ee.basename(this._scriptPath,ee.extname(this._scriptPath));p!==this._name&&(l=s(a,`${p}-${e._name}`))}i=l||i}n=o.includes(ee.extname(i));let u;b.platform!=="win32"?n?(r.unshift(i),r=ni(b.execArgv).concat(r),u=Jr.spawn(b.argv[0],r,{stdio:"inherit"})):u=Jr.spawn(i,r,{stdio:"inherit"}):(this._checkForMissingExecutable(i,a,e._name),r.unshift(i),r=ni(b.execArgv).concat(r),u=Jr.spawn(b.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{b.on(p,()=>{u.killed===!1&&u.exitCode===null&&u.kill(p)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new Xr(l,"commander.executeSubCommandAsync","(close)")):b.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(i,a,e._name);else if(l.code==="EACCES")throw new Error(`'${i}' not executable`);if(!c)b.exit(1);else{let p=new Xr(1,"commander.executeSubCommandAsync","(error)");p.nestedError=l,c(p)}}),this.runningCommand=u}_dispatchSubcommand(e,r,n){let o=this._findCommand(e);o||this.help({error:!0}),o._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,o,"preSubcommand"),s=this._chainOrCall(s,()=>{if(o._executableHandler)this._executeSubCommand(o,r.concat(n));else return o._parseCommand(r,n)}),s}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==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=(n,o,s)=>{let i=o;if(o!==null&&n.parseArg){let a=`error: command-argument value '${o}' is invalid for argument '${n.name()}'.`;i=this._callParseArg(n,o,s,a)}return i};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,o)=>{let s=n.defaultValue;n.variadic?o<this.args.length?(s=this.args.slice(o),n.parseArg&&(s=s.reduce((i,a)=>e(n,a,i),n.defaultValue))):s===void 0&&(s=[]):o<this.args.length&&(s=this.args[o],n.parseArg&&(s=e(n,s,n.defaultValue))),r[o]=s}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,o=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(i=>{o.push({hookedCommand:s,callback:i})})}),r==="postAction"&&o.reverse(),o.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let o=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{o=this._chainOrCall(o,()=>s(this,r))}),o}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){o(),this._processArguments();let i;return i=this._chainOrCallHooks(i,"preAction"),i=this._chainOrCall(i,()=>this._actionHandler(this.processedArgs)),this.parent&&(i=this._chainOrCall(i,()=>{this.parent.emit(s,e,r)})),i=this._chainOrCallHooks(i,"postAction"),i}if(this.parent&&this.parent.listenerCount(s))o(),this._processArguments(),this.parent.emit(s,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(o(),this._processArguments())}else this.commands.length?(o(),this.help({error:!0})):(o(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let o=n.attributeName();return this.getOptionValue(o)===void 0?!1:this.getOptionValueSource(o)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let o=e.find(s=>n.conflictsWith.includes(s.attributeName()));o&&this._conflictingOption(n,o)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],o=r,s=e.slice();function i(u){return u.length>1&&u[0]==="-"}let a=null;for(;s.length;){let u=s.shift();if(u==="--"){o===n&&o.push(u),o.push(...s);break}if(a&&!i(u)){this.emit(`option:${a.name()}`,u);continue}if(a=null,i(u)){let c=this._findOption(u);if(c){if(c.required){let l=s.shift();l===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,l)}else if(c.optional){let l=null;s.length>0&&!i(s[0])&&(l=s.shift()),this.emit(`option:${c.name()}`,l)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let c=this._findOption(`-${u[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,u.slice(2)):(this.emit(`option:${c.name()}`),s.unshift(`-${u.slice(2)}`));continue}}if(/^--[^=]+=/.test(u)){let c=u.indexOf("="),l=this._findOption(u.slice(0,c));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,u.slice(c+1));continue}}if(i(u)&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),s.length>0&&n.push(...s);break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u),s.length>0&&r.push(...s);break}else if(this._defaultCommandName){n.push(u),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){o.push(u),s.length>0&&o.push(...s);break}o.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let o=this.options[n].attributeName();e[o]=o===this._versionOptionName?this._version:this[o]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
24
24
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
25
25
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
26
|
-
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,s=n.code||"commander.error";this._exit(o,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in b.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,b.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new
|
|
27
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${o}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n
|
|
26
|
+
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,s=n.code||"commander.error";this._exit(o,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in b.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,b.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new vp(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(o=>!r(o)).forEach(o=>{this.setOptionValueWithSource(o,n.implied[o],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=i=>{let a=i.attributeName(),u=this.getOptionValue(a),c=this.options.find(p=>p.negate&&a===p.attributeName()),l=this.options.find(p=>!p.negate&&a===p.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||i},o=i=>{let a=n(i),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${o(e)} cannot be used with ${o(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let o=[],s=this;do{let i=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);o=o.concat(i),s=s.parent}while(s&&!s._enablePositionalOptions);r=ri(e,o)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(s=>{o.push(s.name()),s.alias()&&o.push(s.alias())}),r=ri(e,o)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let o=this.createOption(r,n);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
27
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${o}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>$p(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=ee.basename(e,ee.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let o=r.formatHelp(this,r);return n.hasColors?o:this._outputConfiguration.stripColor(o)}_getOutputContext(e){e=e||{};let r=!!e.error,n,o,s;return r?(n=a=>this._outputConfiguration.writeErr(a),o=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),o=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(o||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:o,helpWidth:s}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),o={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(i=>i.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let s=this.helpInformation({error:n.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",o),this._getCommandAndAncestors().forEach(i=>i.emit("afterAllHelp",o))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Number(b.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
28
28
|
Expecting one of '${n.join("', '")}'`);let o=`${e}Help`;return this.on(o,s=>{let i;typeof r=="function"?i=r({error:s.error,command:s.command}):i=r,i&&s.write(`${i}
|
|
29
|
-
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ni(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",o="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?o=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],n=s[3],o=s[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:e})}function Qr(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0}en.Command=Zr;en.useColor=Qr});var ui=F(k=>{"use strict";var{Argument:ii}=lt(),{Command:tn}=oi(),{CommanderError:Lp,InvalidArgumentError:si}=Ve(),{Help:jp}=Hr(),{Option:ai}=Kr();k.program=new tn;k.createCommand=t=>new tn(t);k.createOption=(t,e)=>new ai(t,e);k.createArgument=(t,e)=>new ii(t,e);k.Command=tn;k.Option=ai;k.Argument=ii;k.Help=jp;k.CommanderError=Lp;k.InvalidArgumentError=si;k.InvalidOptionArgumentError=si});var nn=F((FE,pi)=>{"use strict";var rn={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Np={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Up={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?rn.up():"");return t&&(e+=rn.left),e}};pi.exports={cursor:rn,scroll:Np,erase:Up,beep:"\x07"}});var Ge=F((xE,on)=>{"use strict";var mt=process||{},di=mt.argv||[],dt=mt.env||{},Vp=!(dt.NO_COLOR||di.includes("--no-color"))&&(!!dt.FORCE_COLOR||di.includes("--color")||mt.platform==="win32"||(mt.stdout||{}).isTTY&&dt.TERM!=="dumb"||!!dt.CI),Gp=(t,e,r=t)=>n=>{let o=""+n,s=o.indexOf(e,t.length);return~s?t+Wp(o,e,r,s)+e:t+o+e},Wp=(t,e,r,n)=>{let o="",s=0;do o+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return o+t.substring(s)},mi=(t=Vp)=>{let e=t?Gp:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};on.exports=mi();on.exports.createColors=mi});var Ss=F((vS,ys)=>{"use strict";ys.exports=Es;Es.sync=$m;var bs=R("fs");function Om(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&t.substr(-o.length).toLowerCase()===o)return!0}return!1}function Cs(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Om(e,r)}function Es(t,e,r){bs.stat(t,function(n,o){r(n,n?!1:Cs(o,t,e))})}function $m(t,e){return Cs(bs.statSync(t),t,e)}});var Os=F((TS,As)=>{"use strict";As.exports=Fs;Fs.sync=_m;var ws=R("fs");function Fs(t,e,r){ws.stat(t,function(n,o){r(n,n?!1:xs(o,e))})}function _m(t,e){return xs(ws.statSync(t),e)}function xs(t,e){return t.isFile()&&Bm(t,e)}function Bm(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),i=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,p=r&c||r&u&&o===i||r&a&&n===s||r&l&&s===0;return p}});var _s=F((RS,$s)=>{"use strict";var IS=R("fs"),Lt;process.platform==="win32"||global.TESTING_WINDOWS?Lt=Ss():Lt=Os();$s.exports=An;An.sync=vm;function An(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){An(t,e||{},function(s,i){s?o(s):n(i)})})}Lt(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function vm(t,e){try{return Lt.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Ps=F((MS,Ms)=>{"use strict";var $e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Bs=R("path"),Tm=$e?";":":",vs=_s(),Ts=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Is=(t,e)=>{let r=e.colon||Tm,n=t.match(/\//)||$e&&t.match(/\\/)?[""]:[...$e?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=$e?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=$e?o.split(r):[""];return $e&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},Rs=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=Is(t,e),i=[],a=c=>new Promise((l,p)=>{if(c===n.length)return e.all&&i.length?l(i):p(Ts(t));let d=n[c],m=/^".*"$/.test(d)?d.slice(1,-1):d,f=Bs.join(m,t),g=!m&&/^\.[\\\/]/.test(t)?t.slice(0,2)+f:f;l(u(g,c,0))}),u=(c,l,p)=>new Promise((d,m)=>{if(p===o.length)return d(a(l+1));let f=o[p];vs(c+f,{pathExt:s},(g,y)=>{if(!g&&y)if(e.all)i.push(c+f);else return d(c+f);return d(u(c,l,p+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},Im=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Is(t,e),s=[];for(let i=0;i<r.length;i++){let a=r[i],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=Bs.join(u,t),l=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let p=0;p<n.length;p++){let d=l+n[p];try{if(vs.sync(d,{pathExt:o}))if(e.all)s.push(d);else return d}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw Ts(t)};Ms.exports=Rs;Rs.sync=Im});var Ls=F((PS,On)=>{"use strict";var ks=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};On.exports=ks;On.exports.default=ks});var Vs=F((kS,Us)=>{"use strict";var js=R("path"),Rm=Ps(),Mm=Ls();function Ns(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let i;try{i=Rm.sync(t.command,{path:r[Mm({env:r})],pathExt:e?js.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=js.resolve(o?t.options.cwd:"",i)),i}function Pm(t){return Ns(t)||Ns(t,!0)}Us.exports=Pm});var Gs=F((LS,_n)=>{"use strict";var $n=/([()\][%!^"`<>&|;, *?])/g;function km(t){return t=t.replace($n,"^$1"),t}function Lm(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace($n,"^$1"),e&&(t=t.replace($n,"^$1")),t}_n.exports.command=km;_n.exports.argument=Lm});var Hs=F((jS,Ws)=>{"use strict";Ws.exports=/^#!(.*)/});var qs=F((NS,zs)=>{"use strict";var jm=Hs();zs.exports=(t="")=>{let e=t.match(jm);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Ks=F((US,Ys)=>{"use strict";var Bn=R("fs"),Nm=qs();function Um(t){let r=Buffer.alloc(150),n;try{n=Bn.openSync(t,"r"),Bn.readSync(n,r,0,150,0),Bn.closeSync(n)}catch{}return Nm(r.toString())}Ys.exports=Um});var Qs=F((VS,Zs)=>{"use strict";var Vm=R("path"),Js=Vs(),Xs=Gs(),Gm=Ks(),Wm=process.platform==="win32",Hm=/\.(?:com|exe)$/i,zm=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qm(t){t.file=Js(t);let e=t.file&&Gm(t.file);return e?(t.args.unshift(t.file),t.command=e,Js(t)):t.file}function Ym(t){if(!Wm)return t;let e=qm(t),r=!Hm.test(e);if(t.options.forceShell||r){let n=zm.test(e);t.command=Vm.normalize(t.command),t.command=Xs.command(t.command),t.args=t.args.map(s=>Xs.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Km(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:Ym(n)}Zs.exports=Km});var ra=F((GS,ta)=>{"use strict";var vn=process.platform==="win32";function Tn(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function Jm(t,e){if(!vn)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=ea(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function ea(t,e){return vn&&t===1&&!e.file?Tn(e.original,"spawn"):null}function Xm(t,e){return vn&&t===1&&!e.file?Tn(e.original,"spawnSync"):null}ta.exports={hookChildProcess:Jm,verifyENOENT:ea,verifyENOENTSync:Xm,notFoundError:Tn}});var ia=F((WS,_e)=>{"use strict";var na=R("child_process"),In=Qs(),Rn=ra();function oa(t,e,r){let n=In(t,e,r),o=na.spawn(n.command,n.args,n.options);return Rn.hookChildProcess(o,n),o}function Zm(t,e,r){let n=In(t,e,r),o=na.spawnSync(n.command,n.args,n.options);return o.error=o.error||Rn.verifyENOENTSync(o.status,n),o}_e.exports=oa;_e.exports.spawn=oa;_e.exports.sync=Zm;_e.exports._parse=In;_e.exports._enoent=Rn});var ci=ae(ui(),1),{program:mE,createCommand:DE,createArgument:fE,createOption:hE,CommanderError:gE,InvalidArgumentError:bE,InvalidOptionArgumentError:CE,Command:li,Argument:EE,Option:yE,Help:SE}=ci.default;import{stripVTControlCharacters as dn}from"util";var T=ae(nn(),1),wi=ae(Ge(),1);import{stdin as yi,stdout as Si}from"process";import*as ue from"readline";import Di from"readline";import{Writable as Hp}from"stream";function zp({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var qp=zp();function Fi(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(qp,"")}function xi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ai={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var o=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,i=o;return 55296<=o&&o<=56319&&56320<=s&&s<=57343&&(o&=1023,s&=1023,i=o<<10|s,i+=65536),i==12288||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":i==8361||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||i==172||i==175||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":i==161||i==164||167<=i&&i<=168||i==170||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||i==198||i==208||215<=i&&i<=216||222<=i&&i<=225||i==230||232<=i&&i<=234||236<=i&&i<=237||i==240||242<=i&&i<=243||247<=i&&i<=250||i==252||i==254||i==257||i==273||i==275||i==283||294<=i&&i<=295||i==299||305<=i&&i<=307||i==312||319<=i&&i<=322||i==324||328<=i&&i<=331||i==333||338<=i&&i<=339||358<=i&&i<=359||i==363||i==462||i==464||i==466||i==468||i==470||i==472||i==474||i==476||i==593||i==609||i==708||i==711||713<=i&&i<=715||i==717||i==720||728<=i&&i<=731||i==733||i==735||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||i==1025||1040<=i&&i<=1103||i==1105||i==8208||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||i==8240||8242<=i&&i<=8243||i==8245||i==8251||i==8254||i==8308||i==8319||8321<=i&&i<=8324||i==8364||i==8451||i==8453||i==8457||i==8467||i==8470||8481<=i&&i<=8482||i==8486||i==8491||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||i==8585||8592<=i&&i<=8601||8632<=i&&i<=8633||i==8658||i==8660||i==8679||i==8704||8706<=i&&i<=8707||8711<=i&&i<=8712||i==8715||i==8719||i==8721||i==8725||i==8730||8733<=i&&i<=8736||i==8739||i==8741||8743<=i&&i<=8748||i==8750||8756<=i&&i<=8759||8764<=i&&i<=8765||i==8776||i==8780||i==8786||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||i==8853||i==8857||i==8869||i==8895||i==8978||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||i==9675||9678<=i&&i<=9681||9698<=i&&i<=9701||i==9711||9733<=i&&i<=9734||i==9737||9742<=i&&i<=9743||9748<=i&&i<=9749||i==9756||i==9758||i==9792||i==9794||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||i==9839||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||i==9955||9960<=i&&i<=9983||i==10045||i==10071||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||i==65533||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"},e.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var o=r(n),s=0,i=0;i<o.length;i++)s=s+this.characterLength(o[i]);return s},e.slice=function(n,o,s){textLen=e.length(n),o=o||0,s=s||1,o<0&&(o=textLen+o),s<0&&(s=textLen+s);for(var i="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],p=e.length(l);if(a>=o-(p==2?1:0))if(a+p<=s)i+=l;else break;a+=p}return i}})(Ai);var Yp=Ai.exports,Kp=xi(Yp),Jp=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},Xp=xi(Jp);function We(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Fi(t),t.length===0))return 0;t=t.replace(Xp()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let o of t){let s=o.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Kp.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var sn=10,fi=(t=0)=>e=>`\x1B[${e+t}m`,hi=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,gi=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,S={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(S.modifier);var Zp=Object.keys(S.color),Qp=Object.keys(S.bgColor);[...Zp,...Qp];function ed(){let t=new Map;for(let[e,r]of Object.entries(S)){for(let[n,o]of Object.entries(r))S[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=S[n],t.set(o[0],o[1]);Object.defineProperty(S,e,{value:r,enumerable:!1})}return Object.defineProperty(S,"codes",{value:t,enumerable:!1}),S.color.close="\x1B[39m",S.bgColor.close="\x1B[49m",S.color.ansi=fi(),S.color.ansi256=hi(),S.color.ansi16m=gi(),S.bgColor.ansi=fi(sn),S.bgColor.ansi256=hi(sn),S.bgColor.ansi16m=gi(sn),Object.defineProperties(S,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:e=>S.rgbToAnsi256(...S.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let i=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>S.ansi256ToAnsi(S.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>S.ansi256ToAnsi(S.hexToAnsi256(e)),enumerable:!1}}),S}var td=ed(),Ct=new Set(["\x1B","\x9B"]),rd=39,cn="\x07",Oi="[",nd="]",$i="m",ln=`${nd}8;;`,bi=t=>`${Ct.values().next().value}${Oi}${t}${$i}`,Ci=t=>`${Ct.values().next().value}${ln}${t}${cn}`,od=t=>t.split(" ").map(e=>We(e)),an=(t,e,r)=>{let n=[...e],o=!1,s=!1,i=We(Fi(t[t.length-1]));for(let[a,u]of n.entries()){let c=We(u);if(i+c<=r?t[t.length-1]+=u:(t.push(u),i=0),Ct.has(u)&&(o=!0,s=n.slice(a+1).join("").startsWith(ln)),o){s?u===cn&&(o=!1,s=!1):u===$i&&(o=!1);continue}i+=c,i===r&&a<n.length-1&&(t.push(""),i=0)}!i&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},id=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(We(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},sd=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,i=od(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=We(a[a.length-1]);if(c!==0&&(p>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&i[c]>e){let d=e-p,m=1+Math.floor((i[c]-d-1)/e);Math.floor((i[c]-1)/e)<m&&a.push(""),an(a,l,e);continue}if(p+i[c]>e&&p>0&&i[c]>0){if(r.wordWrap===!1&&p<e){an(a,l,e);continue}a.push("")}if(p+i[c]>e&&r.wordWrap===!1){an(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>id(c)));let u=[...a.join(`
|
|
30
|
-
`)];for(let[c,l]of u.entries()){if(n+=l,Ct.has(l)){let{groups:d}=new RegExp(`(?:\\${Oi}(?<code>\\d+)m|\\${ln}(?<uri>.*)${cn})`).exec(u.slice(c).join(""))||{groups:{}};if(d.code!==void 0){let
|
|
29
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ni(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",o="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?o=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],n=s[3],o=s[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:e})}function Qr(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0}en.Command=Zr;en.useColor=Qr});var ui=S(k=>{"use strict";var{Argument:ii}=lt(),{Command:tn}=oi(),{CommanderError:Tp,InvalidArgumentError:si}=Ve(),{Help:Ip}=Hr(),{Option:ai}=Kr();k.program=new tn;k.createCommand=t=>new tn(t);k.createOption=(t,e)=>new ai(t,e);k.createArgument=(t,e)=>new ii(t,e);k.Command=tn;k.Option=ai;k.Argument=ii;k.Help=Ip;k.CommanderError=Tp;k.InvalidArgumentError=si;k.InvalidOptionArgumentError=si});var nn=S((by,pi)=>{"use strict";var rn={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Rp={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Mp={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?rn.up():"");return t&&(e+=rn.left),e}};pi.exports={cursor:rn,scroll:Rp,erase:Mp,beep:"\x07"}});var Ge=S((Cy,on)=>{"use strict";var Dt=process||{},di=Dt.argv||[],dt=Dt.env||{},Pp=!(dt.NO_COLOR||di.includes("--no-color"))&&(!!dt.FORCE_COLOR||di.includes("--color")||Dt.platform==="win32"||(Dt.stdout||{}).isTTY&&dt.TERM!=="dumb"||!!dt.CI),kp=(t,e,r=t)=>n=>{let o=""+n,s=o.indexOf(e,t.length);return~s?t+Lp(o,e,r,s)+e:t+o+e},Lp=(t,e,r,n)=>{let o="",s=0;do o+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return o+t.substring(s)},Di=(t=Pp)=>{let e=t?kp:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};on.exports=Di();on.exports.createColors=Di});var ws=S((xw,Es)=>{"use strict";Es.exports=ys;ys.sync=wD;var bs=R("fs");function ED(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&t.substr(-o.length).toLowerCase()===o)return!0}return!1}function Cs(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:ED(e,r)}function ys(t,e,r){bs.stat(t,function(n,o){r(n,n?!1:Cs(o,t,e))})}function wD(t,e){return Cs(bs.statSync(t),t,e)}});var Os=S((Aw,As)=>{"use strict";As.exports=Ss;Ss.sync=FD;var Fs=R("fs");function Ss(t,e,r){Fs.stat(t,function(n,o){r(n,n?!1:xs(o,e))})}function FD(t,e){return xs(Fs.statSync(t),e)}function xs(t,e){return t.isFile()&&SD(t,e)}function SD(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),i=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,p=r&c||r&u&&o===i||r&a&&n===s||r&l&&s===0;return p}});var Bs=S(($w,$s)=>{"use strict";var Ow=R("fs"),Lt;process.platform==="win32"||global.TESTING_WINDOWS?Lt=ws():Lt=Os();$s.exports=An;An.sync=xD;function An(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){An(t,e||{},function(s,i){s?o(s):n(i)})})}Lt(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function xD(t,e){try{return Lt.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Ps=S((Bw,Ms)=>{"use strict";var $e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",_s=R("path"),AD=$e?";":":",vs=Bs(),Ts=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Is=(t,e)=>{let r=e.colon||AD,n=t.match(/\//)||$e&&t.match(/\\/)?[""]:[...$e?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=$e?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=$e?o.split(r):[""];return $e&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},Rs=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=Is(t,e),i=[],a=c=>new Promise((l,p)=>{if(c===n.length)return e.all&&i.length?l(i):p(Ts(t));let d=n[c],D=/^".*"$/.test(d)?d.slice(1,-1):d,f=_s.join(D,t),g=!D&&/^\.[\\\/]/.test(t)?t.slice(0,2)+f:f;l(u(g,c,0))}),u=(c,l,p)=>new Promise((d,D)=>{if(p===o.length)return d(a(l+1));let f=o[p];vs(c+f,{pathExt:s},(g,E)=>{if(!g&&E)if(e.all)i.push(c+f);else return d(c+f);return d(u(c,l,p+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},OD=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Is(t,e),s=[];for(let i=0;i<r.length;i++){let a=r[i],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=_s.join(u,t),l=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let p=0;p<n.length;p++){let d=l+n[p];try{if(vs.sync(d,{pathExt:o}))if(e.all)s.push(d);else return d}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw Ts(t)};Ms.exports=Rs;Rs.sync=OD});var Ls=S((_w,On)=>{"use strict";var ks=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};On.exports=ks;On.exports.default=ks});var Vs=S((vw,Us)=>{"use strict";var js=R("path"),$D=Ps(),BD=Ls();function Ns(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let i;try{i=$D.sync(t.command,{path:r[BD({env:r})],pathExt:e?js.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=js.resolve(o?t.options.cwd:"",i)),i}function _D(t){return Ns(t)||Ns(t,!0)}Us.exports=_D});var Gs=S((Tw,Bn)=>{"use strict";var $n=/([()\][%!^"`<>&|;, *?])/g;function vD(t){return t=t.replace($n,"^$1"),t}function TD(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace($n,"^$1"),e&&(t=t.replace($n,"^$1")),t}Bn.exports.command=vD;Bn.exports.argument=TD});var Hs=S((Iw,Ws)=>{"use strict";Ws.exports=/^#!(.*)/});var qs=S((Rw,zs)=>{"use strict";var ID=Hs();zs.exports=(t="")=>{let e=t.match(ID);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Ks=S((Mw,Ys)=>{"use strict";var _n=R("fs"),RD=qs();function MD(t){let r=Buffer.alloc(150),n;try{n=_n.openSync(t,"r"),_n.readSync(n,r,0,150,0),_n.closeSync(n)}catch{}return RD(r.toString())}Ys.exports=MD});var Qs=S((Pw,Zs)=>{"use strict";var PD=R("path"),Js=Vs(),Xs=Gs(),kD=Ks(),LD=process.platform==="win32",jD=/\.(?:com|exe)$/i,ND=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function UD(t){t.file=Js(t);let e=t.file&&kD(t.file);return e?(t.args.unshift(t.file),t.command=e,Js(t)):t.file}function VD(t){if(!LD)return t;let e=UD(t),r=!jD.test(e);if(t.options.forceShell||r){let n=ND.test(e);t.command=PD.normalize(t.command),t.command=Xs.command(t.command),t.args=t.args.map(s=>Xs.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function GD(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:VD(n)}Zs.exports=GD});var ra=S((kw,ta)=>{"use strict";var vn=process.platform==="win32";function Tn(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function WD(t,e){if(!vn)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=ea(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function ea(t,e){return vn&&t===1&&!e.file?Tn(e.original,"spawn"):null}function HD(t,e){return vn&&t===1&&!e.file?Tn(e.original,"spawnSync"):null}ta.exports={hookChildProcess:WD,verifyENOENT:ea,verifyENOENTSync:HD,notFoundError:Tn}});var ia=S((Lw,Be)=>{"use strict";var na=R("child_process"),In=Qs(),Rn=ra();function oa(t,e,r){let n=In(t,e,r),o=na.spawn(n.command,n.args,n.options);return Rn.hookChildProcess(o,n),o}function zD(t,e,r){let n=In(t,e,r),o=na.spawnSync(n.command,n.args,n.options);return o.error=o.error||Rn.verifyENOENTSync(o.status,n),o}Be.exports=oa;Be.exports.spawn=oa;Be.exports.sync=zD;Be.exports._parse=In;Be.exports._enoent=Rn});var ci=ue(ui(),1),{program:ay,createCommand:uy,createArgument:cy,createOption:ly,CommanderError:py,InvalidArgumentError:dy,InvalidOptionArgumentError:Dy,Command:li,Argument:my,Option:fy,Help:hy}=ci.default;import{stripVTControlCharacters as dn}from"util";var T=ue(nn(),1),Fi=ue(Ge(),1);import{stdin as Ei,stdout as wi}from"process";import*as ce from"readline";import mi from"readline";import{Writable as jp}from"stream";function Np({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var Up=Np();function Si(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Up,"")}function xi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ai={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var o=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,i=o;return 55296<=o&&o<=56319&&56320<=s&&s<=57343&&(o&=1023,s&=1023,i=o<<10|s,i+=65536),i==12288||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":i==8361||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||i==172||i==175||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":i==161||i==164||167<=i&&i<=168||i==170||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||i==198||i==208||215<=i&&i<=216||222<=i&&i<=225||i==230||232<=i&&i<=234||236<=i&&i<=237||i==240||242<=i&&i<=243||247<=i&&i<=250||i==252||i==254||i==257||i==273||i==275||i==283||294<=i&&i<=295||i==299||305<=i&&i<=307||i==312||319<=i&&i<=322||i==324||328<=i&&i<=331||i==333||338<=i&&i<=339||358<=i&&i<=359||i==363||i==462||i==464||i==466||i==468||i==470||i==472||i==474||i==476||i==593||i==609||i==708||i==711||713<=i&&i<=715||i==717||i==720||728<=i&&i<=731||i==733||i==735||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||i==1025||1040<=i&&i<=1103||i==1105||i==8208||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||i==8240||8242<=i&&i<=8243||i==8245||i==8251||i==8254||i==8308||i==8319||8321<=i&&i<=8324||i==8364||i==8451||i==8453||i==8457||i==8467||i==8470||8481<=i&&i<=8482||i==8486||i==8491||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||i==8585||8592<=i&&i<=8601||8632<=i&&i<=8633||i==8658||i==8660||i==8679||i==8704||8706<=i&&i<=8707||8711<=i&&i<=8712||i==8715||i==8719||i==8721||i==8725||i==8730||8733<=i&&i<=8736||i==8739||i==8741||8743<=i&&i<=8748||i==8750||8756<=i&&i<=8759||8764<=i&&i<=8765||i==8776||i==8780||i==8786||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||i==8853||i==8857||i==8869||i==8895||i==8978||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||i==9675||9678<=i&&i<=9681||9698<=i&&i<=9701||i==9711||9733<=i&&i<=9734||i==9737||9742<=i&&i<=9743||9748<=i&&i<=9749||i==9756||i==9758||i==9792||i==9794||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||i==9839||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||i==9955||9960<=i&&i<=9983||i==10045||i==10071||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||i==65533||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"},e.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var o=r(n),s=0,i=0;i<o.length;i++)s=s+this.characterLength(o[i]);return s},e.slice=function(n,o,s){textLen=e.length(n),o=o||0,s=s||1,o<0&&(o=textLen+o),s<0&&(s=textLen+s);for(var i="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],p=e.length(l);if(a>=o-(p==2?1:0))if(a+p<=s)i+=l;else break;a+=p}return i}})(Ai);var Vp=Ai.exports,Gp=xi(Vp),Wp=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},Hp=xi(Wp);function We(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Si(t),t.length===0))return 0;t=t.replace(Hp()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let o of t){let s=o.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Gp.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var sn=10,fi=(t=0)=>e=>`\x1B[${e+t}m`,hi=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,gi=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,w={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(w.modifier);var zp=Object.keys(w.color),qp=Object.keys(w.bgColor);[...zp,...qp];function Yp(){let t=new Map;for(let[e,r]of Object.entries(w)){for(let[n,o]of Object.entries(r))w[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=w[n],t.set(o[0],o[1]);Object.defineProperty(w,e,{value:r,enumerable:!1})}return Object.defineProperty(w,"codes",{value:t,enumerable:!1}),w.color.close="\x1B[39m",w.bgColor.close="\x1B[49m",w.color.ansi=fi(),w.color.ansi256=hi(),w.color.ansi16m=gi(),w.bgColor.ansi=fi(sn),w.bgColor.ansi256=hi(sn),w.bgColor.ansi16m=gi(sn),Object.defineProperties(w,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:e=>w.rgbToAnsi256(...w.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let i=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>w.ansi256ToAnsi(w.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>w.ansi256ToAnsi(w.hexToAnsi256(e)),enumerable:!1}}),w}var Kp=Yp(),Ct=new Set(["\x1B","\x9B"]),Jp=39,cn="\x07",Oi="[",Xp="]",$i="m",ln=`${Xp}8;;`,bi=t=>`${Ct.values().next().value}${Oi}${t}${$i}`,Ci=t=>`${Ct.values().next().value}${ln}${t}${cn}`,Zp=t=>t.split(" ").map(e=>We(e)),an=(t,e,r)=>{let n=[...e],o=!1,s=!1,i=We(Si(t[t.length-1]));for(let[a,u]of n.entries()){let c=We(u);if(i+c<=r?t[t.length-1]+=u:(t.push(u),i=0),Ct.has(u)&&(o=!0,s=n.slice(a+1).join("").startsWith(ln)),o){s?u===cn&&(o=!1,s=!1):u===$i&&(o=!1);continue}i+=c,i===r&&a<n.length-1&&(t.push(""),i=0)}!i&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},Qp=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(We(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},ed=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,i=Zp(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=We(a[a.length-1]);if(c!==0&&(p>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&i[c]>e){let d=e-p,D=1+Math.floor((i[c]-d-1)/e);Math.floor((i[c]-1)/e)<D&&a.push(""),an(a,l,e);continue}if(p+i[c]>e&&p>0&&i[c]>0){if(r.wordWrap===!1&&p<e){an(a,l,e);continue}a.push("")}if(p+i[c]>e&&r.wordWrap===!1){an(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>Qp(c)));let u=[...a.join(`
|
|
30
|
+
`)];for(let[c,l]of u.entries()){if(n+=l,Ct.has(l)){let{groups:d}=new RegExp(`(?:\\${Oi}(?<code>\\d+)m|\\${ln}(?<uri>.*)${cn})`).exec(u.slice(c).join(""))||{groups:{}};if(d.code!==void 0){let D=Number.parseFloat(d.code);o=D===Jp?void 0:D}else d.uri!==void 0&&(s=d.uri.length===0?void 0:d.uri)}let p=Kp.codes.get(Number(o));u[c+1]===`
|
|
31
31
|
`?(s&&(n+=Ci("")),o&&p&&(n+=bi(p))):l===`
|
|
32
|
-
`&&(o&&p&&(n+=bi(o)),s&&(n+=Ci(s)))}return n};function
|
|
32
|
+
`&&(o&&p&&(n+=bi(o)),s&&(n+=Ci(s)))}return n};function yi(t,e,r){return String(t).normalize().replace(/\r\n/g,`
|
|
33
33
|
`).split(`
|
|
34
|
-
`).map(n=>
|
|
35
|
-
`)}var
|
|
34
|
+
`).map(n=>ed(n,e,r)).join(`
|
|
35
|
+
`)}var td=["up","down","left","right","space","enter","cancel"],ft={actions:new Set(td),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function pn(t,e){if(typeof t=="string")return ft.aliases.get(t)===e;for(let r of t)if(r!==void 0&&pn(r,e))return!0;return!1}function rd(t,e){if(t===e)return;let r=t.split(`
|
|
36
36
|
`),n=e.split(`
|
|
37
|
-
`),o=[];for(let s=0;s<Math.max(r.length,n.length);s++)r[s]!==n[s]&&o.push(s);return o}var
|
|
38
|
-
`),
|
|
39
|
-
`).length-1;this.output.write(T.cursor.move(-999,e*-1))}render(){let e=
|
|
37
|
+
`),o=[];for(let s=0;s<Math.max(r.length,n.length);s++)r[s]!==n[s]&&o.push(s);return o}var nd=globalThis.process.platform.startsWith("win"),un=Symbol("clack:cancel");function fe(t){return t===un}function mt(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function Bi({input:t=Ei,output:e=wi,overwrite:r=!0,hideCursor:n=!0}={}){let o=ce.createInterface({input:t,output:e,prompt:"",tabSize:1});ce.emitKeypressEvents(t,o),t.isTTY&&t.setRawMode(!0);let s=(i,{name:a,sequence:u})=>{let c=String(i);if(pn([c,a,u],"cancel")){n&&e.write(T.cursor.show),process.exit(0);return}if(!r)return;ce.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{ce.clearLine(e,1,()=>{t.once("keypress",s)})})};return n&&e.write(T.cursor.hide),t.once("keypress",s),()=>{t.off("keypress",s),n&&e.write(T.cursor.show),t.isTTY&&!nd&&t.setRawMode(!1),o.terminal=!1,o.close()}}var od=Object.defineProperty,id=(t,e,r)=>e in t?od(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e,r)=>(id(t,typeof e!="symbol"?e+"":e,r),r),ht=class{constructor(e,r=!0){M(this,"input"),M(this,"output"),M(this,"_abortSignal"),M(this,"rl"),M(this,"opts"),M(this,"_render"),M(this,"_track",!1),M(this,"_prevFrame",""),M(this,"_subscribers",new Map),M(this,"_cursor",0),M(this,"state","initial"),M(this,"error",""),M(this,"value");let{input:n=Ei,output:o=wi,render:s,signal:i,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=s.bind(this),this._track=r,this._abortSignal=i,this.input=n,this.output=o}unsubscribe(){this._subscribers.clear()}setSubscriber(e,r){let n=this._subscribers.get(e)??[];n.push(r),this._subscribers.set(e,n)}on(e,r){this.setSubscriber(e,{cb:r})}once(e,r){this.setSubscriber(e,{cb:r,once:!0})}emit(e,...r){let n=this._subscribers.get(e)??[],o=[];for(let s of n)s.cb(...r),s.once&&o.push(()=>n.splice(n.indexOf(s),1));for(let s of o)s()}prompt(){return new Promise((e,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(un);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new jp;n._write=(o,s,i)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),i()},this.input.pipe(n),this.rl=mi.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),mi.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),mt(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(T.cursor.show),this.output.off("resize",this.render),mt(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(T.cursor.show),this.output.off("resize",this.render),mt(this.input,!1),e(un)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&ft.aliases.has(r.name)&&this.emit("cursor",ft.aliases.get(r.name)),ft.actions.has(r.name)&&this.emit("cursor",r.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(!this.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder)),this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}pn([e,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
38
|
+
`),mt(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=yi(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
39
|
+
`).length-1;this.output.write(T.cursor.move(-999,e*-1))}render(){let e=yi(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(T.cursor.hide);else{let r=rd(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(T.cursor.move(0,n)),this.output.write(T.erase.lines(1));let o=e.split(`
|
|
40
40
|
`);this.output.write(o[n]),this._prevFrame=e,this.output.write(T.cursor.move(0,o.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(T.cursor.move(0,n)),this.output.write(T.erase.down());let o=e.split(`
|
|
41
41
|
`).slice(n);this.output.write(o.join(`
|
|
42
|
-
`)),this._prevFrame=e;return}this.output.write(T.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},gt=class extends ht{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(T.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var
|
|
42
|
+
`)),this._prevFrame=e;return}this.output.write(T.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},gt=class extends ht{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(T.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var sd;sd=new WeakMap;var bt=class extends ht{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[r,...n]=this.value.slice(this.cursor);return`${e}${Fi.default.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};var m=ue(Ge(),1),yt=ue(nn(),1);import N from"process";function ad(){return N.platform!=="win32"?N.env.TERM!=="linux":!!N.env.CI||!!N.env.WT_SESSION||!!N.env.TERMINUS_SUBLIME||N.env.ConEmuTask==="{cmd::Cmder}"||N.env.TERM_PROGRAM==="Terminus-Sublime"||N.env.TERM_PROGRAM==="vscode"||N.env.TERM==="xterm-256color"||N.env.TERM==="alacritty"||N.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Dn=ad(),x=(t,e)=>Dn?t:e,ud=x("\u25C6","*"),Ii=x("\u25A0","x"),Ri=x("\u25B2","x"),Et=x("\u25C7","o"),cd=x("\u250C","T"),$=x("\u2502","|"),He=x("\u2514","\u2014"),_i=x("\u25CF",">"),vi=x("\u25CB"," "),Iy=x("\u25FB","[\u2022]"),Ry=x("\u25FC","[+]"),My=x("\u25FB","[ ]"),Py=x("\u25AA","\u2022"),Ti=x("\u2500","-"),ld=x("\u256E","+"),pd=x("\u251C","+"),dd=x("\u256F","+"),Dd=x("\u25CF","\u2022"),md=x("\u25C6","*"),fd=x("\u25B2","!"),hd=x("\u25A0","x"),Mi=t=>{switch(t){case"initial":case"active":return m.default.cyan(ud);case"cancel":return m.default.red(Ii);case"error":return m.default.yellow(Ri);case"submit":return m.default.green(Et)}};var Pi=t=>new bt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${m.default.gray($)}
|
|
43
43
|
${Mi(this.state)} ${t.message}
|
|
44
|
-
`,r=t.placeholder?
|
|
45
|
-
${
|
|
46
|
-
${
|
|
47
|
-
`;case"submit":return`${e}${
|
|
48
|
-
${
|
|
49
|
-
${
|
|
50
|
-
`}}}).prompt();var
|
|
44
|
+
`,r=t.placeholder?m.default.inverse(t.placeholder[0])+m.default.dim(t.placeholder.slice(1)):m.default.inverse(m.default.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
|
|
45
|
+
${m.default.yellow($)} ${n}
|
|
46
|
+
${m.default.yellow(He)} ${m.default.yellow(this.error)}
|
|
47
|
+
`;case"submit":return`${e}${m.default.gray($)} ${m.default.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${m.default.gray($)} ${m.default.strikethrough(m.default.dim(this.value??""))}${this.value?.trim()?`
|
|
48
|
+
${m.default.gray($)}`:""}`;default:return`${e}${m.default.cyan($)} ${n}
|
|
49
|
+
${m.default.cyan(He)}
|
|
50
|
+
`}}}).prompt();var wt=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new gt({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${m.default.gray($)}
|
|
51
51
|
${Mi(this.state)} ${t.message}
|
|
52
|
-
`,o=this.value?e:r;switch(this.state){case"submit":return`${n}${
|
|
53
|
-
${
|
|
54
|
-
${
|
|
52
|
+
`,o=this.value?e:r;switch(this.state){case"submit":return`${n}${m.default.gray($)} ${m.default.dim(o)}`;case"cancel":return`${n}${m.default.gray($)} ${m.default.strikethrough(m.default.dim(o))}
|
|
53
|
+
${m.default.gray($)}`;default:return`${n}${m.default.cyan($)} ${this.value?`${m.default.green(_i)} ${e}`:`${m.default.dim(vi)} ${m.default.dim(e)}`} ${m.default.dim("/")} ${this.value?`${m.default.dim(vi)} ${m.default.dim(r)}`:`${m.default.green(_i)} ${r}`}
|
|
54
|
+
${m.default.cyan(He)}
|
|
55
55
|
`}}}).prompt()};var ki=(t="",e="")=>{let r=`
|
|
56
56
|
${t}
|
|
57
57
|
`.split(`
|
|
58
|
-
`),n=dn(e).length,o=Math.max(r.reduce((i,a)=>{let u=dn(a);return u.length>i?u.length:i},0),n)+2,s=r.map(i=>`${
|
|
59
|
-
`);process.stdout.write(`${
|
|
60
|
-
${
|
|
58
|
+
`),n=dn(e).length,o=Math.max(r.reduce((i,a)=>{let u=dn(a);return u.length>i?u.length:i},0),n)+2,s=r.map(i=>`${m.default.gray($)} ${m.default.dim(i)}${" ".repeat(o-dn(i).length)}${m.default.gray($)}`).join(`
|
|
59
|
+
`);process.stdout.write(`${m.default.gray($)}
|
|
60
|
+
${m.default.green(Et)} ${m.default.reset(e)} ${m.default.gray(Ti.repeat(Math.max(o-n-1,1))+ld)}
|
|
61
61
|
${s}
|
|
62
|
-
${
|
|
63
|
-
`)},U=(t="")=>{process.stdout.write(`${
|
|
62
|
+
${m.default.gray(pd+Ti.repeat(o+2)+dd)}
|
|
63
|
+
`)},U=(t="")=>{process.stdout.write(`${m.default.gray(He)} ${m.default.red(t)}
|
|
64
64
|
|
|
65
|
-
`)},Li=(t="")=>{process.stdout.write(`${
|
|
66
|
-
`)},ji=(t="")=>{process.stdout.write(`${
|
|
67
|
-
${
|
|
65
|
+
`)},Li=(t="")=>{process.stdout.write(`${m.default.gray(cd)} ${t}
|
|
66
|
+
`)},ji=(t="")=>{process.stdout.write(`${m.default.gray($)}
|
|
67
|
+
${m.default.gray(He)} ${t}
|
|
68
68
|
|
|
69
|
-
`)},
|
|
70
|
-
`);r.push(`${e} ${n}`,...o.map(s=>`${
|
|
69
|
+
`)},Y={message:(t="",{symbol:e=m.default.gray($)}={})=>{let r=[`${m.default.gray($)}`];if(t){let[n,...o]=t.split(`
|
|
70
|
+
`);r.push(`${e} ${n}`,...o.map(s=>`${m.default.gray($)} ${s}`))}process.stdout.write(`${r.join(`
|
|
71
71
|
`)}
|
|
72
|
-
`)},info:t=>{
|
|
73
|
-
`);let
|
|
74
|
-
`);process.stdout.write(
|
|
75
|
-
`);let
|
|
76
|
-
`):process.stdout.write(`${
|
|
77
|
-
`),f(),o()};return{start:O,stop:v,message:(
|
|
78
|
-
`?(i-=1,a+=1):c==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=
|
|
79
|
-
`]),
|
|
72
|
+
`)},info:t=>{Y.message(t,{symbol:m.default.blue(Dd)})},success:t=>{Y.message(t,{symbol:m.default.green(md)})},step:t=>{Y.message(t,{symbol:m.default.green(Et)})},warn:t=>{Y.message(t,{symbol:m.default.yellow(fd)})},warning:t=>{Y.warn(t)},error:t=>{Y.message(t,{symbol:m.default.red(hd)})}},ky=`${m.default.gray($)} `;var Ni=({indicator:t="dots"}={})=>{let e=Dn?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=Dn?80:120,n=process.env.CI==="true",o,s,i=!1,a="",u,c=performance.now(),l=y=>{let F=y>1?"Something went wrong":"Canceled";i&&v(F,y)},p=()=>l(2),d=()=>l(1),D=()=>{process.on("uncaughtExceptionMonitor",p),process.on("unhandledRejection",p),process.on("SIGINT",d),process.on("SIGTERM",d),process.on("exit",l)},f=()=>{process.removeListener("uncaughtExceptionMonitor",p),process.removeListener("unhandledRejection",p),process.removeListener("SIGINT",d),process.removeListener("SIGTERM",d),process.removeListener("exit",l)},g=()=>{if(u===void 0)return;n&&process.stdout.write(`
|
|
73
|
+
`);let y=u.split(`
|
|
74
|
+
`);process.stdout.write(yt.cursor.move(-999,y.length-1)),process.stdout.write(yt.erase.down(y.length))},E=y=>y.replace(/\.+$/,""),C=y=>{let F=(performance.now()-y)/1e3,B=Math.floor(F/60),I=Math.floor(F%60);return B>0?`[${B}m ${I}s]`:`[${I}s]`},O=(y="")=>{i=!0,o=Bi(),a=E(y),c=performance.now(),process.stdout.write(`${m.default.gray($)}
|
|
75
|
+
`);let F=0,B=0;D(),s=setInterval(()=>{if(n&&a===u)return;g(),u=a;let I=m.default.magenta(e[F]);if(n)process.stdout.write(`${I} ${a}...`);else if(t==="timer")process.stdout.write(`${I} ${a} ${C(c)}`);else{let se=".".repeat(Math.floor(B)).slice(0,3);process.stdout.write(`${I} ${a}${se}`)}F=F+1<e.length?F+1:0,B=B<e.length?B+.125:0},r)},v=(y="",F=0)=>{i=!1,clearInterval(s),g();let B=F===0?m.default.green(Et):F===1?m.default.red(Ii):m.default.red(Ri);a=E(y??a),t==="timer"?process.stdout.write(`${B} ${a} ${C(c)}
|
|
76
|
+
`):process.stdout.write(`${B} ${a}
|
|
77
|
+
`),f(),o()};return{start:O,stop:v,message:(y="")=>{a=E(y??a)}}};var Ko=ue(Ge(),1);import gd from"net";import bd from"os";var xt=class extends Error{constructor(e){super(`${e} is locked`)}},Se={old:new Set,young:new Set},Cd=1e3*15,Ft=1024,St=65535,ze,yd=()=>{let t=bd.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(let r of Object.values(t))for(let n of r)e.add(n.address);return e},Ui=t=>new Promise((e,r)=>{let n=gd.createServer();n.unref(),n.on("error",r),n.listen(t,()=>{let{port:o}=n.address();n.close(()=>{e(o)})})}),Vi=async(t,e)=>{if(t.host||t.port===0)return Ui(t);for(let r of e)try{await Ui({port:t.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return t.port},Ed=function*(t){t&&(yield*t),yield 0};async function fn(t){let e,r=new Set;if(t&&(t.port&&(e=typeof t.port=="number"?[t.port]:t.port),t.exclude)){let o=t.exclude;if(typeof o[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(let s of o){if(typeof s!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(o)}ze===void 0&&(ze=setTimeout(()=>{ze=void 0,Se.old=Se.young,Se.young=new Set},Cd),ze.unref&&ze.unref());let n=yd();for(let o of Ed(e))try{if(r.has(o))continue;let s=await Vi({...t,port:o},n);for(;Se.old.has(s)||Se.young.has(s);){if(o!==0)throw new xt(o);s=await Vi({...t,port:o},n)}return Se.young.add(s),s}catch(s){if(!["EADDRINUSE","EACCES"].includes(s.code)&&!(s instanceof xt))throw s}throw new Error("No available ports found")}function Gi(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(t<Ft||t>St)throw new RangeError(`'from' must be between ${Ft} and ${St}`);if(e<Ft||e>St)throw new RangeError(`'to' must be between ${Ft} and ${St}`);if(t>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,o){for(let s=n;s<=o;s++)yield s}(t,e)}async function Wi(t){let e=t.directory??await Pi({message:"Where would you like to create your project?",placeholder:"./my-store",defaultValue:"./my-store",validate(s){if(!s)return"Please enter a directory"}});fe(e)&&(U("Setup cancelled."),process.exit(0));let r;if(t.noStorefront!==void 0)r=!t.noStorefront;else{let s=await wt({message:"Include Next.js storefront?",initialValue:!0});fe(s)&&(U("Setup cancelled."),process.exit(0)),r=s}let n;if(t.noSampleData!==void 0)n=!t.noSampleData;else{let s=await wt({message:"Include sample data? (products, categories, images)",initialValue:!0});fe(s)&&(U("Setup cancelled."),process.exit(0)),n=s}let o;if(t.noStart!==void 0)o=!t.noStart;else{let s=await wt({message:"Start services now? (requires Docker)",initialValue:!0});fe(s)&&(U("Setup cancelled."),process.exit(0)),o=s}return{directory:e,storefront:r,sampleData:n,start:o,packageManager:t.packageManager??"npm"}}var ie=ue(Ge(),1);import z from"fs";import q from"path";function A(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}import{fileURLToPath as wd}from"url";var xe=(t,e)=>{let r=gn(Fd(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},Fd=t=>hn(t)?t.toString():t,hn=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,gn=t=>t instanceof URL?wd(t):t;var At=(t,e=[],r={})=>{let n=xe(t,"First argument"),[o,s]=A(e)?[[],e]:[e,r];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some(u=>typeof u=="object"&&u!==null))throw new TypeError(`Second argument must be an array of strings: ${o}`);let i=o.map(String),a=i.find(u=>u.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!A(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[n,i,s]};import{ChildProcess as _d}from"child_process";import{StringDecoder as Sd}from"string_decoder";var{toString:Hi}=Object.prototype,zi=t=>Hi.call(t)==="[object ArrayBuffer]",_=t=>Hi.call(t)==="[object Uint8Array]",te=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),xd=new TextEncoder,qi=t=>xd.encode(t),Ad=new TextDecoder,Ot=t=>Ad.decode(t),Yi=(t,e)=>Od(t,e).join(""),Od=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;let r=new Sd(e),n=t.map(s=>typeof s=="string"?qi(s):s).map(s=>r.write(s)),o=r.end();return o===""?n:[...n,o]},qe=t=>t.length===1&&_(t[0])?t[0]:bn($d(t)),$d=t=>t.map(e=>typeof e=="string"?qi(e):e),bn=t=>{let e=new Uint8Array(Bd(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},Bd=t=>{let e=0;for(let r of t)e+=r.length;return e};var Zi=t=>Array.isArray(t)&&Array.isArray(t.raw),Qi=(t,e)=>{let r=[];for(let[s,i]of t.entries())r=vd({templates:t,expressions:e,tokens:r,index:s,template:i});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...o]=r;return[n,o,{}]},vd=({templates:t,expressions:e,tokens:r,index:n,template:o})=>{if(o===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:s,leadingWhitespaces:i,trailingWhitespaces:a}=Td(o,t.raw[n]),u=Ji(r,s,i);if(n===e.length)return u;let c=e[n],l=Array.isArray(c)?c.map(p=>Xi(p)):[Xi(c)];return Ji(u,l,a)},Td=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,o=Ki.has(e[0]);for(let i=0,a=0;i<t.length;i+=1,a+=1){let u=e[a];if(Ki.has(u))n!==i&&r.push(t.slice(n,i)),n=i+1;else if(u==="\\"){let c=e[a+1];c===`
|
|
78
|
+
`?(i-=1,a+=1):c==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=Id[c]??1}}let s=n===t.length;return s||r.push(t.slice(n)),{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:s}},Ki=new Set([" "," ","\r",`
|
|
79
|
+
`]),Id={x:3,u:5},Ji=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Xi=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(A(t)&&("stdout"in t||"isMaxBuffer"in t))return Rd(t);throw t instanceof _d||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},Rd=({stdout:t})=>{if(typeof t=="string")return t;if(_(t))return Ot(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};import{spawnSync as jg}from"child_process";import{debuglog as Md}from"util";import Cn from"process";var V=t=>$t.includes(t),$t=[Cn.stdin,Cn.stdout,Cn.stderr],L=["stdin","stdout","stderr"],Bt=t=>L[t]??`stdio[${t}]`;var ts=t=>{let e={...t};for(let r of wn)e[r]=yn(t,r);return e},yn=(t,e)=>{let r=Array.from({length:Pd(t)+1}),n=kd(t[e],r,e);return Vd(n,e)},Pd=({stdio:t})=>Array.isArray(t)?Math.max(t.length,L.length):L.length,kd=(t,e,r)=>A(t)?Ld(t,e,r):e.fill(t),Ld=(t,e,r)=>{for(let n of Object.keys(t).sort(jd))for(let o of Nd(n,r,e))e[o]=t[n];return e},jd=(t,e)=>es(t)<es(e)?1:-1,es=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,Nd=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=En(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid.
|
|
80
80
|
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
81
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},
|
|
81
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},En=t=>{if(t==="all")return t;if(L.includes(t))return L.indexOf(t);let e=Ud.exec(t);if(e!==null)return Number(e[1])},Ud=/^fd(\d+)$/,Vd=(t,e)=>t.map(r=>r===void 0?Wd[e]:r),Gd=Md("execa").enabled?"full":"none",Wd={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Gd,stripFinalNewline:!0},wn=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],re=(t,e)=>e==="ipc"?t.at(-1):t[e];var Ae=({verbose:t},e)=>Fn(t,e)!=="none",Oe=({verbose:t},e)=>!["none","short"].includes(Fn(t,e)),rs=({verbose:t},e)=>{let r=Fn(t,e);return _t(r)?r:void 0},Fn=(t,e)=>e===void 0?Hd(t):re(t,e),Hd=t=>t.find(e=>_t(e))??vt.findLast(e=>t.includes(e)),_t=t=>typeof t=="function",vt=["none","short","full"];import{inspect as DD}from"util";import{platform as zd}from"process";import{stripVTControlCharacters as qd}from"util";var ns=(t,e)=>{let r=[t,...e],n=r.join(" "),o=r.map(s=>Qd(os(s))).join(" ");return{command:n,escapedCommand:o}},Ye=t=>qd(t).split(`
|
|
82
82
|
`).map(e=>os(e)).join(`
|
|
83
|
-
`),os=t=>t.replaceAll(
|
|
83
|
+
`),os=t=>t.replaceAll(Jd,e=>Yd(e)),Yd=t=>{let e=Xd[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=Zd?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Kd=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Jd=Kd(),Xd={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Zd=65535,Qd=t=>eD.test(t)?t:zd==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,eD=/^[\w./-]+$/;import is from"process";function Sn(){let{env:t}=is,{TERM:e,TERM_PROGRAM:r}=t;return is.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ss={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},as={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},tD={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},rD={...ss,...as},nD={...ss,...tD},oD=Sn(),iD=oD?rD:nD,Tt=iD,fE=Object.entries(as);import sD from"tty";var aD=sD?.WriteStream?.prototype?.hasColors?.()??!1,h=(t,e)=>{if(!aD)return o=>o;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return o=>{let s=o+"",i=s.indexOf(n);if(i===-1)return r+s+n;let a=r,u=0,l=(e===22?n:"")+r;for(;i!==-1;)a+=s.slice(u,i)+l,u=i+n.length,i=s.indexOf(n,u);return a+=s.slice(u)+n,a}},bE=h(0,0),us=h(1,22),CE=h(2,22),yE=h(3,23),EE=h(4,24),wE=h(53,55),FE=h(7,27),SE=h(8,28),xE=h(9,29),AE=h(30,39),OE=h(31,39),$E=h(32,39),BE=h(33,39),_E=h(34,39),vE=h(35,39),TE=h(36,39),IE=h(37,39),It=h(90,39),RE=h(40,49),ME=h(41,49),PE=h(42,49),kE=h(43,49),LE=h(44,49),jE=h(45,49),NE=h(46,49),UE=h(47,49),VE=h(100,49),cs=h(91,39),GE=h(92,39),ls=h(93,39),WE=h(94,39),HE=h(95,39),zE=h(96,39),qE=h(97,39),YE=h(101,49),KE=h(102,49),JE=h(103,49),XE=h(104,49),ZE=h(105,49),QE=h(106,49),ew=h(107,49);var Ds=({type:t,message:e,timestamp:r,piped:n,commandId:o,result:{failed:s=!1}={},options:{reject:i=!0}})=>{let a=uD(r),u=cD[t]({failed:s,reject:i,piped:n}),c=lD[t]({reject:i});return`${It(`[${a}]`)} ${It(`[${o}]`)} ${c(u)} ${c(e)}`},uD=t=>`${Rt(t.getHours(),2)}:${Rt(t.getMinutes(),2)}:${Rt(t.getSeconds(),2)}.${Rt(t.getMilliseconds(),3)}`,Rt=(t,e)=>String(t).padStart(e,"0"),ps=({failed:t,reject:e})=>t?e?Tt.cross:Tt.warning:Tt.tick,cD={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:ps,duration:ps},ds=t=>t,lD={command:()=>us,output:()=>ds,ipc:()=>ds,error:({reject:t})=>t?cs:ls,duration:()=>It};var ms=(t,e,r)=>{let n=rs(e,r);return t.map(({verboseLine:o,verboseObject:s})=>pD(o,s,n)).filter(o=>o!==void 0).map(o=>dD(o)).join("")},pD=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},dD=t=>t.endsWith(`
|
|
84
84
|
`)?t:`${t}
|
|
85
|
-
`;var
|
|
86
|
-
`).map(r=>
|
|
87
|
-
${Pn()}`)},
|
|
88
|
-
${Pn()}`)},
|
|
89
|
-
${Pn()}`)},Pn=()=>`Available signal names: ${
|
|
90
|
-
Available signal numbers: ${
|
|
85
|
+
`;var K=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:o})=>{let s=mD({type:t,result:o,verboseInfo:n}),i=fD(e,s),a=ms(i,n,r);a!==""&&console.warn(a.slice(0,-1))},mD=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:o=!1,...s}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:o,result:e,options:s}),fD=(t,e)=>t.split(`
|
|
86
|
+
`).map(r=>hD({...e,message:r})),hD=t=>({verboseLine:Ds(t),verboseObject:t}),Mt=t=>{let e=typeof t=="string"?t:DD(t);return Ye(e).replaceAll(" "," ".repeat(gD))},gD=2;var fs=(t,e)=>{Ae(e)&&K({type:"command",verboseMessage:t,verboseInfo:e})};var hs=(t,e,r)=>{yD(t);let n=bD(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},bD=t=>Ae({verbose:t})?CD++:void 0,CD=0n,yD=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!vt.includes(e)&&!_t(e)){let r=vt.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};import{hrtime as gs}from"process";var Pt=()=>gs.bigint(),xn=t=>Number(gs.bigint()-t)/1e6;var kt=(t,e,r)=>{let n=Pt(),{command:o,escapedCommand:s}=ns(t,e),i=yn(r,"verbose"),a=hs(i,s,{...r});return fs(s,a),{command:o,escapedCommand:s,startTime:n,verboseInfo:a}};var hu=ue(ia(),1);import nf from"path";import fu from"process";import Ut from"process";import he from"path";function jt(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}import{promisify as qD}from"util";import{execFile as YD,execFileSync as Vw}from"child_process";import sa from"path";import{fileURLToPath as KD}from"url";var Hw=qD(YD);function Nt(t){return t instanceof URL?KD(t):t}function aa(t){return{*[Symbol.iterator](){let e=sa.resolve(Nt(t)),r;for(;r!==e;)yield e,r=e,e=sa.resolve(e,"..")}}}var zw=10*1024*1024;var JD=({cwd:t=Ut.cwd(),path:e=Ut.env[jt()],preferLocal:r=!0,execPath:n=Ut.execPath,addExecPath:o=!0}={})=>{let s=he.resolve(Nt(t)),i=[],a=e.split(he.delimiter);return r&&XD(i,a,s),o&&ZD(i,a,n,s),e===""||e===he.delimiter?`${i.join(he.delimiter)}${e}`:[...i,e].join(he.delimiter)},XD=(t,e,r)=>{for(let n of aa(r)){let o=he.join(n,"node_modules/.bin");e.includes(o)||t.push(o)}},ZD=(t,e,r,n)=>{let o=he.resolve(n,Nt(r),"..");e.includes(o)||t.push(o)},ua=({env:t=Ut.env,...e}={})=>{t={...t};let r=jt({env:t});return e.path=t[r],t[r]=JD(e),t};import{setTimeout as Dm}from"timers/promises";var ca=(t,e,r)=>{let n=r?Je:Ke,o=t instanceof G?{}:{cause:t};return new n(e,o)},G=class extends Error{},la=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,da,{value:!0,writable:!1,enumerable:!1,configurable:!1})},pa=t=>Vt(t)&&da in t,da=Symbol("isExecaError"),Vt=t=>Object.prototype.toString.call(t)==="[object Error]",Ke=class extends Error{};la(Ke,Ke.name);var Je=class extends Error{};la(Je,Je.name);import{constants as Xe}from"os";import{constants as rm}from"os";var Da=()=>{let t=fa-ma+1;return Array.from({length:t},QD)},QD=(t,e)=>({name:`SIGRT${e+1}`,number:ma+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),ma=34,fa=64;import{constants as em}from"os";var ha=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Mn=()=>{let t=Da();return[...ha,...t].map(tm)},tm=({name:t,number:e,description:r,action:n,forced:o=!1,standard:s})=>{let{signals:{[t]:i}}=em,a=i!==void 0;return{name:t,number:a?i:e,description:r,supported:a,action:n,forced:o,standard:s}};var nm=()=>{let t=Mn();return Object.fromEntries(t.map(om))},om=({name:t,number:e,description:r,supported:n,action:o,forced:s,standard:i})=>[t,{name:t,number:e,description:r,supported:n,action:o,forced:s,standard:i}],ga=nm(),im=()=>{let t=Mn(),e=65,r=Array.from({length:e},(n,o)=>sm(o,t));return Object.assign({},...r)},sm=(t,e)=>{let r=am(t,e);if(r===void 0)return{};let{name:n,description:o,supported:s,action:i,forced:a,standard:u}=r;return{[t]:{name:n,number:t,description:o,supported:s,action:i,forced:a,standard:u}}},am=(t,e)=>{let r=e.find(({name:n})=>rm.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},cF=im();var Ca=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return Ea(t,e)},ya=t=>t===0?t:Ea(t,"`subprocess.kill()`'s argument"),Ea=(t,e)=>{if(Number.isInteger(t))return um(t,e);if(typeof t=="string")return lm(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
87
|
+
${Pn()}`)},um=(t,e)=>{if(ba.has(t))return ba.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
|
|
88
|
+
${Pn()}`)},cm=()=>new Map(Object.entries(Xe.signals).reverse().map(([t,e])=>[e,t])),ba=cm(),lm=(t,e)=>{if(t in Xe.signals)return t;throw t.toUpperCase()in Xe.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
|
|
89
|
+
${Pn()}`)},Pn=()=>`Available signal names: ${pm()}.
|
|
90
|
+
Available signal numbers: ${dm()}.`,pm=()=>Object.keys(Xe.signals).sort().map(t=>`'${t}'`).join(", "),dm=()=>[...new Set(Object.values(Xe.signals).sort((t,e)=>t-e))].join(", "),Gt=t=>ga[t].description;var wa=t=>{if(t===!1)return t;if(t===!0)return mm;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},mm=1e3*5,Fa=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:o,controller:s},i,a)=>{let{signal:u,error:c}=fm(i,a,r);hm(c,n);let l=t(u);return gm({kill:t,signal:u,forceKillAfterDelay:e,killSignal:r,killResult:l,context:o,controller:s}),l},fm=(t,e,r)=>{let[n=r,o]=Vt(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(o!==void 0&&!Vt(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:ya(n),error:o}},hm=(t,e)=>{t!==void 0&&e.reject(t)},gm=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:o,context:s,controller:i})=>{e===n&&o&&kn({kill:t,forceKillAfterDelay:r,context:s,controllerSignal:i.signal})},kn=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await Dm(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};import{once as bm}from"events";var Wt=async(t,e)=>{t.aborted||await bm(t,"abort",{signal:e})};var Sa=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},xa=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:o})=>e===void 0||r?[]:[Cm(t,e,n,o)],Cm=async(t,e,r,{signal:n})=>{throw await Wt(e,n),r.terminationReason??="cancel",t.kill(),e.reason};import{scheduler as Nm}from"timers/promises";import{promisify as km}from"util";var _e=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{ym(t,e,r),Ln(t,e,n)},ym=(t,e,r)=>{if(!r)throw new Error(`${W(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},Ln=(t,e,r)=>{if(!r)throw new Error(`${W(t,e)} cannot be used: the ${le(e)} has already exited or disconnected.`)},Aa=t=>{throw new Error(`${W("getOneMessage",t)} could not complete: the ${le(t)} exited or disconnected.`)},Oa=t=>{throw new Error(`${W("sendMessage",t)} failed: the ${le(t)} is sending a message too, instead of listening to incoming messages.
|
|
91
91
|
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
92
92
|
|
|
93
93
|
const [receivedMessage] = await Promise.all([
|
|
94
94
|
${W("getOneMessage",t)},
|
|
95
95
|
${W("sendMessage",t,"message, {strict: true}")},
|
|
96
|
-
]);`)},Ht=(t,e)=>new Error(`${W("sendMessage",e)} failed when sending an acknowledgment response to the ${
|
|
96
|
+
]);`)},Ht=(t,e)=>new Error(`${W("sendMessage",e)} failed when sending an acknowledgment response to the ${le(e)}.`,{cause:t}),$a=t=>{throw new Error(`${W("sendMessage",t)} failed: the ${le(t)} is not listening to incoming messages.`)},Ba=t=>{throw new Error(`${W("sendMessage",t)} failed: the ${le(t)} exited without listening to incoming messages.`)},_a=()=>new Error(`\`cancelSignal\` aborted: the ${le(!0)} disconnected.`),va=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},Ta=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${W(e,r)} cannot be used: the ${le(r)} is disconnecting.`,{cause:t})},Ia=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Em(t))throw new Error(`${W(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Em=({code:t,message:e})=>wm.has(t)||Fm.some(r=>e.includes(r)),wm=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Fm=["could not be cloned","circular structure","call stack size exceeded"],W=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Sm(e)}${t}(${r})`,Sm=t=>t?"":"subprocess.",le=t=>t?"parent process":"subprocess",ve=t=>{t.connected&&t.disconnect()};var J=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)};var qt=(t,e="stdin")=>{let{options:n,fileDescriptors:o}=X.get(t),s=Ra(o,e,!0),i=t.stdio[s];if(i===null)throw new TypeError(Ma(s,e,n,!0));return i},Te=(t,e="stdout")=>{let{options:n,fileDescriptors:o}=X.get(t),s=Ra(o,e,!1),i=s==="all"?t.all:t.stdio[s];if(i==null)throw new TypeError(Ma(s,e,n,!1));return i},X=new WeakMap,Ra=(t,e,r)=>{let n=xm(e,r);return Am(n,e,r,t),n},xm=(t,e)=>{let r=En(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:o}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Ze(e)}" must not be "${t}".
|
|
97
97
|
It must be ${n} or "fd3", "fd4" (and so on).
|
|
98
|
-
It is optional and defaults to "${o}".`)},
|
|
99
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);if(o.direction==="input"&&!r)throw new TypeError(`"${Ze(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(o.direction!=="input"&&r)throw new TypeError(`"${Ze(r)}" must not be ${e}. It must be a writable stream, not readable.`)},Ma=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:o,optionValue:s}=
|
|
100
|
-
Please set this option with "pipe" instead.`},
|
|
98
|
+
It is optional and defaults to "${o}".`)},Am=(t,e,r,n)=>{let o=n[Pa(t)];if(o===void 0)throw new TypeError(`"${Ze(r)}" must not be ${e}. That file descriptor does not exist.
|
|
99
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(o.direction==="input"&&!r)throw new TypeError(`"${Ze(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(o.direction!=="input"&&r)throw new TypeError(`"${Ze(r)}" must not be ${e}. It must be a writable stream, not readable.`)},Ma=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:o,optionValue:s}=Om(t,r);return`The "${o}: ${zt(s)}" option is incompatible with using "${Ze(n)}: ${zt(e)}".
|
|
100
|
+
Please set this option with "pipe" instead.`},Om=(t,{stdin:e,stdout:r,stderr:n,stdio:o})=>{let s=Pa(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${s}]`,optionValue:o[s]}},Pa=t=>t==="all"?1:t,Ze=t=>t?"to":"from",zt=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream";import{once as Im}from"events";import{addAbortListener as $m}from"events";var ge=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),$m(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))};import{EventEmitter as vm}from"events";import{once as Bm}from"events";import{scheduler as _m}from"timers/promises";var Yt=(t,e)=>{e&&jn(t)},jn=t=>{t.refCounted()},Kt=(t,e)=>{e&&Nn(t)},Nn=t=>{t.unrefCounted()},ka=(t,e)=>{e&&(Nn(t),Nn(t))},La=(t,e)=>{e&&(jn(t),jn(t))};var ja=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},o)=>{if(Va(o)||Wa(o))return;Jt.has(t)||Jt.set(t,[]);let s=Jt.get(t);if(s.push(o),!(s.length>1))for(;s.length>0;){await Ga(t,n,o),await _m.yield();let i=await Ua({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});s.shift(),n.emit("message",i),n.emit("message:done")}},Na=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{Un();let s=Jt.get(t);for(;s?.length>0;)await Bm(n,"message:done");t.removeListener("message",o),La(e,r),n.connected=!1,n.emit("disconnect")},Jt=new WeakMap;var pe=(t,e,r)=>{if(Xt.has(t))return Xt.get(t);let n=new vm;return n.connected=!0,Xt.set(t,n),Tm({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},Xt=new WeakMap,Tm=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let o=ja.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",o),e.once("disconnect",Na.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:o})),ka(r,n)},Zt=t=>{let e=Xt.get(t);return e===void 0?t.channel!==null:e.connected};var Ha=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;let s=pe(t,e,r),i=tr(t,s);return{id:Rm++,type:er,message:n,hasListeners:i}},Rm=0n,za=(t,e)=>{if(!(e?.type!==er||e.hasListeners))for(let{id:r}of t)r!==void 0&&Qt[r].resolve({isDeadlock:!0,hasListeners:!1})},Ua=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(t?.type!==er||!e.connected)return t;let{id:s,message:i}=t,a={id:s,type:Ya,message:tr(e,o)};try{await rr({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(u){o.emit("strict:error",u)}return i},Va=t=>{if(t?.type!==Ya)return!1;let{id:e,message:r}=t;return Qt[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},qa=async(t,e,r)=>{if(t?.type!==er)return;let n=J();Qt[t.id]=n;let o=new AbortController;try{let{isDeadlock:s,hasListeners:i}=await Promise.race([n,Mm(e,r,o)]);s&&Oa(r),i||$a(r)}finally{o.abort(),delete Qt[t.id]}},Qt={},Mm=async(t,e,{signal:r})=>{ge(t,1,r),await Im(t,"disconnect",{signal:r}),Ba(e)},er="execa:ipc:request",Ya="execa:ipc:response";var Ka=(t,e,r)=>{Qe.has(t)||Qe.set(t,new Set);let n=Qe.get(t),o=J(),s=r?e.id:void 0,i={onMessageSent:o,id:s};return n.add(i),{outgoingMessages:n,outgoingMessage:i}},Ja=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},Ga=async(t,e,r)=>{for(;!tr(t,e)&&Qe.get(t)?.size>0;){let n=[...Qe.get(t)];za(n,r),await Promise.all(n.map(({onMessageSent:o})=>o))}},Qe=new WeakMap,tr=(t,e)=>e.listenerCount("message")>Pm(t),Pm=t=>X.has(t)&&!re(X.get(t).options.buffer,"ipc")?1:0;var rr=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},o,{strict:s=!1}={})=>{let i="sendMessage";return _e({methodName:i,isSubprocess:r,ipc:n,isConnected:t.connected}),Lm({anyProcess:t,channel:e,methodName:i,isSubprocess:r,message:o,strict:s})},Lm=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:o,strict:s})=>{let i=Ha({anyProcess:t,channel:e,isSubprocess:n,message:o,strict:s}),a=Ka(t,i,s);try{await Gn({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:i,message:o})}catch(u){throw ve(t),u}finally{Ja(a)}},Gn=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:o})=>{let s=jm(t);try{await Promise.all([qa(n,t,r),s(n)])}catch(i){throw Ta({error:i,methodName:e,isSubprocess:r}),Ia({error:i,methodName:e,isSubprocess:r,message:o}),i}},jm=t=>{if(Vn.has(t))return Vn.get(t);let e=km(t.send.bind(t));return Vn.set(t,e),e},Vn=new WeakMap;var Za=(t,e)=>{let r="cancelSignal";return Ln(r,!1,t.connected),Gn({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:eu,message:e},message:e})},Qa=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await Um({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),Wn.signal),Um=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!Xa){if(Xa=!0,!n){va();return}if(e===null){Un();return}pe(t,e,r),await Nm.yield()}},Xa=!1,Wa=t=>t?.type!==eu?!1:(Wn.abort(t.message),!0),eu="execa:ipc:cancel",Un=()=>{Wn.abort(_a())},Wn=new AbortController;var tu=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},ru=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:s})=>r?[Vm({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:o,controller:s})]:[],Vm=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await Wt(e,o);let s=Gm(e);throw await Za(t,s),kn({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",e.reason},Gm=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e};import{setTimeout as Wm}from"timers/promises";var nu=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},ou=(t,e,r,n)=>e===0||e===void 0?[]:[Hm(t,e,r,n)],Hm=async(t,e,r,{signal:n})=>{throw await Wm(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new G};import{execPath as zm,execArgv as qm}from"process";import iu from"path";var su=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},au=(t,e,{node:r=!1,nodePath:n=zm,nodeOptions:o=qm.filter(u=>!u.startsWith("--inspect")),cwd:s,execPath:i,...a})=>{if(i!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let u=xe(n,'The "nodePath" option'),c=iu.resolve(s,u),l={...a,nodePath:c,node:r,cwd:s};if(!r)return[t,e,l];if(iu.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[c,[...o,t,...e],{ipc:!0,...l,shell:!1}]};import{serialize as Ym}from"v8";var uu=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Xm[r](t)}},Km=t=>{try{Ym(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},Jm=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},Xm={advanced:Km,json:Jm},cu=async(t,e)=>{e!==void 0&&await t.sendMessage(e)};var pu=({encoding:t})=>{if(Hn.has(t))return;let e=Qm(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${nr(t)}\`.
|
|
101
101
|
Please rename it to ${nr(e)}.`);let r=[...Hn].map(n=>nr(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${nr(t)}\`.
|
|
102
|
-
Please rename it to one of: ${r}.`)},
|
|
103
|
-
${t.message}`,t}},
|
|
102
|
+
Please rename it to one of: ${r}.`)},Zm=new Set(["utf8","utf16le"]),P=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Hn=new Set([...Zm,...P]),Qm=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in lu)return lu[e];if(Hn.has(e))return e},lu={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},nr=t=>typeof t=="string"?`"${t}"`:String(t);import{statSync as ef}from"fs";import tf from"path";import rf from"process";var du=(t=Du())=>{let e=xe(t,'The "cwd" option');return tf.resolve(e)},Du=()=>{try{return rf.cwd()}catch(t){throw t.message=`The current directory does not exist.
|
|
103
|
+
${t.message}`,t}},mu=(t,e)=>{if(e===Du())return t;let r;try{r=ef(e)}catch(n){return`The "cwd" option is invalid: ${e}.
|
|
104
104
|
${n.message}
|
|
105
105
|
${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
|
|
106
|
-
${t}`};var or=(t,e,r)=>{r.cwd=du(r.cwd);let[n,o,s]=au(t,e,r),{command:i,args:a,options:u}=hu.default._parse(n,o,s),c=ts(u),l=
|
|
107
|
-
`,
|
|
108
|
-
${
|
|
109
|
-
`)].map(
|
|
110
|
-
|
|
111
|
-
`);return{originalMessage:
|
|
112
|
-
`):Mu(t),Mu=t=>typeof t=="string"?t:B(t)?Ot(t):"";var Dr=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:o,options:{cwd:s},startTime:i})=>ku({command:t,escapedCommand:e,cwd:s,durationMs:xn(i),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),Me=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:i})=>rt({error:t,command:e,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:i}),rt=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,stdio:p,all:d,ipcOutput:m,options:{timeoutDuration:f,timeout:g=f,forceKillAfterDelay:y,killSignal:C,cwd:O,maxBuffer:v},isSync:E})=>{let{exitCode:w,signal:_,signalDescription:I}=Qf(c,l),{originalMessage:ie,shortMessage:se,message:Lr}=Pu({stdio:p,all:d,ipcOutput:m,originalError:t,signal:_,signalDescription:I,exitCode:w,escapedCommand:r,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,forceKillAfterDelay:y,killSignal:C,maxBuffer:v,timeout:g,cwd:O}),Ue=ca(t,Lr,E);return Object.assign(Ue,Zf({error:Ue,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:w,signal:_,signalDescription:I,stdio:p,all:d,ipcOutput:m,cwd:O,originalMessage:ie,shortMessage:se})),Ue},Zf=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:p,stdio:d,all:m,ipcOutput:f,cwd:g,originalMessage:y,shortMessage:C})=>ku({shortMessage:C,originalMessage:y,command:e,escapedCommand:r,cwd:g,durationMs:xn(n),failed:!0,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:p,code:t.cause?.code,stdout:d[1],stderr:d[2],all:m,stdio:d,ipcOutput:f,pipedFrom:[]}),ku=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Qf=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,o=n===void 0?void 0:Gt(e);return{exitCode:r,signal:n,signalDescription:o}};var Lu=t=>Number.isFinite(t)?t:0;function eh(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Lu(t*1e3)%1e3),nanoseconds:Math.trunc(Lu(t*1e6)%1e3)}}function th(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Xn(t){switch(typeof t){case"number":{if(Number.isFinite(t))return eh(t);break}case"bigint":return th(t)}throw new TypeError("Expected a finite number or bigint")}var rh=t=>t===0||t===0n,nh=(t,e)=>e===1||e===1n?t:`${t}s`,oh=1e-7,ih=24n*60n*60n*1000n;function Zn(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let o=[],s=(l,p)=>{let d=Math.floor(l*10**p+oh);return(Math.round(d)/10**p).toFixed(p)},i=(l,p,d,m)=>{if(!((o.length===0||!e.colonNotation)&&rh(l)&&!(e.colonNotation&&d==="m"))){if(m??=String(l),e.colonNotation){let f=m.includes(".")?m.split(".")[0].length:m.length,g=o.length>0?2:1;m="0".repeat(Math.max(0,g-f))+m}else m+=e.verbose?" "+nh(p,l):d;o.push(m)}},a=Xn(t),u=BigInt(a.days);if(e.hideYearAndDays?i(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?i(u,"day","d"):(i(u/365n,"year","y"),i(u%365n,"day","d")),i(Number(a.hours),"hour","h")),i(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),p=Number(a.milliseconds),d=Number(a.microseconds),m=Number(a.nanoseconds);if(i(l,"second","s"),e.formatSubMilliseconds)i(p,"millisecond","ms"),i(d,"microsecond","\xB5s"),i(m,"nanosecond","ns");else{let f=p+d/1e3+m/1e6,g=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,y=f>=1?Math.round(f):Math.ceil(f),C=g?f.toFixed(g):y;i(Number.parseFloat(C),"millisecond","ms",C)}}else{let l=(r?Number(t%ih):t)/1e3%60,p=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,d=s(l,p),m=e.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");i(Number.parseFloat(m),"second","s",m)}if(o.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let c=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(o=o.slice(0,Math.max(e.unitCount,1))),n+o.join(c)}var ju=(t,e)=>{t.failed&&q({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})};var Nu=(t,e)=>{Ae(e)&&(ju(t,e),sh(t,e))},sh=(t,e)=>{let r=`(done in ${Zn(t.durationMs)})`;q({type:"duration",verboseMessage:r,verboseInfo:e,result:t})};var Pe=(t,e,{reject:r})=>{if(Nu(t,e),t.failed&&r)throw t;return t};import{readFileSync as mc}from"fs";var Gu=(t,e)=>Ce(t)?"asyncGenerator":zu(t)?"generator":fr(t)?"fileUrl":ph(t)?"filePath":Dh(t)?"webStream":H(t,{checkOpen:!1})?"native":B(t)?"uint8Array":fh(t)?"asyncIterable":hh(t)?"iterable":to(t)?Wu({transform:t},e):lh(t)?ah(t,e):"native",ah=(t,e)=>qn(t.transform,{checkOpen:!1})?uh(t,e):to(t.transform)?Wu(t,e):ch(t,e),uh=(t,e)=>(Hu(t,e,"Duplex stream"),"duplex"),Wu=(t,e)=>(Hu(t,e,"web TransformStream"),"webTransform"),Hu=({final:t,binary:e,objectMode:r},n,o)=>{Uu(t,`${n}.final`,o),Uu(e,`${n}.binary`,o),Qn(r,`${n}.objectMode`)},Uu=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},ch=({transform:t,final:e,binary:r,objectMode:n},o)=>{if(t!==void 0&&!Vu(t))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(qn(e,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(to(e))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!Vu(e))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return Qn(r,`${o}.binary`),Qn(n,`${o}.objectMode`),Ce(t)||Ce(e)?"asyncGenerator":"generator"},Qn=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},Vu=t=>Ce(t)||zu(t),Ce=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",zu=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",lh=t=>A(t)&&(t.transform!==void 0||t.final!==void 0),fr=t=>Object.prototype.toString.call(t)==="[object URL]",qu=t=>fr(t)&&t.protocol!=="file:",ph=t=>A(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>dh.has(e))&&eo(t.file),dh=new Set(["file","append"]),eo=t=>typeof t=="string",Yu=(t,e)=>t==="native"&&typeof e=="string"&&!mh.has(e),mh=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Ku=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",hr=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Dh=t=>Ku(t)||hr(t),to=t=>Ku(t?.readable)&&hr(t?.writable),fh=t=>Ju(t)&&typeof t[Symbol.asyncIterator]=="function",hh=t=>Ju(t)&&typeof t[Symbol.iterator]=="function",Ju=t=>typeof t=="object"&&t!==null,j=new Set(["generator","asyncGenerator","duplex","webTransform"]),gr=new Set(["fileUrl","filePath","fileNumber"]),ro=new Set(["fileUrl","filePath"]),Xu=new Set([...ro,"webStream","nodeStream"]),Zu=new Set(["webTransform","duplex"]),pe={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var no=(t,e,r,n)=>n==="output"?gh(t,e,r):bh(t,e,r),gh=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},bh=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,o=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:o}},Qu=(t,e)=>{let r=t.findLast(({type:n})=>j.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var ec=(t,e,r,n)=>[...t.filter(({type:o})=>!j.has(o)),...Ch(t,e,r,n)],Ch=(t,e,r,{encoding:n})=>{let o=t.filter(({type:i})=>j.has(i)),s=Array.from({length:o.length});for(let[i,a]of Object.entries(o))s[i]=Eh({stdioItem:a,index:Number(i),newTransforms:s,optionName:e,direction:r,encoding:n});return Fh(s,r)},Eh=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:o,direction:s,encoding:i})=>e==="duplex"?yh({stdioItem:t,optionName:o}):e==="webTransform"?Sh({stdioItem:t,index:r,newTransforms:n,direction:s}):wh({stdioItem:t,index:r,newTransforms:n,direction:s,encoding:i}),yh=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:s})=>{if(o&&!n)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Sh=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o})=>{let{transform:s,objectMode:i}=A(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:u}=no(i,r,n,o);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:u}}},wh=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o,encoding:s})=>{let{transform:i,final:a,binary:u=!1,preserveNewlines:c=!1,objectMode:l}=A(e)?e:{transform:e},p=u||P.has(s),{writableObjectMode:d,readableObjectMode:m}=no(l,r,n,o);return{...t,value:{transform:i,final:a,binary:p,preserveNewlines:c,writableObjectMode:d,readableObjectMode:m}}},Fh=(t,e)=>e==="input"?t.reverse():t;import oo from"process";var tc=(t,e,r)=>{let n=t.map(o=>xh(o,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??$h},xh=({type:t,value:e},r)=>Ah[r]??rc[t](e),Ah=["input","output","output"],ke=()=>{},io=()=>"input",rc={generator:ke,asyncGenerator:ke,fileUrl:ke,filePath:ke,iterable:io,asyncIterable:io,uint8Array:io,webStream:t=>hr(t)?"output":"input",nodeStream(t){return be(t,{checkOpen:!1})?zn(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:ke,duplex:ke,native(t){let e=Oh(t);if(e!==void 0)return e;if(H(t,{checkOpen:!1}))return rc.nodeStream(t)}},Oh=t=>{if([0,oo.stdin].includes(t))return"input";if([1,2,oo.stdout,oo.stderr].includes(t))return"output"},$h="output";var nc=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var oc=({stdio:t,ipc:e,buffer:r,...n},o,s)=>{let i=_h(t,n).map((a,u)=>ic(a,u));return s?vh(i,r,o):nc(i,e)},_h=(t,e)=>{if(t===void 0)return L.map(n=>e[n]);if(Bh(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${L.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,L.length);return Array.from({length:r},(n,o)=>t[o])},Bh=t=>L.some(e=>t[e]!==void 0),ic=(t,e)=>Array.isArray(t)?t.map(r=>ic(r,e)):t??(e>=L.length?"ignore":"pipe"),vh=(t,e,r)=>t.map((n,o)=>!e[o]&&o!==0&&!Oe(r,o)&&Th(n)?"ignore":n),Th=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");import{readFileSync as Ih}from"fs";import Rh from"tty";var ac=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:o,isSync:s})=>!r||e!=="native"?t:s?Mh({stdioItem:t,fdNumber:n,direction:o}):Lh({stdioItem:t,fdNumber:n}),Mh=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:o})=>{let s=Ph({value:e,optionName:r,fdNumber:n,direction:o});if(s!==void 0)return s;if(H(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Ph=({value:t,optionName:e,fdNumber:r,direction:n})=>{let o=kh(t,r);if(o!==void 0){if(n==="output")return{type:"fileNumber",value:o,optionName:e};if(Rh.isatty(o))throw new TypeError(`The \`${e}: ${zt(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Q(Ih(o)),optionName:e}}},kh=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=$t.indexOf(t);if(r!==-1)return r},Lh=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:sc(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:sc(e,e,r),optionName:r}:H(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,sc=(t,e,r)=>{let n=$t[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n};var uc=({input:t,inputFile:e},r)=>r===0?[...jh(t),...Uh(e)]:[],jh=t=>t===void 0?[]:[{type:Nh(t),value:t,optionName:"input"}],Nh=t=>{if(be(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(B(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Uh=t=>t===void 0?[]:[{...Vh(t),optionName:"inputFile"}],Vh=t=>{if(fr(t))return{type:"fileUrl",value:t};if(eo(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var cc=t=>t.filter((e,r)=>t.every((n,o)=>e.value!==n.value||r>=o||e.type==="generator"||e.type==="asyncGenerator")),lc=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:o,isSync:s})=>{let i=Gh(o,t);if(i.length!==0){if(s){Wh({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});return}if(Xu.has(t))return pc({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});Zu.has(t)&&zh({otherStdioItems:i,type:t,value:e,optionName:r})}},Gh=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(o=>o.type===e).map((o=>({...o,direction:r})))),Wh=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{ro.has(e)&&pc({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})},pc=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{let s=t.filter(a=>Hh(a,r));if(s.length===0)return;let i=s.find(a=>a.direction!==o);return dc(i,n,e),o==="output"?s[0].stream:void 0},Hh=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,zh=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let o=t.find(({value:{transform:s}})=>s===r.transform);dc(o,n,e)},dc=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${pe[r]} that is the same.`)};var br=(t,e,r,n)=>{let s=oc(e,r,n).map((a,u)=>qh({stdioOption:a,fdNumber:u,options:e,isSync:n})),i=tg({initialFileDescriptors:s,addProperties:t,options:e,isSync:n});return e.stdio=i.map(({stdioItems:a})=>og(a)),i},qh=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let o=_t(e),{stdioItems:s,isStdioArray:i}=Yh({stdioOption:t,fdNumber:e,options:r,optionName:o}),a=tc(s,e,o),u=s.map(p=>ac({stdioItem:p,isStdioArray:i,fdNumber:e,direction:a,isSync:n})),c=ec(u,o,a,r),l=Qu(c,a);return eg(c,l),{direction:a,objectMode:l,stdioItems:c}},Yh=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let s=[...(Array.isArray(t)?t:[t]).map(u=>Kh(u,n)),...uc(r,e)],i=cc(s),a=i.length>1;return Jh(i,a,n),Zh(i),{stdioItems:i,isStdioArray:a}},Kh=(t,e)=>({type:Gu(t,e),value:t,optionName:e}),Jh=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:o}of t)if(Xh.has(n))throw new Error(`The \`${o}\` option must not include \`${n}\`.`)}},Xh=new Set(["ignore","ipc"]),Zh=t=>{for(let e of t)Qh(e)},Qh=({type:t,value:e,optionName:r})=>{if(qu(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
113
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Yu(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},
|
|
114
|
-
`){let i=
|
|
106
|
+
${t}`};var or=(t,e,r)=>{r.cwd=du(r.cwd);let[n,o,s]=au(t,e,r),{command:i,args:a,options:u}=hu.default._parse(n,o,s),c=ts(u),l=of(c);return nu(l),pu(l),uu(l),Sa(l),tu(l),l.shell=gn(l.shell),l.env=sf(l),l.killSignal=Ca(l.killSignal),l.forceKillAfterDelay=wa(l.forceKillAfterDelay),l.lines=l.lines.map((p,d)=>p&&!P.has(l.encoding)&&l.buffer[d]),fu.platform==="win32"&&nf.basename(i,".exe")==="cmd"&&a.unshift("/q"),{file:i,commandArguments:a,options:l}},of=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:o="utf8",reject:s=!0,cleanup:i=!0,all:a=!1,windowsHide:u=!0,killSignal:c="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:p=!1,ipcInput:d,ipc:D=d!==void 0||p,serialization:f="advanced",...g})=>({...g,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:o,reject:s,cleanup:i,all:a,windowsHide:u,killSignal:c,forceKillAfterDelay:l,gracefulCancel:p,ipcInput:d,ipc:D,serialization:f}),sf=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:o,nodePath:s})=>{let i=e?{...fu.env,...t}:t;return r||n?ua({env:i,cwd:o,execPath:s,preferLocal:r,addExecPath:n}):i};var ir=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r];import{inspect as Nf}from"util";function Ie(t){if(typeof t=="string")return af(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return uf(t)}var af=t=>t.at(-1)===gu?t.slice(0,t.at(-2)===bu?-2:-1):t,uf=t=>t.at(-1)===cf?t.subarray(0,t.at(-2)===lf?-2:-1):t,gu=`
|
|
107
|
+
`,cf=gu.codePointAt(0),bu="\r",lf=bu.codePointAt(0);import{on as Pf}from"events";import{finished as kf}from"stream/promises";function H(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function zn(t,{checkOpen:e=!0}={}){return H(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function be(t,{checkOpen:e=!0}={}){return H(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function qn(t,e){return zn(t,e)&&be(t,e)}var pf=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),Yn=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#i();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#o(e);return this.#n?this.#n.then(r,r):r()}async#i(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#o(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},Kn=Symbol();function Cu(){return this[Kn].next()}Object.defineProperty(Cu,"name",{value:"next"});function yu(t){return this[Kn].return(t)}Object.defineProperty(yu,"name",{value:"return"});var df=Object.create(pf,{next:{enumerable:!0,configurable:!0,writable:!0,value:Cu},return:{enumerable:!0,configurable:!0,writable:!0,value:yu}});function Jn({preventCancel:t=!1}={}){let e=this.getReader(),r=new Yn(e,t),n=Object.create(df);return n[Kn]=r,n}var Eu=t=>{if(be(t,{checkOpen:!1})&&et.on!==void 0)return mf(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(Df.call(t)==="[object ReadableStream]")return Jn.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Df}=Object.prototype,mf=async function*(t){let e=new AbortController,r={};ff(t,e,r);try{for await(let[n]of et.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},ff=async(t,e,r)=>{try{await et.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},et={};var Re=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:o,addChunk:s,getFinalChunk:i,finalize:a},{maxBuffer:u=Number.POSITIVE_INFINITY}={})=>{let c=Eu(t),l=e();l.length=0;try{for await(let p of c){let d=gf(p),D=r[d](p,l);Su({convertedChunk:D,state:l,getSize:n,truncateChunk:o,addChunk:s,maxBuffer:u})}return hf({state:l,convertChunk:r,getSize:n,truncateChunk:o,addChunk:s,getFinalChunk:i,maxBuffer:u}),a(l)}catch(p){let d=typeof p=="object"&&p!==null?p:new Error(p);throw d.bufferedData=a(l),d}},hf=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:s})=>{let i=o(t);i!==void 0&&Su({convertedChunk:i,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:s})},Su=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:s})=>{let i=r(t),a=e.length+i;if(a<=s){wu(t,e,o,a);return}let u=n(t,s-e.length);throw u!==void 0&&wu(u,e,o,s),new Z},wu=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},gf=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=Fu.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&Fu.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:Fu}=Object.prototype,Z=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var ne=t=>t,tt=()=>{},sr=({contents:t})=>t,ar=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},ur=t=>t.length;async function cr(t,e){return Re(t,Ef,e)}var bf=()=>({contents:[]}),Cf=()=>1,yf=(t,{contents:e})=>(e.push(t),e),Ef={init:bf,convertChunk:{string:ne,buffer:ne,arrayBuffer:ne,dataView:ne,typedArray:ne,others:ne},getSize:Cf,truncateChunk:tt,addChunk:yf,getFinalChunk:tt,finalize:sr};async function lr(t,e){return Re(t,_f,e)}var wf=()=>({contents:new ArrayBuffer(0)}),Ff=t=>Sf.encode(t),Sf=new TextEncoder,xu=t=>new Uint8Array(t),Au=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),xf=(t,e)=>t.slice(0,e),Af=(t,{contents:e,length:r},n)=>{let o=Bu()?$f(e,n):Of(e,n);return new Uint8Array(o).set(t,r),o},Of=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer($u(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},$f=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:$u(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},$u=t=>Ou**Math.ceil(Math.log(t)/Math.log(Ou)),Ou=2,Bf=({contents:t,length:e})=>Bu()?t:t.slice(0,e),Bu=()=>"resize"in ArrayBuffer.prototype,_f={init:wf,convertChunk:{string:Ff,buffer:xu,arrayBuffer:xu,dataView:Au,typedArray:Au,others:ar},getSize:ur,truncateChunk:xf,addChunk:Af,getFinalChunk:tt,finalize:Bf};async function dr(t,e){return Re(t,Mf,e)}var vf=()=>({contents:"",textDecoder:new TextDecoder}),pr=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),Tf=(t,{contents:e})=>e+t,If=(t,e)=>t.slice(0,e),Rf=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},Mf={init:vf,convertChunk:{string:ne,buffer:pr,arrayBuffer:pr,dataView:pr,typedArray:pr,others:ar},getSize:ur,truncateChunk:If,addChunk:Tf,getFinalChunk:Rf,finalize:sr};Object.assign(et,{on:Pf,finished:kf});var _u=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:o,fdNumber:s})=>{if(!(t instanceof Z))throw t;if(s==="all")return t;let i=Lf(r,n,o);throw t.maxBufferInfo={fdNumber:s,unit:i},e.destroy(),t},Lf=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",vu=(t,e,r)=>{if(e.length!==r)return;let n=new Z;throw n.maxBufferInfo={fdNumber:"ipc"},n},Tu=(t,e)=>{let{streamName:r,threshold:n,unit:o}=jf(t,e);return`Command's ${r} was larger than ${n} ${o}`},jf=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let o=re(e,r);return r==="ipc"?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:Bt(r),threshold:o,unit:n}},Iu=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>Dr(r)),Ru=(t,e,r)=>{if(!e)return t;let n=Dr(r);return t.length>n?t.slice(0,n):t},Dr=([,t])=>t;var Pu=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:o,signalDescription:s,exitCode:i,escapedCommand:a,timedOut:u,isCanceled:c,isGracefullyCanceled:l,isMaxBuffer:p,isForcefullyTerminated:d,forceKillAfterDelay:D,killSignal:f,maxBuffer:g,timeout:E,cwd:C})=>{let O=n?.code,v=Uf({originalError:n,timedOut:u,timeout:E,isMaxBuffer:p,maxBuffer:g,errorCode:O,signal:o,signalDescription:s,exitCode:i,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:D,killSignal:f}),y=Gf(n,C),F=y===void 0?"":`
|
|
108
|
+
${y}`,B=`${v}: ${a}${F}`,I=e===void 0?[t[2],t[1]]:[e],se=[B,...I,...t.slice(3),r.map(ae=>Wf(ae)).join(`
|
|
109
|
+
`)].map(ae=>Ye(Ie(Hf(ae)))).filter(Boolean).join(`
|
|
110
|
+
|
|
111
|
+
`);return{originalMessage:y,shortMessage:B,message:se}},Uf=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:s,signal:i,signalDescription:a,exitCode:u,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:p,forceKillAfterDelay:d,killSignal:D})=>{let f=Vf(p,d);return e?`Command timed out after ${r} milliseconds${f}`:l?i===void 0?`Command was gracefully canceled with exit code ${u}`:p?`Command was gracefully canceled${f}`:`Command was gracefully canceled with ${i} (${a})`:c?`Command was canceled${f}`:n?`${Tu(t,o)}${f}`:s!==void 0?`Command failed with ${s}${f}`:p?`Command was killed with ${D} (${Gt(D)})${f}`:i!==void 0?`Command was killed with ${i} (${a})`:u!==void 0?`Command failed with exit code ${u}`:"Command failed"},Vf=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",Gf=(t,e)=>{if(t instanceof G)return;let r=pa(t)?t.originalMessage:String(t?.message??t),n=Ye(mu(r,e));return n===""?void 0:n},Wf=t=>typeof t=="string"?t:Nf(t),Hf=t=>Array.isArray(t)?t.map(e=>Ie(Mu(e))).filter(Boolean).join(`
|
|
112
|
+
`):Mu(t),Mu=t=>typeof t=="string"?t:_(t)?Ot(t):"";var mr=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:o,options:{cwd:s},startTime:i})=>ku({command:t,escapedCommand:e,cwd:s,durationMs:xn(i),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),Me=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:i})=>rt({error:t,command:e,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:i}),rt=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,stdio:p,all:d,ipcOutput:D,options:{timeoutDuration:f,timeout:g=f,forceKillAfterDelay:E,killSignal:C,cwd:O,maxBuffer:v},isSync:y})=>{let{exitCode:F,signal:B,signalDescription:I}=qf(c,l),{originalMessage:se,shortMessage:ae,message:Lr}=Pu({stdio:p,all:d,ipcOutput:D,originalError:t,signal:B,signalDescription:I,exitCode:F,escapedCommand:r,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,forceKillAfterDelay:E,killSignal:C,maxBuffer:v,timeout:g,cwd:O}),Ue=ca(t,Lr,y);return Object.assign(Ue,zf({error:Ue,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:F,signal:B,signalDescription:I,stdio:p,all:d,ipcOutput:D,cwd:O,originalMessage:se,shortMessage:ae})),Ue},zf=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:p,stdio:d,all:D,ipcOutput:f,cwd:g,originalMessage:E,shortMessage:C})=>ku({shortMessage:C,originalMessage:E,command:e,escapedCommand:r,cwd:g,durationMs:xn(n),failed:!0,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:p,code:t.cause?.code,stdout:d[1],stderr:d[2],all:D,stdio:d,ipcOutput:f,pipedFrom:[]}),ku=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),qf=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,o=n===void 0?void 0:Gt(e);return{exitCode:r,signal:n,signalDescription:o}};var Lu=t=>Number.isFinite(t)?t:0;function Yf(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Lu(t*1e3)%1e3),nanoseconds:Math.trunc(Lu(t*1e6)%1e3)}}function Kf(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Xn(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Yf(t);break}case"bigint":return Kf(t)}throw new TypeError("Expected a finite number or bigint")}var Jf=t=>t===0||t===0n,Xf=(t,e)=>e===1||e===1n?t:`${t}s`,Zf=1e-7,Qf=24n*60n*60n*1000n;function Zn(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let o=[],s=(l,p)=>{let d=Math.floor(l*10**p+Zf);return(Math.round(d)/10**p).toFixed(p)},i=(l,p,d,D)=>{if(!((o.length===0||!e.colonNotation)&&Jf(l)&&!(e.colonNotation&&d==="m"))){if(D??=String(l),e.colonNotation){let f=D.includes(".")?D.split(".")[0].length:D.length,g=o.length>0?2:1;D="0".repeat(Math.max(0,g-f))+D}else D+=e.verbose?" "+Xf(p,l):d;o.push(D)}},a=Xn(t),u=BigInt(a.days);if(e.hideYearAndDays?i(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?i(u,"day","d"):(i(u/365n,"year","y"),i(u%365n,"day","d")),i(Number(a.hours),"hour","h")),i(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),p=Number(a.milliseconds),d=Number(a.microseconds),D=Number(a.nanoseconds);if(i(l,"second","s"),e.formatSubMilliseconds)i(p,"millisecond","ms"),i(d,"microsecond","\xB5s"),i(D,"nanosecond","ns");else{let f=p+d/1e3+D/1e6,g=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,E=f>=1?Math.round(f):Math.ceil(f),C=g?f.toFixed(g):E;i(Number.parseFloat(C),"millisecond","ms",C)}}else{let l=(r?Number(t%Qf):t)/1e3%60,p=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,d=s(l,p),D=e.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");i(Number.parseFloat(D),"second","s",D)}if(o.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let c=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(o=o.slice(0,Math.max(e.unitCount,1))),n+o.join(c)}var ju=(t,e)=>{t.failed&&K({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})};var Nu=(t,e)=>{Ae(e)&&(ju(t,e),eh(t,e))},eh=(t,e)=>{let r=`(done in ${Zn(t.durationMs)})`;K({type:"duration",verboseMessage:r,verboseInfo:e,result:t})};var Pe=(t,e,{reject:r})=>{if(Nu(t,e),t.failed&&r)throw t;return t};import{readFileSync as Dc}from"fs";var Gu=(t,e)=>Ce(t)?"asyncGenerator":zu(t)?"generator":fr(t)?"fileUrl":ih(t)?"filePath":uh(t)?"webStream":H(t,{checkOpen:!1})?"native":_(t)?"uint8Array":ch(t)?"asyncIterable":lh(t)?"iterable":to(t)?Wu({transform:t},e):oh(t)?th(t,e):"native",th=(t,e)=>qn(t.transform,{checkOpen:!1})?rh(t,e):to(t.transform)?Wu(t,e):nh(t,e),rh=(t,e)=>(Hu(t,e,"Duplex stream"),"duplex"),Wu=(t,e)=>(Hu(t,e,"web TransformStream"),"webTransform"),Hu=({final:t,binary:e,objectMode:r},n,o)=>{Uu(t,`${n}.final`,o),Uu(e,`${n}.binary`,o),Qn(r,`${n}.objectMode`)},Uu=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},nh=({transform:t,final:e,binary:r,objectMode:n},o)=>{if(t!==void 0&&!Vu(t))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(qn(e,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(to(e))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!Vu(e))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return Qn(r,`${o}.binary`),Qn(n,`${o}.objectMode`),Ce(t)||Ce(e)?"asyncGenerator":"generator"},Qn=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},Vu=t=>Ce(t)||zu(t),Ce=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",zu=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",oh=t=>A(t)&&(t.transform!==void 0||t.final!==void 0),fr=t=>Object.prototype.toString.call(t)==="[object URL]",qu=t=>fr(t)&&t.protocol!=="file:",ih=t=>A(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>sh.has(e))&&eo(t.file),sh=new Set(["file","append"]),eo=t=>typeof t=="string",Yu=(t,e)=>t==="native"&&typeof e=="string"&&!ah.has(e),ah=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Ku=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",hr=t=>Object.prototype.toString.call(t)==="[object WritableStream]",uh=t=>Ku(t)||hr(t),to=t=>Ku(t?.readable)&&hr(t?.writable),ch=t=>Ju(t)&&typeof t[Symbol.asyncIterator]=="function",lh=t=>Ju(t)&&typeof t[Symbol.iterator]=="function",Ju=t=>typeof t=="object"&&t!==null,j=new Set(["generator","asyncGenerator","duplex","webTransform"]),gr=new Set(["fileUrl","filePath","fileNumber"]),ro=new Set(["fileUrl","filePath"]),Xu=new Set([...ro,"webStream","nodeStream"]),Zu=new Set(["webTransform","duplex"]),de={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var no=(t,e,r,n)=>n==="output"?ph(t,e,r):dh(t,e,r),ph=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},dh=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,o=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:o}},Qu=(t,e)=>{let r=t.findLast(({type:n})=>j.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var ec=(t,e,r,n)=>[...t.filter(({type:o})=>!j.has(o)),...Dh(t,e,r,n)],Dh=(t,e,r,{encoding:n})=>{let o=t.filter(({type:i})=>j.has(i)),s=Array.from({length:o.length});for(let[i,a]of Object.entries(o))s[i]=mh({stdioItem:a,index:Number(i),newTransforms:s,optionName:e,direction:r,encoding:n});return bh(s,r)},mh=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:o,direction:s,encoding:i})=>e==="duplex"?fh({stdioItem:t,optionName:o}):e==="webTransform"?hh({stdioItem:t,index:r,newTransforms:n,direction:s}):gh({stdioItem:t,index:r,newTransforms:n,direction:s,encoding:i}),fh=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:s})=>{if(o&&!n)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},hh=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o})=>{let{transform:s,objectMode:i}=A(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:u}=no(i,r,n,o);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:u}}},gh=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o,encoding:s})=>{let{transform:i,final:a,binary:u=!1,preserveNewlines:c=!1,objectMode:l}=A(e)?e:{transform:e},p=u||P.has(s),{writableObjectMode:d,readableObjectMode:D}=no(l,r,n,o);return{...t,value:{transform:i,final:a,binary:p,preserveNewlines:c,writableObjectMode:d,readableObjectMode:D}}},bh=(t,e)=>e==="input"?t.reverse():t;import oo from"process";var tc=(t,e,r)=>{let n=t.map(o=>Ch(o,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??wh},Ch=({type:t,value:e},r)=>yh[r]??rc[t](e),yh=["input","output","output"],ke=()=>{},io=()=>"input",rc={generator:ke,asyncGenerator:ke,fileUrl:ke,filePath:ke,iterable:io,asyncIterable:io,uint8Array:io,webStream:t=>hr(t)?"output":"input",nodeStream(t){return be(t,{checkOpen:!1})?zn(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:ke,duplex:ke,native(t){let e=Eh(t);if(e!==void 0)return e;if(H(t,{checkOpen:!1}))return rc.nodeStream(t)}},Eh=t=>{if([0,oo.stdin].includes(t))return"input";if([1,2,oo.stdout,oo.stderr].includes(t))return"output"},wh="output";var nc=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var oc=({stdio:t,ipc:e,buffer:r,...n},o,s)=>{let i=Fh(t,n).map((a,u)=>ic(a,u));return s?xh(i,r,o):nc(i,e)},Fh=(t,e)=>{if(t===void 0)return L.map(n=>e[n]);if(Sh(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${L.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,L.length);return Array.from({length:r},(n,o)=>t[o])},Sh=t=>L.some(e=>t[e]!==void 0),ic=(t,e)=>Array.isArray(t)?t.map(r=>ic(r,e)):t??(e>=L.length?"ignore":"pipe"),xh=(t,e,r)=>t.map((n,o)=>!e[o]&&o!==0&&!Oe(r,o)&&Ah(n)?"ignore":n),Ah=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");import{readFileSync as Oh}from"fs";import $h from"tty";var ac=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:o,isSync:s})=>!r||e!=="native"?t:s?Bh({stdioItem:t,fdNumber:n,direction:o}):Th({stdioItem:t,fdNumber:n}),Bh=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:o})=>{let s=_h({value:e,optionName:r,fdNumber:n,direction:o});if(s!==void 0)return s;if(H(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},_h=({value:t,optionName:e,fdNumber:r,direction:n})=>{let o=vh(t,r);if(o!==void 0){if(n==="output")return{type:"fileNumber",value:o,optionName:e};if($h.isatty(o))throw new TypeError(`The \`${e}: ${zt(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:te(Oh(o)),optionName:e}}},vh=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=$t.indexOf(t);if(r!==-1)return r},Th=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:sc(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:sc(e,e,r),optionName:r}:H(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,sc=(t,e,r)=>{let n=$t[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n};var uc=({input:t,inputFile:e},r)=>r===0?[...Ih(t),...Mh(e)]:[],Ih=t=>t===void 0?[]:[{type:Rh(t),value:t,optionName:"input"}],Rh=t=>{if(be(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(_(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Mh=t=>t===void 0?[]:[{...Ph(t),optionName:"inputFile"}],Ph=t=>{if(fr(t))return{type:"fileUrl",value:t};if(eo(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var cc=t=>t.filter((e,r)=>t.every((n,o)=>e.value!==n.value||r>=o||e.type==="generator"||e.type==="asyncGenerator")),lc=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:o,isSync:s})=>{let i=kh(o,t);if(i.length!==0){if(s){Lh({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});return}if(Xu.has(t))return pc({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});Zu.has(t)&&Nh({otherStdioItems:i,type:t,value:e,optionName:r})}},kh=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(o=>o.type===e).map((o=>({...o,direction:r})))),Lh=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{ro.has(e)&&pc({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})},pc=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{let s=t.filter(a=>jh(a,r));if(s.length===0)return;let i=s.find(a=>a.direction!==o);return dc(i,n,e),o==="output"?s[0].stream:void 0},jh=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,Nh=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let o=t.find(({value:{transform:s}})=>s===r.transform);dc(o,n,e)},dc=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${de[r]} that is the same.`)};var br=(t,e,r,n)=>{let s=oc(e,r,n).map((a,u)=>Uh({stdioOption:a,fdNumber:u,options:e,isSync:n})),i=Kh({initialFileDescriptors:s,addProperties:t,options:e,isSync:n});return e.stdio=i.map(({stdioItems:a})=>Zh(a)),i},Uh=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let o=Bt(e),{stdioItems:s,isStdioArray:i}=Vh({stdioOption:t,fdNumber:e,options:r,optionName:o}),a=tc(s,e,o),u=s.map(p=>ac({stdioItem:p,isStdioArray:i,fdNumber:e,direction:a,isSync:n})),c=ec(u,o,a,r),l=Qu(c,a);return Yh(c,l),{direction:a,objectMode:l,stdioItems:c}},Vh=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let s=[...(Array.isArray(t)?t:[t]).map(u=>Gh(u,n)),...uc(r,e)],i=cc(s),a=i.length>1;return Wh(i,a,n),zh(i),{stdioItems:i,isStdioArray:a}},Gh=(t,e)=>({type:Gu(t,e),value:t,optionName:e}),Wh=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:o}of t)if(Hh.has(n))throw new Error(`The \`${o}\` option must not include \`${n}\`.`)}},Hh=new Set(["ignore","ipc"]),zh=t=>{for(let e of t)qh(e)},qh=({type:t,value:e,optionName:r})=>{if(qu(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
113
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Yu(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Yh=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>gr.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},Kh=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let o=[];try{for(let s of t)o.push(Jh({fileDescriptor:s,fileDescriptors:o,addProperties:e,options:r,isSync:n}));return o}catch(s){throw so(o),s}},Jh=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:o,options:s,isSync:i})=>{let a=r.map(u=>Xh({stdioItem:u,addProperties:o,direction:t,options:s,fileDescriptors:n,isSync:i}));return{direction:t,objectMode:e,stdioItems:a}},Xh=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:o,isSync:s})=>{let i=lc({stdioItem:t,direction:r,fileDescriptors:o,isSync:s});return i!==void 0?{...t,stream:i}:{...t,...e[r][t.type](t,n)}},so=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!V(r)&&r.destroy()},Zh=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"};var fc=(t,e)=>br(eg,t,e,!0),Q=({type:t,optionName:e})=>{hc(e,de[t])},Qh=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&hc(t,`"${e}"`),{}),hc=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},mc={generator(){},asyncGenerator:Q,webStream:Q,nodeStream:Q,webTransform:Q,duplex:Q,asyncIterable:Q,native:Qh},eg={input:{...mc,fileUrl:({value:t})=>({contents:[te(Dc(t))]}),filePath:({value:{file:t}})=>({contents:[te(Dc(t))]}),fileNumber:Q,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...mc,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:Q,string:Q,uint8Array:Q}};var oe=(t,{stripFinalNewline:e},r)=>ao(e,r)&&t!==void 0&&!Array.isArray(t)?Ie(t):t,ao=(t,e)=>e==="all"?t[1]||t[2]:t[e];import{Transform as Eg,getDefaultHighWaterMark as Oc}from"stream";var Cr=(t,e,r,n)=>t||r?void 0:bc(e,n),co=(t,e,r)=>r?t.flatMap(n=>gc(n,e)):gc(t,e),gc=(t,e)=>{let{transform:r,final:n}=bc(e,{});return[...r(t),...n()]},bc=(t,e)=>(e.previousChunks="",{transform:tg.bind(void 0,e,t),final:ng.bind(void 0,e)}),tg=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,o=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
|
|
114
|
+
`){let i=rg(r,s,e,t),a=r.slice(o+1,s+1-i);n.length>0&&(a=uo(n,a),n=""),yield a,o=s}o!==r.length-1&&(n=uo(n,r.slice(o+1))),t.previousChunks=n},rg=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),ng=function*({previousChunks:t}){t.length>0&&(yield t)},Cc=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:og.bind(void 0,n)},og=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:o,concatBytes:s}=typeof e=="string"?ig:ag;if(e.at(-1)===o){yield e;return}yield s(e,t?n:r)},uo=(t,e)=>`${t}${e}`,ig={windowsNewline:`\r
|
|
115
115
|
`,unixNewline:`
|
|
116
116
|
`,LF:`
|
|
117
|
-
`,concatBytes:uo},
|
|
117
|
+
`,concatBytes:uo},sg=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},ag={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:sg};import{Buffer as ug}from"buffer";var yc=(t,e)=>t?void 0:cg.bind(void 0,e),cg=function*(t,e){if(typeof e!="string"&&!_(e)&&!ug.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},Ec=(t,e)=>t?lg.bind(void 0,e):pg.bind(void 0,e),lg=function*(t,e){wc(t,e),yield e},pg=function*(t,e){if(wc(t,e),typeof e!="string"&&!_(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},wc=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
118
118
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
119
|
-
if (condition) { yield value; }`)};import{Buffer as bg}from"buffer";import{StringDecoder as Cg}from"string_decoder";var Er=(t,e,r)=>{if(r)return;if(t)return{transform:Eg.bind(void 0,new TextEncoder)};let n=new Cg(e);return{transform:yg.bind(void 0,n),final:Sg.bind(void 0,n)}},Eg=function*(t,e){bg.isBuffer(e)?yield Q(e):typeof e=="string"?yield t.encode(e):yield e},yg=function*(t,e){yield B(e)?t.write(e):e},Sg=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as wc}from"util";var lo=wc(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let o of e.currentIterable)n.push(o)}finally{delete e.currentIterable}}),yr=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Fg}=e[r];for await(let o of n(t))yield*yr(o,e,r+1)},Fc=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*wg(r,Number(e),t)},wg=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*yr(n,r,e+1)},xc=wc(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Fg=function*(t){yield t};var po=(t,e,r,n)=>{try{for(let o of t(...e))r.push(o);n()}catch(o){n(o)}},Ac=(t,e)=>[...e.flatMap(r=>[...Ee(r,t,0)]),...nt(t)],Ee=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Ag}=e[r];for(let o of n(t))yield*Ee(o,e,r+1)},nt=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*xg(r,Number(e),t)},xg=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ee(n,r,e+1)},Ag=function*(t){yield t};var mo=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:o},optionName:s},{encoding:i})=>{let a={},u=$c(t,i,s),c=Ce(e),l=Ce(r),p=c?lo.bind(void 0,yr,a):po.bind(void 0,Ee),d=c||l?lo.bind(void 0,Fc,a):po.bind(void 0,nt),m=c||l?xc.bind(void 0,a):void 0;return{stream:new Og({writableObjectMode:n,writableHighWaterMark:Oc(n),readableObjectMode:o,readableHighWaterMark:Oc(o),transform(g,y,C){p([g,u,0],this,C)},flush(g){d([u],this,g)},destroy:m})}},Sr=(t,e,r,n)=>{let o=e.filter(({type:i})=>i==="generator"),s=n?o.reverse():o;for(let{value:i,optionName:a}of s){let u=$c(i,r,a);t=Ac(u,t)}return t},$c=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:s},i,a)=>{let u={};return[{transform:Ec(n,a)},Er(r,i,n),Cr(r,s,n,u),{transform:t,final:e},{transform:yc(o,a)},Cc({binary:r,preserveNewlines:s,readableObjectMode:o,state:u})].filter(Boolean)};var _c=(t,e)=>{for(let r of $g(t))_g(t,r,e)},$g=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),_g=(t,e,r)=>{let{stdioItems:n}=t[e],o=n.filter(({contents:a})=>a!==void 0);if(o.length===0)return;if(e!==0){let[{type:a,optionName:u}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${pe[a]} with synchronous methods.`)}let i=o.map(({contents:a})=>a).map(a=>Bg(a,n));r.input=qe(i)},Bg=(t,e)=>{let r=Sr(t,e,"utf8",!0);return vg(r),qe(r)},vg=t=>{let e=t.find(r=>typeof r!="string"&&!B(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as Mg,appendFileSync as Pg}from"fs";var wr=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Oe(r,n)&&!P.has(e)&&Tg(n)&&(t.some(({type:o,value:s})=>o==="native"&&Ig.has(s))||t.every(({type:o})=>j.has(o))),Tg=t=>t===1||t===2,Ig=new Set(["pipe","overlapped"]),Bc=async(t,e,r,n)=>{for await(let o of t)Rg(e)||Tc(o,r,n)},vc=(t,e,r)=>{for(let n of t)Tc(n,e,r)},Rg=t=>t._readableState.pipes.length>0,Tc=(t,e,r)=>{let n=Mt(t);q({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var Ic=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(e===null)return{output:Array.from({length:3})};let s={},i=new Set([]);return{output:e.map((u,c)=>kg({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:i,isMaxBuffer:n,verboseInfo:o},r)),...s}},kg=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:s,verboseInfo:i},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:p})=>{if(t===null)return;let d=Ru(t,s,p),m=Q(d),{stdioItems:f,objectMode:g}=e[r],y=Lg([m],f,u,n),{serializedResult:C,finalResult:O=C}=jg({chunks:y,objectMode:g,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});Ng({serializedResult:C,fdNumber:r,state:n,verboseInfo:i,encoding:u,stdioItems:f,objectMode:g});let v=a[r]?O:void 0;try{return n.error===void 0&&Ug(C,f,o),v}catch(E){return n.error=E,v}},Lg=(t,e,r,n)=>{try{return Sr(t,e,r,!1)}catch(o){return n.error=o,t}},jg=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:o,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:qe(t)};let i=Yi(t,r);return n[s]?{serializedResult:i,finalResult:co(i,!o[s],e)}:{serializedResult:i}},Ng=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:o,stdioItems:s,objectMode:i})=>{if(!wr({stdioItems:s,encoding:o,verboseInfo:n,fdNumber:e}))return;let a=co(t,!1,i);try{vc(a,e,n)}catch(u){r.error??=u}},Ug=(t,e,r)=>{for(let{path:n,append:o}of e.filter(({type:s})=>gr.has(s))){let s=typeof n=="string"?n:n.toString();o||r.has(s)?Pg(n,t):(r.add(s),Mg(n,t))}};var Rc=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,re(e,r,"all")]:Array.isArray(e)?[re(t,r,"all"),...e]:B(t)&&B(e)?bn([t,e]):`${t}${e}`};import{once as Do}from"events";var Mc=async(t,e)=>{let[r,n]=await Vg(t);return e.isForcefullyTerminated??=!1,[r,n]},Vg=async t=>{let[e,r]=await Promise.allSettled([Do(t,"spawn"),Do(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?Pc(t):r.value},Pc=async t=>{try{return await Do(t,"exit")}catch{return Pc(t)}},kc=async t=>{let[e,r]=await t;if(!Gg(e,r)&&fo(e,r))throw new G;return[e,r]},Gg=(t,e)=>t===void 0&&e===void 0,fo=(t,e)=>t!==0||e!==null;var Lc=({error:t,status:e,signal:r,output:n},{maxBuffer:o})=>{let s=Wg(t,e,r),i=s?.code==="ETIMEDOUT",a=Iu(s,n,o);return{resultError:s,exitCode:e,signal:r,timedOut:i,isMaxBuffer:a}},Wg=(t,e,r)=>t!==void 0?t:fo(e,r)?new G:void 0;var jc=(t,e,r)=>{let{file:n,commandArguments:o,command:s,escapedCommand:i,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=zg(t,e,r),p=Kg({file:n,commandArguments:o,options:c,command:s,escapedCommand:i,verboseInfo:u,fileDescriptors:l,startTime:a});return Pe(p,u,c)},zg=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=kt(t,e,r),a=qg(r),{file:u,commandArguments:c,options:l}=or(t,e,a);Yg(l);let p=fc(l,i);return{file:u,commandArguments:c,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},qg=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Yg=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&Fr("ipcInput"),t&&Fr("ipc: true"),r&&Fr("detached: true"),n&&Fr("cancelSignal")},Fr=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Kg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,verboseInfo:s,fileDescriptors:i,startTime:a})=>{let u=Jg({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:p,timedOut:d,isMaxBuffer:m}=Lc(u,r),{output:f,error:g=c}=Ic({fileDescriptors:i,syncResult:u,options:r,isMaxBuffer:m,verboseInfo:s}),y=f.map((O,v)=>re(O,r,v)),C=re(Rc(f,r),r,"all");return Zg({error:g,exitCode:l,signal:p,timedOut:d,isMaxBuffer:m,stdio:y,all:C,options:r,command:n,escapedCommand:o,startTime:a})},Jg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:i})=>{try{_c(s,r);let a=Xg(r);return Hg(...ir(t,e,a))}catch(a){return Me({error:a,command:n,escapedCommand:o,fileDescriptors:s,options:r,startTime:i,isSync:!0})}},Xg=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:mr(e)}),Zg=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:o,stdio:s,all:i,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?Dr({command:u,escapedCommand:c,stdio:s,all:i,ipcOutput:[],options:a,startTime:l}):rt({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as jC}from"events";import{spawn as NC}from"child_process";import Wc from"process";import{once as ho,on as Qg}from"events";var Nc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0,filter:s}={})=>(Be({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Zt(t)}),eb({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:o})),eb=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:o})=>{Yt(e,o);let s=le(t,e,r),i=new AbortController;try{return await Promise.race([tb(s,n,i),rb(s,r,i),nb(s,r,i)])}catch(a){throw ve(t),a}finally{i.abort(),Kt(e,o)}},tb=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await ho(t,"message",{signal:r});return n}for await(let[n]of Qg(t,"message",{signal:r}))if(e(n))return n},rb=async(t,e,{signal:r})=>{await ho(t,"disconnect",{signal:r}),Aa(e)},nb=async(t,e,{signal:r})=>{let[n]=await ho(t,"strict:error",{signal:r});throw Ht(n,e)};import{once as Vc,on as ob}from"events";var Gc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0}={})=>go({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),go=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:o,reference:s})=>{Be({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Zt(t)}),Yt(e,s);let i=le(t,e,r),a=new AbortController,u={};return ib(t,i,a),sb({ipcEmitter:i,isSubprocess:r,controller:a,state:u}),ab({anyProcess:t,channel:e,ipcEmitter:i,isSubprocess:r,shouldAwait:o,controller:a,state:u,reference:s})},ib=async(t,e,r)=>{try{await Vc(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},sb=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[o]=await Vc(t,"strict:error",{signal:r.signal});n.error=Ht(o,e),r.abort()}catch{}},ab=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:s,state:i,reference:a}){try{for await(let[u]of ob(r,"message",{signal:s.signal}))Uc(i),yield u}catch{Uc(i)}finally{s.abort(),Kt(e,a),n||ve(t),o&&await t}},Uc=({error:t})=>{if(t)throw t};var Hc=(t,{ipc:e})=>{Object.assign(t,qc(t,!1,e))},zc=()=>{let t=Wc,e=!0,r=Wc.channel!==void 0;return{...qc(t,e,r),getCancelSignal:Qa.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},qc=(t,e,r)=>({sendMessage:rr.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Nc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Gc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as ub}from"child_process";import{PassThrough as cb,Readable as lb,Writable as pb,Duplex as db}from"stream";var Yc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,verboseInfo:i})=>{so(n);let a=new ub;mb(a,n),Object.assign(a,{readable:Db,writable:fb,duplex:hb});let u=Me({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:!1}),c=gb(u,i,o);return{subprocess:a,promise:c}},mb=(t,e)=>{let r=ot(),n=ot(),o=ot(),s=Array.from({length:e.length-3},ot),i=ot(),a=[r,n,o,...s];Object.assign(t,{stdin:r,stdout:n,stderr:o,all:i,stdio:a})},ot=()=>{let t=new cb;return t.end(),t},Db=()=>new lb({read(){}}),fb=()=>new pb({write(){}}),hb=()=>new db({read(){},write(){}}),gb=async(t,e,r)=>Pe(t,e,r);import{createReadStream as Kc,createWriteStream as Jc}from"fs";import{Buffer as bb}from"buffer";import{Readable as it,Writable as Cb,Duplex as Eb}from"stream";var Zc=(t,e)=>br(yb,t,e,!1),st=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${pe[t]}.`)},Xc={fileNumber:st,generator:mo,asyncGenerator:mo,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:Eb.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},yb={input:{...Xc,fileUrl:({value:t})=>({stream:Kc(t)}),filePath:({value:{file:t}})=>({stream:Kc(t)}),webStream:({value:t})=>({stream:it.fromWeb(t)}),iterable:({value:t})=>({stream:it.from(t)}),asyncIterable:({value:t})=>({stream:it.from(t)}),string:({value:t})=>({stream:it.from(t)}),uint8Array:({value:t})=>({stream:it.from(bb.from(t))})},output:{...Xc,fileUrl:({value:t})=>({stream:Jc(t)}),filePath:({value:{file:t,append:e}})=>({stream:Jc(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:Cb.fromWeb(t)}),iterable:st,asyncIterable:st,string:st,uint8Array:st}};import{on as Sb,once as Qc}from"events";import{PassThrough as wb,getDefaultHighWaterMark as Fb}from"stream";import{finished as rl}from"stream/promises";function ye(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let o of t)Co(o);let e=t.some(({readableObjectMode:o})=>o),r=xb(t,e),n=new bo({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of t)n.add(o);return n}var xb=(t,e)=>{if(t.length===0)return Fb(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},bo=class extends wb{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(e){if(Co(e),this.#t.has(e))return;this.#t.add(e),this.#n??=Ab(this,this.#t,this.#i);let r=_b({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(Co(e),!this.#t.has(e))return!1;let r=this.#o.get(e);return r===void 0?!1:(this.#o.delete(e),e.unpipe(this),await r,!0)}},Ab=async(t,e,r)=>{xr(t,el);let n=new AbortController;try{await Promise.race([Ob(t,n),$b(t,e,r,n)])}finally{n.abort(),xr(t,-el)}},Ob=async(t,{signal:e})=>{try{await rl(t,{signal:e,cleanup:!0})}catch(r){throw nl(t,r),r}},$b=async(t,e,r,{signal:n})=>{for await(let[o]of Sb(t,"unpipe",{signal:n}))e.has(o)&&o.emit(r)},Co=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},_b=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,onFinished:s,unpipeEvent:i})=>{xr(t,tl);let a=new AbortController;try{await Promise.race([Bb(s,e,a),vb({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:a}),Tb({stream:e,streams:r,ended:n,aborted:o,unpipeEvent:i,controller:a})])}finally{a.abort(),xr(t,-tl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?Eo(t):Ib(t))},Bb=async(t,e,{signal:r})=>{try{await t,r.aborted||Eo(e)}catch(n){r.aborted||nl(e,n)}},vb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:{signal:s}})=>{try{await rl(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(i){if(s.aborted||!r.has(e))return;ol(i)?o.add(e):il(t,i)}},Tb=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:o,controller:{signal:s}})=>{if(await Qc(t,o,{signal:s}),!t.readable)return Qc(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},Ib=t=>{t.writable&&t.end()},nl=(t,e)=>{ol(e)?Eo(t):il(t,e)},ol=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Eo=t=>{(t.readable||t.writable)&&t.destroy()},il=(t,e)=>{t.destroyed||(t.once("error",Rb),t.destroy(e))},Rb=()=>{},xr=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},el=2,tl=1;import{finished as sl}from"stream/promises";var Le=(t,e)=>{t.pipe(e),Mb(t,e),Pb(t,e)},Mb=async(t,e)=>{if(!(V(t)||V(e))){try{await sl(t,{cleanup:!0,readable:!0,writable:!1})}catch{}yo(e)}},yo=t=>{t.writable&&t.end()},Pb=async(t,e)=>{if(!(V(t)||V(e))){try{await sl(e,{cleanup:!0,readable:!1,writable:!0})}catch{}So(t)}},So=t=>{t.readable&&t.destroy()};var al=(t,e,r)=>{let n=new Map;for(let[o,{stdioItems:s,direction:i}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:u})=>j.has(u)))kb(t,a,i,o);for(let{stream:a}of s.filter(({type:u})=>!j.has(u)))jb({subprocess:t,stream:a,direction:i,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,s]of n.entries()){let i=s.length===1?s[0]:ye(s);Le(i,o)}},kb=(t,e,r,n)=>{r==="output"?Le(t.stdio[n],e):Le(e,t.stdio[n]);let o=Lb[n];o!==void 0&&(t[o]=e),t.stdio[n]=e},Lb=["stdin","stdout","stderr"],jb=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:o,controller:s})=>{if(e===void 0)return;Nb(e,s);let[i,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=o.get(i)??[];o.set(i,[...u,a])},Nb=(t,{signal:e})=>{V(t)&&ge(t,Ub,e)},Ub=2;import{addAbortListener as Wb}from"events";var Se=[];Se.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Se.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Se.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Ar=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",wo=Symbol.for("signal-exit emitter"),Fo=globalThis,Vb=Object.defineProperty.bind(Object),xo=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Fo[wo])return Fo[wo];Vb(Fo,wo,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let o=!1;for(let s of this.listeners[e])o=s(r,n)===!0||o;return e==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Or=class{},Gb=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Ao=class extends Or{onExit(){return()=>{}}load(){}unload(){}},Oo=class extends Or{#t=$o.platform==="win32"?"SIGINT":"SIGHUP";#r=new xo;#e;#n;#i;#o={};#s=!1;constructor(e){super(),this.#e=e,this.#o={};for(let r of Se)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(o+=s.__signal_exit_emitter__.count),n.length===o){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||e.kill(e.pid,a)}};this.#i=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!Ar(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of Se)try{let r=this.#o[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#u(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,Se.forEach(e=>{let r=this.#o[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(e){return Ar(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#u(e,...r){let n=this.#n;if(e==="exit"&&Ar(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,e,...r)}},$o=globalThis.process,{onExit:ul,load:Z3,unload:Q3}=Gb(Ar($o)?new Oo($o):new Ao);var cl=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let o=ul(()=>{t.kill()});Wb(n,()=>{o()})};var pl=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...o)=>{let s=Pt(),{destination:i,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=Hb(r,n,o),{sourceStream:p,sourceError:d}=qb(t,c),{options:m,fileDescriptors:f}=K.get(t);return{sourcePromise:e,sourceStream:p,sourceOptions:m,sourceError:d,destination:i,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:f,startTime:s}},Hb=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:o,to:s,unpipeSignal:i}={}}=zb(t,e,...r),a=qt(n,s);return{destination:n,destinationStream:a,from:o,unpipeSignal:i}}catch(n){return{destinationError:n}}},zb=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(ll,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||hn(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,s,i]=At(r,...n);return{destination:e(ll)(o,s,i),pipeOptions:i}}if(K.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},ll=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),qb=(t,e)=>{try{return{sourceStream:Te(t,e)}}catch(r){return{sourceError:r}}};var ml=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:s,startTime:i})=>{let a=Yb({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw _o({error:a,fileDescriptors:o,sourceOptions:s,startTime:i})},Yb=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return So(t),n;if(e!==void 0)return yo(r),e},_o=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Me({error:t,command:dl,escapedCommand:dl,fileDescriptors:e,options:r,startTime:n,isSync:!1}),dl="source.pipe(destination)";var Dl=async t=>{let[{status:e,reason:r,value:n=r},{status:o,reason:s,value:i=s}]=await t;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),o==="rejected")throw i;if(e==="rejected")throw n;return i};import{finished as Kb}from"stream/promises";var fl=(t,e,r)=>{let n=$r.has(e)?Xb(t,e):Jb(t,e);return ge(t,Qb,r.signal),ge(e,eC,r.signal),Zb(e),n},Jb=(t,e)=>{let r=ye([t]);return Le(r,e),$r.set(e,r),r},Xb=(t,e)=>{let r=$r.get(e);return r.add(t),r},Zb=async t=>{try{await Kb(t,{cleanup:!0,readable:!1,writable:!0})}catch{}$r.delete(t)},$r=new WeakMap,Qb=2,eC=1;import{aborted as tC}from"util";var hl=(t,e)=>t===void 0?[]:[rC(t,e)],rC=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:s})=>{await tC(t,e),await r.remove(e);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw _o({error:i,fileDescriptors:n,sourceOptions:o,startTime:s})};var _r=(t,...e)=>{if(A(e[0]))return _r.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=pl(t,...e),o=nC({...n,destination:r});return o.pipe=_r.bind(void 0,{...t,source:r,sourcePromise:o,boundOptions:{}}),o},nC=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:o,destinationStream:s,destinationError:i,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=oC(t,o);ml({sourceStream:e,sourceError:n,destinationStream:s,destinationError:i,fileDescriptors:u,sourceOptions:r,startTime:c});let p=new AbortController;try{let d=fl(e,s,p);return await Promise.race([Dl(l),...hl(a,{sourceStream:e,mergedStream:d,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{p.abort()}},oC=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as pC}from"timers/promises";import{on as iC}from"events";import{getDefaultHighWaterMark as sC}from"stream";var Br=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:o,preserveNewlines:s})=>{let i=new AbortController;return aC(e,i),bl({stream:t,controller:i,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:o,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},aC=async(t,e)=>{try{await t}catch{}finally{e.abort()}},Bo=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:o,allMixed:s})=>{let i=new AbortController;uC(e,i,t);let a=t.readableObjectMode&&!s;return bl({stream:t,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},uC=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},bl=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})=>{let a=iC(t,"data",{signal:e.signal,highWaterMark:gl,highWatermark:gl});return cC({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})},vo=sC(!0),gl=vo,cC=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i}){let a=lC({binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i});try{for await(let[u]of t)yield*Ee(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*nt(a)}},lC=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:o})=>[Er(t,r,!e),Cr(t,o,!n,{})].filter(Boolean);var Cl=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:o,maxBuffer:s,lines:i,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{let p=dC({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:c,streamInfo:l});if(!o){await Promise.all([mC(t),p]);return}let d=ao(u,r),m=Bo({stream:t,onStreamEnd:e,lines:i,encoding:n,stripFinalNewline:d,allMixed:a}),[f]=await Promise.all([DC({stream:t,iterable:m,fdNumber:r,encoding:n,maxBuffer:s,lines:i}),p]);return f},dC=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:o,verboseInfo:s,streamInfo:{fileDescriptors:i}})=>{if(!wr({stdioItems:i[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=Bo({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await Bc(a,t,r,s)},mC=async t=>{await pC(),t.readableFlowing===null&&t.resume()},DC=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:o,maxBuffer:s,lines:i})=>{try{return e||i?await cr(r,{maxBuffer:s}):o==="buffer"?new Uint8Array(await lr(r,{maxBuffer:s})):await dr(r,{maxBuffer:s})}catch(a){return El(Bu({error:a,stream:t,readableObjectMode:e,lines:i,encoding:o,fdNumber:n}))}},To=async t=>{try{return await t}catch(e){return El(e)}},El=({bufferedData:t})=>zi(t)?new Uint8Array(t):t;import{finished as fC}from"stream/promises";var at=async(t,e,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let s=hC(t,r),i=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],fC(t,{cleanup:!0,signal:i.signal})])}catch(a){s.stdinCleanedUp||CC(a,e,r,n)}finally{i.abort()}},hC=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&gC(t,r,n),n},gC=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...o)=>{bC(e,r),n.call(t,...o)}},bC=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},CC=(t,e,r,n)=>{if(!EC(t,e,r,n))throw t},EC=(t,e,r,n=!0)=>r.propagating?yl(t)||vr(t):(r.propagating=!0,Io(r,e)===n?yl(t):vr(t)),Io=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",vr=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",yl=t=>t?.code==="EPIPE";var Sl=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>t.stdio.map((u,c)=>Ro({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:s,verboseInfo:i,streamInfo:a})),Ro=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=at(t,e,c);if(Io(c,e)){await l;return}let[p]=await Promise.all([Cl({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return p};var wl=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?ye([t,e].filter(Boolean)):void 0,Fl=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>Ro({...yC(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:SC(t),stripFinalNewline:s,verboseInfo:i,streamInfo:a}),yC=({stdout:t,stderr:e,all:r},[,n,o])=>{let s=n||o;return s?n?o?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},SC=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as wC}from"events";var xl=t=>Oe(t,"ipc"),Al=(t,e)=>{let r=Mt(t);q({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var Ol=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:s})=>{if(!n)return o;let i=xl(s),a=ee(e,"ipc"),u=ee(r,"ipc");for await(let c of go({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(vu(t,o,u),o.push(c)),i&&Al(c,s);return o},$l=async(t,e)=>(await Promise.allSettled([t]),e);var _l=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:o,timeoutDuration:s,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:p},context:d,verboseInfo:m,fileDescriptors:f,originalStreams:g,onInternalError:y,controller:C})=>{let O=Mc(t,d),v={originalStreams:g,fileDescriptors:f,subprocess:t,exitPromise:O,propagating:!1},E=Sl({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:m,streamInfo:v}),w=Fl({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:m,streamInfo:v}),_=[],I=Ol({subprocess:t,buffer:r,maxBuffer:n,ipc:l,ipcOutput:_,verboseInfo:m}),ie=FC(g,t,v),se=xC(f,v);try{return await Promise.race([Promise.all([{},kc(O),Promise.all(E),w,I,cu(t,p),...ie,...se]),y,AC(t,C),...ou(t,s,d,C),...xa({subprocess:t,cancelSignal:i,gracefulCancel:a,context:d,controller:C}),...ru({subprocess:t,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,context:d,controller:C})])}catch(Lr){return d.terminationReason??="other",Promise.all([{error:Lr},O,Promise.all(E.map(Ue=>To(Ue))),To(w),$l(I,_),Promise.allSettled(ie),Promise.allSettled(se)])}},FC=(t,e,r)=>t.map((n,o)=>n===e.stdio[o]?void 0:at(n,o,r)),xC=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:s=o})=>H(s,{checkOpen:!1})&&!V(s)).map(({type:o,value:s,stream:i=s})=>at(i,n,e,{isSameDirection:j.has(o),stopOnExit:o==="native"}))),AC=async(t,{signal:e})=>{let[r]=await wC(t,"error",{signal:e});throw r};var Bl=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),ut=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let o=n.get(e),s=Y();return o.push(s),{resolve:s.resolve.bind(s),promises:o}},je=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as OC}from"stream";import{callbackify as $C}from"util";import{finished as vl}from"stream/promises";var Mo=async t=>{if(t!==void 0)try{await Po(t)}catch{}},Tl=async t=>{if(t!==void 0)try{await ko(t)}catch{}},Po=async t=>{await vl(t,{cleanup:!0,readable:!1,writable:!0})},ko=async t=>{await vl(t,{cleanup:!0,readable:!0,writable:!1})},Tr=async(t,e)=>{if(await t,e)throw e},Ir=(t,e,r)=>{r&&!vr(r)?t.destroy(r):e&&t.destroy()};var Il=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:o=!0,preserveNewlines:s=!0}={})=>{let i=o||P.has(r),{subprocessStdout:a,waitReadableDestroy:u}=Lo(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:p}=jo(a,i),{read:d,onStdoutDataDone:m}=No({subprocessStdout:a,subprocess:t,binary:i,encoding:r,preserveNewlines:s}),f=new OC({read:d,destroy:$C(Vo.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:p,objectMode:l,encoding:c});return Uo({subprocessStdout:a,onStdoutDataDone:m,readable:f,subprocess:t}),f},Lo=(t,e,r)=>{let n=Te(t,e),o=ut(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},jo=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:vo},No=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:o})=>{let s=Y(),i=Br({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){_C(this,i,s)},onStdoutDataDone:s}},_C=async(t,e,r)=>{try{let{value:n,done:o}=await e.next();o?r.resolve():t.push(n)}catch{}},Uo=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:o})=>{try{await ko(t),await n,await Mo(o),await e,r.readable&&r.push(null)}catch(s){await Mo(o),Rl(r,s)}},Vo=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await je(r,e)&&(Rl(t,n),await Tr(e,n))},Rl=(t,e)=>{Ir(t,t.readable,e)};import{Writable as BC}from"stream";import{callbackify as Ml}from"util";var Pl=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}=Go(t,r,e),i=new BC({...Wo(n,t,o),destroy:Ml(zo.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:o,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Ho(n,i),i},Go=(t,e,r)=>{let n=qt(t,e),o=ut(r,n,"writableFinal"),s=ut(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}},Wo=(t,e,r)=>({write:vC.bind(void 0,t),final:Ml(TC.bind(void 0,t,e,r))}),vC=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},TC=async(t,e,r)=>{await je(r,e)&&(t.writable&&t.end(),await e)},Ho=async(t,e,r)=>{try{await Po(t),e.writable&&e.end()}catch(n){await Tl(r),kl(e,n)}},zo=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await je(r,e),await je(n,e)&&(kl(t,o),await Tr(e,o))},kl=(t,e)=>{Ir(t,t.writable,e)};import{Duplex as IC}from"stream";import{callbackify as RC}from"util";var Ll=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:o,binary:s=!0,preserveNewlines:i=!0}={})=>{let a=s||P.has(r),{subprocessStdout:u,waitReadableDestroy:c}=Lo(t,n,e),{subprocessStdin:l,waitWritableFinal:p,waitWritableDestroy:d}=Go(t,o,e),{readableEncoding:m,readableObjectMode:f,readableHighWaterMark:g}=jo(u,a),{read:y,onStdoutDataDone:C}=No({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:i}),O=new IC({read:y,...Wo(l,t,p),destroy:RC(MC.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:p,waitWritableDestroy:d})),readableHighWaterMark:g,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:f,writableObjectMode:l.writableObjectMode,encoding:m});return Uo({subprocessStdout:u,onStdoutDataDone:C,readable:O,subprocess:t,subprocessStdin:l}),Ho(l,O,u),O},MC=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:s},i)=>{await Promise.all([Vo({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},i),zo({subprocessStdin:e,subprocess:r,waitWritableFinal:o,waitWritableDestroy:s},i)])};var qo=(t,e,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let s=n||P.has(e),i=Te(t,r),a=Br({subprocessStdout:i,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:o});return PC(a,i,t)},PC=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var jl=(t,{encoding:e})=>{let r=Bl();t.readable=Il.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=Pl.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Ll.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=qo.bind(void 0,t,e),t[Symbol.asyncIterator]=qo.bind(void 0,t,e,{})};var Nl=(t,e)=>{for(let[r,n]of LC){let o=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:o})}},kC=(async()=>{})().constructor.prototype,LC=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(kC,t)]);var Ul=(t,e,r,n)=>{let{file:o,commandArguments:s,command:i,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:p}=UC(t,e,r),{subprocess:d,promise:m}=GC({file:o,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:i,escapedCommand:a,fileDescriptors:p});return d.pipe=_r.bind(void 0,{source:d,sourcePromise:m,boundOptions:{},createNested:n}),Nl(d,m),K.set(d,{options:l,fileDescriptors:p}),d},UC=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=kt(t,e,r),{file:a,commandArguments:u,options:c}=or(t,e,r),l=VC(c),p=Zc(l,i);return{file:a,commandArguments:u,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},VC=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},GC=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:o,command:s,escapedCommand:i,fileDescriptors:a})=>{let u;try{u=NC(...ir(t,e,r))}catch(f){return Yc({error:f,command:s,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}let c=new AbortController;jC(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];al(u,a,c),cl(u,r,c);let p={},d=Y();u.kill=wa.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:d,context:p,controller:c}),u.all=wl(u,r),jl(u,r),Hc(u,r);let m=WC({subprocess:u,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:i,context:p,onInternalError:d,controller:c});return{subprocess:u,promise:m}},WC=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:s,command:i,escapedCommand:a,context:u,onInternalError:c,controller:l})=>{let[p,[d,m],f,g,y]=await _l({subprocess:t,options:e,context:u,verboseInfo:n,fileDescriptors:o,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();let C=f.map((E,w)=>re(E,e,w)),O=re(g,e,"all"),v=HC({errorInfo:p,exitCode:d,signal:m,stdio:C,all:O,ipcOutput:y,context:u,options:e,command:i,escapedCommand:a,startTime:r});return Pe(v,n,e)},HC=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,context:i,options:a,command:u,escapedCommand:c,startTime:l})=>"error"in t?rt({error:t.error,command:u,escapedCommand:c,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof J,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,options:a,startTime:l,isSync:!1}):Dr({command:u,escapedCommand:c,stdio:n,all:o,ipcOutput:s,options:a,startTime:l});var Rr=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,o])=>[n,zC(n,t[n],o)]));return{...t,...r}},zC=(t,e,r)=>qC.has(t)&&A(e)&&A(r)?{...e,...r}:r,qC=new Set(["env",...Sn]);var de=(t,e,r,n)=>{let o=(i,a,u)=>de(i,a,r,u),s=(...i)=>YC({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:o},...i);return n!==void 0&&n(s,o,e),s},YC=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:o},s,...i)=>{if(A(s))return o(t,Rr(r,s),n);let{file:a,commandArguments:u,options:c,isSync:l}=KC({mapArguments:t,firstArgument:s,nextArguments:i,deepOptions:e,boundOptions:r});return l?jc(a,u,c):Ul(a,u,c,o)},KC=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:o})=>{let s=Zi(e)?Qi(e,r):[e,...r],[i,a,u]=At(...s),c=Rr(Rr(n,o),u),{file:l=i,commandArguments:p=a,options:d=c,isSync:m=!1}=t({file:i,commandArguments:a,options:c});return{file:l,commandArguments:p,options:d,isSync:m}};var Vl=({file:t,commandArguments:e})=>Wl(t,e),Gl=({file:t,commandArguments:e})=>({...Wl(t,e),isSync:!0}),Wl=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=JC(t);return{file:r,commandArguments:n}},JC=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(XC)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},XC=/ +/g;var Hl=(t,e,r)=>{t.sync=e(ZC,r),t.s=t.sync},zl=({options:t})=>ql(t),ZC=({options:t})=>({...ql(t),isSync:!0}),ql=t=>({options:{...QC(t),...t}}),QC=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Yl={preferLocal:!0};var me=de(()=>({})),V8=de(()=>({isSync:!0})),Kl=de(Vl),G8=de(Gl),W8=de(su),H8=de(zl,{},Yl,Hl),{sendMessage:z8,getOneMessage:q8,getEachMessage:Y8,getCancelSignal:K8}=zc();var Jl="ghcr.io/spree/spree",Xl="latest";var Zl="https://github.com/spree/storefront.git",Ql="https://github.com/spree/spree-starter.git",Mr="spree@example.com",Pr="spree123";import eE from"crypto";function ep(){let t=process.env.npm_config_user_agent??"";return t.startsWith("yarn")?"yarn":t.startsWith("pnpm")?"pnpm":"npm"}async function tp(){try{return await Kl("docker info",{stdio:"ignore"}),!0}catch{return!1}}function rp(){return eE.randomBytes(64).toString("hex")}function Yo(t){return t==="yarn"?"yarn":`${t} install`}function np(t){return t?` image: ${Jl}:\${SPREE_VERSION_TAG:-${Xl}}`:` build:
|
|
120
|
-
context: ./backend
|
|
121
|
-
dockerfile: Dockerfile`}function op(t){return`x-app: &app
|
|
122
|
-
${t}
|
|
123
|
-
depends_on:
|
|
124
|
-
postgres:
|
|
125
|
-
condition: service_healthy
|
|
126
|
-
redis:
|
|
127
|
-
condition: service_healthy
|
|
128
|
-
env_file: .env
|
|
129
|
-
environment: &app-env
|
|
130
|
-
DATABASE_URL: postgres://postgres@postgres:5432/spree_production
|
|
131
|
-
REDIS_URL: redis://redis:6379/0
|
|
132
|
-
SECRET_KEY_BASE: \${SECRET_KEY_BASE}
|
|
133
|
-
RAILS_FORCE_SSL: "false"
|
|
134
|
-
RAILS_ASSUME_SSL: "false"
|
|
135
|
-
SMTP_HOST: mailpit
|
|
136
|
-
SMTP_PORT: "1025"
|
|
137
|
-
|
|
138
|
-
services:
|
|
139
|
-
postgres:
|
|
140
|
-
image: postgres:18-alpine
|
|
141
|
-
environment:
|
|
142
|
-
POSTGRES_HOST_AUTH_METHOD: trust
|
|
143
|
-
volumes:
|
|
144
|
-
- postgres_data:/var/lib/postgresql/data
|
|
145
|
-
healthcheck:
|
|
146
|
-
test: pg_isready -U postgres
|
|
147
|
-
interval: 5s
|
|
148
|
-
timeout: 5s
|
|
149
|
-
retries: 5
|
|
150
|
-
|
|
151
|
-
redis:
|
|
152
|
-
image: redis:7-alpine
|
|
153
|
-
volumes:
|
|
154
|
-
- redis_data:/data
|
|
155
|
-
healthcheck:
|
|
156
|
-
test: redis-cli ping
|
|
157
|
-
interval: 5s
|
|
158
|
-
timeout: 5s
|
|
159
|
-
retries: 5
|
|
160
|
-
|
|
161
|
-
mailpit:
|
|
162
|
-
image: axllent/mailpit
|
|
163
|
-
ports:
|
|
164
|
-
- "8025:8025"
|
|
165
|
-
- "1025:1025"
|
|
166
|
-
|
|
167
|
-
web:
|
|
168
|
-
<<: *app
|
|
169
|
-
ports:
|
|
170
|
-
- "\${SPREE_PORT:-3000}:3000"
|
|
171
|
-
healthcheck:
|
|
172
|
-
test: curl -f http://localhost:3000/up || exit 1
|
|
173
|
-
interval: 10s
|
|
174
|
-
timeout: 5s
|
|
175
|
-
retries: 10
|
|
176
|
-
start_period: 30s
|
|
177
|
-
|
|
178
|
-
worker:
|
|
179
|
-
<<: *app
|
|
180
|
-
command: bundle exec sidekiq
|
|
181
|
-
|
|
182
|
-
volumes:
|
|
183
|
-
postgres_data:
|
|
184
|
-
redis_data:
|
|
185
|
-
`}function ip(){return op(np(!0))}function sp(){return op(np(!1))}function ap(t,e){return`SECRET_KEY_BASE=${t}
|
|
119
|
+
if (condition) { yield value; }`)};import{Buffer as dg}from"buffer";import{StringDecoder as Dg}from"string_decoder";var yr=(t,e,r)=>{if(r)return;if(t)return{transform:mg.bind(void 0,new TextEncoder)};let n=new Dg(e);return{transform:fg.bind(void 0,n),final:hg.bind(void 0,n)}},mg=function*(t,e){dg.isBuffer(e)?yield te(e):typeof e=="string"?yield t.encode(e):yield e},fg=function*(t,e){yield _(e)?t.write(e):e},hg=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as Fc}from"util";var lo=Fc(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let o of e.currentIterable)n.push(o)}finally{delete e.currentIterable}}),Er=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=bg}=e[r];for await(let o of n(t))yield*Er(o,e,r+1)},Sc=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*gg(r,Number(e),t)},gg=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*Er(n,r,e+1)},xc=Fc(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),bg=function*(t){yield t};var po=(t,e,r,n)=>{try{for(let o of t(...e))r.push(o);n()}catch(o){n(o)}},Ac=(t,e)=>[...e.flatMap(r=>[...ye(r,t,0)]),...nt(t)],ye=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=yg}=e[r];for(let o of n(t))yield*ye(o,e,r+1)},nt=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Cg(r,Number(e),t)},Cg=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ye(n,r,e+1)},yg=function*(t){yield t};var Do=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:o},optionName:s},{encoding:i})=>{let a={},u=$c(t,i,s),c=Ce(e),l=Ce(r),p=c?lo.bind(void 0,Er,a):po.bind(void 0,ye),d=c||l?lo.bind(void 0,Sc,a):po.bind(void 0,nt),D=c||l?xc.bind(void 0,a):void 0;return{stream:new Eg({writableObjectMode:n,writableHighWaterMark:Oc(n),readableObjectMode:o,readableHighWaterMark:Oc(o),transform(g,E,C){p([g,u,0],this,C)},flush(g){d([u],this,g)},destroy:D})}},wr=(t,e,r,n)=>{let o=e.filter(({type:i})=>i==="generator"),s=n?o.reverse():o;for(let{value:i,optionName:a}of s){let u=$c(i,r,a);t=Ac(u,t)}return t},$c=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:s},i,a)=>{let u={};return[{transform:yc(n,a)},yr(r,i,n),Cr(r,s,n,u),{transform:t,final:e},{transform:Ec(o,a)},Cc({binary:r,preserveNewlines:s,readableObjectMode:o,state:u})].filter(Boolean)};var Bc=(t,e)=>{for(let r of wg(t))Fg(t,r,e)},wg=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Fg=(t,e,r)=>{let{stdioItems:n}=t[e],o=n.filter(({contents:a})=>a!==void 0);if(o.length===0)return;if(e!==0){let[{type:a,optionName:u}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${de[a]} with synchronous methods.`)}let i=o.map(({contents:a})=>a).map(a=>Sg(a,n));r.input=qe(i)},Sg=(t,e)=>{let r=wr(t,e,"utf8",!0);return xg(r),qe(r)},xg=t=>{let e=t.find(r=>typeof r!="string"&&!_(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as Bg,appendFileSync as _g}from"fs";var Fr=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Oe(r,n)&&!P.has(e)&&Ag(n)&&(t.some(({type:o,value:s})=>o==="native"&&Og.has(s))||t.every(({type:o})=>j.has(o))),Ag=t=>t===1||t===2,Og=new Set(["pipe","overlapped"]),_c=async(t,e,r,n)=>{for await(let o of t)$g(e)||Tc(o,r,n)},vc=(t,e,r)=>{for(let n of t)Tc(n,e,r)},$g=t=>t._readableState.pipes.length>0,Tc=(t,e,r)=>{let n=Mt(t);K({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var Ic=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(e===null)return{output:Array.from({length:3})};let s={},i=new Set([]);return{output:e.map((u,c)=>vg({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:i,isMaxBuffer:n,verboseInfo:o},r)),...s}},vg=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:s,verboseInfo:i},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:p})=>{if(t===null)return;let d=Ru(t,s,p),D=te(d),{stdioItems:f,objectMode:g}=e[r],E=Tg([D],f,u,n),{serializedResult:C,finalResult:O=C}=Ig({chunks:E,objectMode:g,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});Rg({serializedResult:C,fdNumber:r,state:n,verboseInfo:i,encoding:u,stdioItems:f,objectMode:g});let v=a[r]?O:void 0;try{return n.error===void 0&&Mg(C,f,o),v}catch(y){return n.error=y,v}},Tg=(t,e,r,n)=>{try{return wr(t,e,r,!1)}catch(o){return n.error=o,t}},Ig=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:o,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:qe(t)};let i=Yi(t,r);return n[s]?{serializedResult:i,finalResult:co(i,!o[s],e)}:{serializedResult:i}},Rg=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:o,stdioItems:s,objectMode:i})=>{if(!Fr({stdioItems:s,encoding:o,verboseInfo:n,fdNumber:e}))return;let a=co(t,!1,i);try{vc(a,e,n)}catch(u){r.error??=u}},Mg=(t,e,r)=>{for(let{path:n,append:o}of e.filter(({type:s})=>gr.has(s))){let s=typeof n=="string"?n:n.toString();o||r.has(s)?_g(n,t):(r.add(s),Bg(n,t))}};var Rc=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,oe(e,r,"all")]:Array.isArray(e)?[oe(t,r,"all"),...e]:_(t)&&_(e)?bn([t,e]):`${t}${e}`};import{once as mo}from"events";var Mc=async(t,e)=>{let[r,n]=await Pg(t);return e.isForcefullyTerminated??=!1,[r,n]},Pg=async t=>{let[e,r]=await Promise.allSettled([mo(t,"spawn"),mo(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?Pc(t):r.value},Pc=async t=>{try{return await mo(t,"exit")}catch{return Pc(t)}},kc=async t=>{let[e,r]=await t;if(!kg(e,r)&&fo(e,r))throw new G;return[e,r]},kg=(t,e)=>t===void 0&&e===void 0,fo=(t,e)=>t!==0||e!==null;var Lc=({error:t,status:e,signal:r,output:n},{maxBuffer:o})=>{let s=Lg(t,e,r),i=s?.code==="ETIMEDOUT",a=Iu(s,n,o);return{resultError:s,exitCode:e,signal:r,timedOut:i,isMaxBuffer:a}},Lg=(t,e,r)=>t!==void 0?t:fo(e,r)?new G:void 0;var jc=(t,e,r)=>{let{file:n,commandArguments:o,command:s,escapedCommand:i,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=Ng(t,e,r),p=Gg({file:n,commandArguments:o,options:c,command:s,escapedCommand:i,verboseInfo:u,fileDescriptors:l,startTime:a});return Pe(p,u,c)},Ng=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=kt(t,e,r),a=Ug(r),{file:u,commandArguments:c,options:l}=or(t,e,a);Vg(l);let p=fc(l,i);return{file:u,commandArguments:c,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},Ug=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Vg=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&Sr("ipcInput"),t&&Sr("ipc: true"),r&&Sr("detached: true"),n&&Sr("cancelSignal")},Sr=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Gg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,verboseInfo:s,fileDescriptors:i,startTime:a})=>{let u=Wg({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:p,timedOut:d,isMaxBuffer:D}=Lc(u,r),{output:f,error:g=c}=Ic({fileDescriptors:i,syncResult:u,options:r,isMaxBuffer:D,verboseInfo:s}),E=f.map((O,v)=>oe(O,r,v)),C=oe(Rc(f,r),r,"all");return zg({error:g,exitCode:l,signal:p,timedOut:d,isMaxBuffer:D,stdio:E,all:C,options:r,command:n,escapedCommand:o,startTime:a})},Wg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:i})=>{try{Bc(s,r);let a=Hg(r);return jg(...ir(t,e,a))}catch(a){return Me({error:a,command:n,escapedCommand:o,fileDescriptors:s,options:r,startTime:i,isSync:!0})}},Hg=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Dr(e)}),zg=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:o,stdio:s,all:i,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?mr({command:u,escapedCommand:c,stdio:s,all:i,ipcOutput:[],options:a,startTime:l}):rt({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as IC}from"events";import{spawn as RC}from"child_process";import Wc from"process";import{once as ho,on as qg}from"events";var Nc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0,filter:s}={})=>(_e({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Zt(t)}),Yg({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:o})),Yg=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:o})=>{Yt(e,o);let s=pe(t,e,r),i=new AbortController;try{return await Promise.race([Kg(s,n,i),Jg(s,r,i),Xg(s,r,i)])}catch(a){throw ve(t),a}finally{i.abort(),Kt(e,o)}},Kg=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await ho(t,"message",{signal:r});return n}for await(let[n]of qg(t,"message",{signal:r}))if(e(n))return n},Jg=async(t,e,{signal:r})=>{await ho(t,"disconnect",{signal:r}),Aa(e)},Xg=async(t,e,{signal:r})=>{let[n]=await ho(t,"strict:error",{signal:r});throw Ht(n,e)};import{once as Vc,on as Zg}from"events";var Gc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0}={})=>go({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),go=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:o,reference:s})=>{_e({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Zt(t)}),Yt(e,s);let i=pe(t,e,r),a=new AbortController,u={};return Qg(t,i,a),eb({ipcEmitter:i,isSubprocess:r,controller:a,state:u}),tb({anyProcess:t,channel:e,ipcEmitter:i,isSubprocess:r,shouldAwait:o,controller:a,state:u,reference:s})},Qg=async(t,e,r)=>{try{await Vc(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},eb=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[o]=await Vc(t,"strict:error",{signal:r.signal});n.error=Ht(o,e),r.abort()}catch{}},tb=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:s,state:i,reference:a}){try{for await(let[u]of Zg(r,"message",{signal:s.signal}))Uc(i),yield u}catch{Uc(i)}finally{s.abort(),Kt(e,a),n||ve(t),o&&await t}},Uc=({error:t})=>{if(t)throw t};var Hc=(t,{ipc:e})=>{Object.assign(t,qc(t,!1,e))},zc=()=>{let t=Wc,e=!0,r=Wc.channel!==void 0;return{...qc(t,e,r),getCancelSignal:Qa.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},qc=(t,e,r)=>({sendMessage:rr.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Nc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Gc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as rb}from"child_process";import{PassThrough as nb,Readable as ob,Writable as ib,Duplex as sb}from"stream";var Yc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,verboseInfo:i})=>{so(n);let a=new rb;ab(a,n),Object.assign(a,{readable:ub,writable:cb,duplex:lb});let u=Me({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:!1}),c=pb(u,i,o);return{subprocess:a,promise:c}},ab=(t,e)=>{let r=ot(),n=ot(),o=ot(),s=Array.from({length:e.length-3},ot),i=ot(),a=[r,n,o,...s];Object.assign(t,{stdin:r,stdout:n,stderr:o,all:i,stdio:a})},ot=()=>{let t=new nb;return t.end(),t},ub=()=>new ob({read(){}}),cb=()=>new ib({write(){}}),lb=()=>new sb({read(){},write(){}}),pb=async(t,e,r)=>Pe(t,e,r);import{createReadStream as Kc,createWriteStream as Jc}from"fs";import{Buffer as db}from"buffer";import{Readable as it,Writable as Db,Duplex as mb}from"stream";var Zc=(t,e)=>br(fb,t,e,!1),st=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${de[t]}.`)},Xc={fileNumber:st,generator:Do,asyncGenerator:Do,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:mb.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},fb={input:{...Xc,fileUrl:({value:t})=>({stream:Kc(t)}),filePath:({value:{file:t}})=>({stream:Kc(t)}),webStream:({value:t})=>({stream:it.fromWeb(t)}),iterable:({value:t})=>({stream:it.from(t)}),asyncIterable:({value:t})=>({stream:it.from(t)}),string:({value:t})=>({stream:it.from(t)}),uint8Array:({value:t})=>({stream:it.from(db.from(t))})},output:{...Xc,fileUrl:({value:t})=>({stream:Jc(t)}),filePath:({value:{file:t,append:e}})=>({stream:Jc(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:Db.fromWeb(t)}),iterable:st,asyncIterable:st,string:st,uint8Array:st}};import{on as hb,once as Qc}from"events";import{PassThrough as gb,getDefaultHighWaterMark as bb}from"stream";import{finished as rl}from"stream/promises";function Ee(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let o of t)Co(o);let e=t.some(({readableObjectMode:o})=>o),r=Cb(t,e),n=new bo({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of t)n.add(o);return n}var Cb=(t,e)=>{if(t.length===0)return bb(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},bo=class extends gb{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(e){if(Co(e),this.#t.has(e))return;this.#t.add(e),this.#n??=yb(this,this.#t,this.#i);let r=Fb({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(Co(e),!this.#t.has(e))return!1;let r=this.#o.get(e);return r===void 0?!1:(this.#o.delete(e),e.unpipe(this),await r,!0)}},yb=async(t,e,r)=>{xr(t,el);let n=new AbortController;try{await Promise.race([Eb(t,n),wb(t,e,r,n)])}finally{n.abort(),xr(t,-el)}},Eb=async(t,{signal:e})=>{try{await rl(t,{signal:e,cleanup:!0})}catch(r){throw nl(t,r),r}},wb=async(t,e,r,{signal:n})=>{for await(let[o]of hb(t,"unpipe",{signal:n}))e.has(o)&&o.emit(r)},Co=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Fb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,onFinished:s,unpipeEvent:i})=>{xr(t,tl);let a=new AbortController;try{await Promise.race([Sb(s,e,a),xb({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:a}),Ab({stream:e,streams:r,ended:n,aborted:o,unpipeEvent:i,controller:a})])}finally{a.abort(),xr(t,-tl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?yo(t):Ob(t))},Sb=async(t,e,{signal:r})=>{try{await t,r.aborted||yo(e)}catch(n){r.aborted||nl(e,n)}},xb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:{signal:s}})=>{try{await rl(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(i){if(s.aborted||!r.has(e))return;ol(i)?o.add(e):il(t,i)}},Ab=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:o,controller:{signal:s}})=>{if(await Qc(t,o,{signal:s}),!t.readable)return Qc(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},Ob=t=>{t.writable&&t.end()},nl=(t,e)=>{ol(e)?yo(t):il(t,e)},ol=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",yo=t=>{(t.readable||t.writable)&&t.destroy()},il=(t,e)=>{t.destroyed||(t.once("error",$b),t.destroy(e))},$b=()=>{},xr=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},el=2,tl=1;import{finished as sl}from"stream/promises";var Le=(t,e)=>{t.pipe(e),Bb(t,e),_b(t,e)},Bb=async(t,e)=>{if(!(V(t)||V(e))){try{await sl(t,{cleanup:!0,readable:!0,writable:!1})}catch{}Eo(e)}},Eo=t=>{t.writable&&t.end()},_b=async(t,e)=>{if(!(V(t)||V(e))){try{await sl(e,{cleanup:!0,readable:!1,writable:!0})}catch{}wo(t)}},wo=t=>{t.readable&&t.destroy()};var al=(t,e,r)=>{let n=new Map;for(let[o,{stdioItems:s,direction:i}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:u})=>j.has(u)))vb(t,a,i,o);for(let{stream:a}of s.filter(({type:u})=>!j.has(u)))Ib({subprocess:t,stream:a,direction:i,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,s]of n.entries()){let i=s.length===1?s[0]:Ee(s);Le(i,o)}},vb=(t,e,r,n)=>{r==="output"?Le(t.stdio[n],e):Le(e,t.stdio[n]);let o=Tb[n];o!==void 0&&(t[o]=e),t.stdio[n]=e},Tb=["stdin","stdout","stderr"],Ib=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:o,controller:s})=>{if(e===void 0)return;Rb(e,s);let[i,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=o.get(i)??[];o.set(i,[...u,a])},Rb=(t,{signal:e})=>{V(t)&&ge(t,Mb,e)},Mb=2;import{addAbortListener as Lb}from"events";var we=[];we.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&we.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&we.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Ar=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Fo=Symbol.for("signal-exit emitter"),So=globalThis,Pb=Object.defineProperty.bind(Object),xo=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(So[Fo])return So[Fo];Pb(So,Fo,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let o=!1;for(let s of this.listeners[e])o=s(r,n)===!0||o;return e==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Or=class{},kb=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Ao=class extends Or{onExit(){return()=>{}}load(){}unload(){}},Oo=class extends Or{#t=$o.platform==="win32"?"SIGINT":"SIGHUP";#r=new xo;#e;#n;#i;#o={};#s=!1;constructor(e){super(),this.#e=e,this.#o={};for(let r of we)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(o+=s.__signal_exit_emitter__.count),n.length===o){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||e.kill(e.pid,a)}};this.#i=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!Ar(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of we)try{let r=this.#o[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#u(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,we.forEach(e=>{let r=this.#o[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(e){return Ar(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#u(e,...r){let n=this.#n;if(e==="exit"&&Ar(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,e,...r)}},$o=globalThis.process,{onExit:ul,load:z3,unload:q3}=kb(Ar($o)?new Oo($o):new Ao);var cl=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let o=ul(()=>{t.kill()});Lb(n,()=>{o()})};var pl=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...o)=>{let s=Pt(),{destination:i,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=jb(r,n,o),{sourceStream:p,sourceError:d}=Ub(t,c),{options:D,fileDescriptors:f}=X.get(t);return{sourcePromise:e,sourceStream:p,sourceOptions:D,sourceError:d,destination:i,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:f,startTime:s}},jb=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:o,to:s,unpipeSignal:i}={}}=Nb(t,e,...r),a=qt(n,s);return{destination:n,destinationStream:a,from:o,unpipeSignal:i}}catch(n){return{destinationError:n}}},Nb=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(ll,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||hn(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,s,i]=At(r,...n);return{destination:e(ll)(o,s,i),pipeOptions:i}}if(X.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},ll=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Ub=(t,e)=>{try{return{sourceStream:Te(t,e)}}catch(r){return{sourceError:r}}};var Dl=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:s,startTime:i})=>{let a=Vb({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw Bo({error:a,fileDescriptors:o,sourceOptions:s,startTime:i})},Vb=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return wo(t),n;if(e!==void 0)return Eo(r),e},Bo=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Me({error:t,command:dl,escapedCommand:dl,fileDescriptors:e,options:r,startTime:n,isSync:!1}),dl="source.pipe(destination)";var ml=async t=>{let[{status:e,reason:r,value:n=r},{status:o,reason:s,value:i=s}]=await t;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),o==="rejected")throw i;if(e==="rejected")throw n;return i};import{finished as Gb}from"stream/promises";var fl=(t,e,r)=>{let n=$r.has(e)?Hb(t,e):Wb(t,e);return ge(t,qb,r.signal),ge(e,Yb,r.signal),zb(e),n},Wb=(t,e)=>{let r=Ee([t]);return Le(r,e),$r.set(e,r),r},Hb=(t,e)=>{let r=$r.get(e);return r.add(t),r},zb=async t=>{try{await Gb(t,{cleanup:!0,readable:!1,writable:!0})}catch{}$r.delete(t)},$r=new WeakMap,qb=2,Yb=1;import{aborted as Kb}from"util";var hl=(t,e)=>t===void 0?[]:[Jb(t,e)],Jb=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:s})=>{await Kb(t,e),await r.remove(e);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw Bo({error:i,fileDescriptors:n,sourceOptions:o,startTime:s})};var Br=(t,...e)=>{if(A(e[0]))return Br.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=pl(t,...e),o=Xb({...n,destination:r});return o.pipe=Br.bind(void 0,{...t,source:r,sourcePromise:o,boundOptions:{}}),o},Xb=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:o,destinationStream:s,destinationError:i,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=Zb(t,o);Dl({sourceStream:e,sourceError:n,destinationStream:s,destinationError:i,fileDescriptors:u,sourceOptions:r,startTime:c});let p=new AbortController;try{let d=fl(e,s,p);return await Promise.race([ml(l),...hl(a,{sourceStream:e,mergedStream:d,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{p.abort()}},Zb=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as iC}from"timers/promises";import{on as Qb}from"events";import{getDefaultHighWaterMark as eC}from"stream";var _r=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:o,preserveNewlines:s})=>{let i=new AbortController;return tC(e,i),bl({stream:t,controller:i,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:o,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},tC=async(t,e)=>{try{await t}catch{}finally{e.abort()}},_o=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:o,allMixed:s})=>{let i=new AbortController;rC(e,i,t);let a=t.readableObjectMode&&!s;return bl({stream:t,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},rC=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},bl=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})=>{let a=Qb(t,"data",{signal:e.signal,highWaterMark:gl,highWatermark:gl});return nC({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})},vo=eC(!0),gl=vo,nC=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i}){let a=oC({binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i});try{for await(let[u]of t)yield*ye(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*nt(a)}},oC=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:o})=>[yr(t,r,!e),Cr(t,o,!n,{})].filter(Boolean);var Cl=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:o,maxBuffer:s,lines:i,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{let p=sC({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:c,streamInfo:l});if(!o){await Promise.all([aC(t),p]);return}let d=ao(u,r),D=_o({stream:t,onStreamEnd:e,lines:i,encoding:n,stripFinalNewline:d,allMixed:a}),[f]=await Promise.all([uC({stream:t,iterable:D,fdNumber:r,encoding:n,maxBuffer:s,lines:i}),p]);return f},sC=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:o,verboseInfo:s,streamInfo:{fileDescriptors:i}})=>{if(!Fr({stdioItems:i[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=_o({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await _c(a,t,r,s)},aC=async t=>{await iC(),t.readableFlowing===null&&t.resume()},uC=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:o,maxBuffer:s,lines:i})=>{try{return e||i?await cr(r,{maxBuffer:s}):o==="buffer"?new Uint8Array(await lr(r,{maxBuffer:s})):await dr(r,{maxBuffer:s})}catch(a){return yl(_u({error:a,stream:t,readableObjectMode:e,lines:i,encoding:o,fdNumber:n}))}},To=async t=>{try{return await t}catch(e){return yl(e)}},yl=({bufferedData:t})=>zi(t)?new Uint8Array(t):t;import{finished as cC}from"stream/promises";var at=async(t,e,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let s=lC(t,r),i=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],cC(t,{cleanup:!0,signal:i.signal})])}catch(a){s.stdinCleanedUp||DC(a,e,r,n)}finally{i.abort()}},lC=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&pC(t,r,n),n},pC=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...o)=>{dC(e,r),n.call(t,...o)}},dC=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},DC=(t,e,r,n)=>{if(!mC(t,e,r,n))throw t},mC=(t,e,r,n=!0)=>r.propagating?El(t)||vr(t):(r.propagating=!0,Io(r,e)===n?El(t):vr(t)),Io=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",vr=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",El=t=>t?.code==="EPIPE";var wl=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>t.stdio.map((u,c)=>Ro({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:s,verboseInfo:i,streamInfo:a})),Ro=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=at(t,e,c);if(Io(c,e)){await l;return}let[p]=await Promise.all([Cl({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return p};var Fl=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Ee([t,e].filter(Boolean)):void 0,Sl=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>Ro({...fC(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:hC(t),stripFinalNewline:s,verboseInfo:i,streamInfo:a}),fC=({stdout:t,stderr:e,all:r},[,n,o])=>{let s=n||o;return s?n?o?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},hC=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as gC}from"events";var xl=t=>Oe(t,"ipc"),Al=(t,e)=>{let r=Mt(t);K({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var Ol=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:s})=>{if(!n)return o;let i=xl(s),a=re(e,"ipc"),u=re(r,"ipc");for await(let c of go({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(vu(t,o,u),o.push(c)),i&&Al(c,s);return o},$l=async(t,e)=>(await Promise.allSettled([t]),e);var Bl=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:o,timeoutDuration:s,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:p},context:d,verboseInfo:D,fileDescriptors:f,originalStreams:g,onInternalError:E,controller:C})=>{let O=Mc(t,d),v={originalStreams:g,fileDescriptors:f,subprocess:t,exitPromise:O,propagating:!1},y=wl({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:D,streamInfo:v}),F=Sl({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:D,streamInfo:v}),B=[],I=Ol({subprocess:t,buffer:r,maxBuffer:n,ipc:l,ipcOutput:B,verboseInfo:D}),se=bC(g,t,v),ae=CC(f,v);try{return await Promise.race([Promise.all([{},kc(O),Promise.all(y),F,I,cu(t,p),...se,...ae]),E,yC(t,C),...ou(t,s,d,C),...xa({subprocess:t,cancelSignal:i,gracefulCancel:a,context:d,controller:C}),...ru({subprocess:t,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,context:d,controller:C})])}catch(Lr){return d.terminationReason??="other",Promise.all([{error:Lr},O,Promise.all(y.map(Ue=>To(Ue))),To(F),$l(I,B),Promise.allSettled(se),Promise.allSettled(ae)])}},bC=(t,e,r)=>t.map((n,o)=>n===e.stdio[o]?void 0:at(n,o,r)),CC=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:s=o})=>H(s,{checkOpen:!1})&&!V(s)).map(({type:o,value:s,stream:i=s})=>at(i,n,e,{isSameDirection:j.has(o),stopOnExit:o==="native"}))),yC=async(t,{signal:e})=>{let[r]=await gC(t,"error",{signal:e});throw r};var _l=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),ut=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let o=n.get(e),s=J();return o.push(s),{resolve:s.resolve.bind(s),promises:o}},je=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as EC}from"stream";import{callbackify as wC}from"util";import{finished as vl}from"stream/promises";var Mo=async t=>{if(t!==void 0)try{await Po(t)}catch{}},Tl=async t=>{if(t!==void 0)try{await ko(t)}catch{}},Po=async t=>{await vl(t,{cleanup:!0,readable:!1,writable:!0})},ko=async t=>{await vl(t,{cleanup:!0,readable:!0,writable:!1})},Tr=async(t,e)=>{if(await t,e)throw e},Ir=(t,e,r)=>{r&&!vr(r)?t.destroy(r):e&&t.destroy()};var Il=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:o=!0,preserveNewlines:s=!0}={})=>{let i=o||P.has(r),{subprocessStdout:a,waitReadableDestroy:u}=Lo(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:p}=jo(a,i),{read:d,onStdoutDataDone:D}=No({subprocessStdout:a,subprocess:t,binary:i,encoding:r,preserveNewlines:s}),f=new EC({read:d,destroy:wC(Vo.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:p,objectMode:l,encoding:c});return Uo({subprocessStdout:a,onStdoutDataDone:D,readable:f,subprocess:t}),f},Lo=(t,e,r)=>{let n=Te(t,e),o=ut(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},jo=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:vo},No=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:o})=>{let s=J(),i=_r({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){FC(this,i,s)},onStdoutDataDone:s}},FC=async(t,e,r)=>{try{let{value:n,done:o}=await e.next();o?r.resolve():t.push(n)}catch{}},Uo=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:o})=>{try{await ko(t),await n,await Mo(o),await e,r.readable&&r.push(null)}catch(s){await Mo(o),Rl(r,s)}},Vo=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await je(r,e)&&(Rl(t,n),await Tr(e,n))},Rl=(t,e)=>{Ir(t,t.readable,e)};import{Writable as SC}from"stream";import{callbackify as Ml}from"util";var Pl=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}=Go(t,r,e),i=new SC({...Wo(n,t,o),destroy:Ml(zo.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:o,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Ho(n,i),i},Go=(t,e,r)=>{let n=qt(t,e),o=ut(r,n,"writableFinal"),s=ut(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}},Wo=(t,e,r)=>({write:xC.bind(void 0,t),final:Ml(AC.bind(void 0,t,e,r))}),xC=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},AC=async(t,e,r)=>{await je(r,e)&&(t.writable&&t.end(),await e)},Ho=async(t,e,r)=>{try{await Po(t),e.writable&&e.end()}catch(n){await Tl(r),kl(e,n)}},zo=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await je(r,e),await je(n,e)&&(kl(t,o),await Tr(e,o))},kl=(t,e)=>{Ir(t,t.writable,e)};import{Duplex as OC}from"stream";import{callbackify as $C}from"util";var Ll=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:o,binary:s=!0,preserveNewlines:i=!0}={})=>{let a=s||P.has(r),{subprocessStdout:u,waitReadableDestroy:c}=Lo(t,n,e),{subprocessStdin:l,waitWritableFinal:p,waitWritableDestroy:d}=Go(t,o,e),{readableEncoding:D,readableObjectMode:f,readableHighWaterMark:g}=jo(u,a),{read:E,onStdoutDataDone:C}=No({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:i}),O=new OC({read:E,...Wo(l,t,p),destroy:$C(BC.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:p,waitWritableDestroy:d})),readableHighWaterMark:g,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:f,writableObjectMode:l.writableObjectMode,encoding:D});return Uo({subprocessStdout:u,onStdoutDataDone:C,readable:O,subprocess:t,subprocessStdin:l}),Ho(l,O,u),O},BC=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:s},i)=>{await Promise.all([Vo({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},i),zo({subprocessStdin:e,subprocess:r,waitWritableFinal:o,waitWritableDestroy:s},i)])};var qo=(t,e,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let s=n||P.has(e),i=Te(t,r),a=_r({subprocessStdout:i,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:o});return _C(a,i,t)},_C=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var jl=(t,{encoding:e})=>{let r=_l();t.readable=Il.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=Pl.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Ll.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=qo.bind(void 0,t,e),t[Symbol.asyncIterator]=qo.bind(void 0,t,e,{})};var Nl=(t,e)=>{for(let[r,n]of TC){let o=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:o})}},vC=(async()=>{})().constructor.prototype,TC=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(vC,t)]);var Ul=(t,e,r,n)=>{let{file:o,commandArguments:s,command:i,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:p}=MC(t,e,r),{subprocess:d,promise:D}=kC({file:o,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:i,escapedCommand:a,fileDescriptors:p});return d.pipe=Br.bind(void 0,{source:d,sourcePromise:D,boundOptions:{},createNested:n}),Nl(d,D),X.set(d,{options:l,fileDescriptors:p}),d},MC=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=kt(t,e,r),{file:a,commandArguments:u,options:c}=or(t,e,r),l=PC(c),p=Zc(l,i);return{file:a,commandArguments:u,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},PC=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},kC=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:o,command:s,escapedCommand:i,fileDescriptors:a})=>{let u;try{u=RC(...ir(t,e,r))}catch(f){return Yc({error:f,command:s,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}let c=new AbortController;IC(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];al(u,a,c),cl(u,r,c);let p={},d=J();u.kill=Fa.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:d,context:p,controller:c}),u.all=Fl(u,r),jl(u,r),Hc(u,r);let D=LC({subprocess:u,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:i,context:p,onInternalError:d,controller:c});return{subprocess:u,promise:D}},LC=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:s,command:i,escapedCommand:a,context:u,onInternalError:c,controller:l})=>{let[p,[d,D],f,g,E]=await Bl({subprocess:t,options:e,context:u,verboseInfo:n,fileDescriptors:o,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();let C=f.map((y,F)=>oe(y,e,F)),O=oe(g,e,"all"),v=jC({errorInfo:p,exitCode:d,signal:D,stdio:C,all:O,ipcOutput:E,context:u,options:e,command:i,escapedCommand:a,startTime:r});return Pe(v,n,e)},jC=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,context:i,options:a,command:u,escapedCommand:c,startTime:l})=>"error"in t?rt({error:t.error,command:u,escapedCommand:c,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Z,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,options:a,startTime:l,isSync:!1}):mr({command:u,escapedCommand:c,stdio:n,all:o,ipcOutput:s,options:a,startTime:l});var Rr=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,o])=>[n,NC(n,t[n],o)]));return{...t,...r}},NC=(t,e,r)=>UC.has(t)&&A(e)&&A(r)?{...e,...r}:r,UC=new Set(["env",...wn]);var De=(t,e,r,n)=>{let o=(i,a,u)=>De(i,a,r,u),s=(...i)=>VC({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:o},...i);return n!==void 0&&n(s,o,e),s},VC=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:o},s,...i)=>{if(A(s))return o(t,Rr(r,s),n);let{file:a,commandArguments:u,options:c,isSync:l}=GC({mapArguments:t,firstArgument:s,nextArguments:i,deepOptions:e,boundOptions:r});return l?jc(a,u,c):Ul(a,u,c,o)},GC=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:o})=>{let s=Zi(e)?Qi(e,r):[e,...r],[i,a,u]=At(...s),c=Rr(Rr(n,o),u),{file:l=i,commandArguments:p=a,options:d=c,isSync:D=!1}=t({file:i,commandArguments:a,options:c});return{file:l,commandArguments:p,options:d,isSync:D}};var Vl=({file:t,commandArguments:e})=>Wl(t,e),Gl=({file:t,commandArguments:e})=>({...Wl(t,e),isSync:!0}),Wl=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=WC(t);return{file:r,commandArguments:n}},WC=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(HC)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},HC=/ +/g;var Hl=(t,e,r)=>{t.sync=e(zC,r),t.s=t.sync},zl=({options:t})=>ql(t),zC=({options:t})=>({...ql(t),isSync:!0}),ql=t=>({options:{...qC(t),...t}}),qC=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Yl={preferLocal:!0};var me=De(()=>({})),P8=De(()=>({isSync:!0})),Kl=De(Vl),k8=De(Gl),L8=De(su),j8=De(zl,{},Yl,Hl),{sendMessage:N8,getOneMessage:U8,getEachMessage:V8,getCancelSignal:G8}=zc();var Jl="https://github.com/spree/storefront.git",Xl="https://github.com/spree/spree-starter.git",Mr="spree@example.com",Pr="spree123";import YC from"crypto";function Zl(){let t=process.env.npm_config_user_agent??"";return t.startsWith("yarn")?"yarn":t.startsWith("pnpm")?"pnpm":"npm"}async function Ql(){try{return await Kl("docker info",{stdio:"ignore"}),!0}catch{return!1}}function ep(){return YC.randomBytes(64).toString("hex")}function Yo(t){return t==="yarn"?"yarn":`${t} install`}function tp(t,e){return`SECRET_KEY_BASE=${t}
|
|
186
120
|
SPREE_PORT=${e}
|
|
187
121
|
SPREE_VERSION_TAG=latest
|
|
188
|
-
`}function
|
|
122
|
+
`}function rp(t,e){return`SPREE_API_URL=http://localhost:${t}
|
|
189
123
|
SPREE_PUBLISHABLE_KEY=${e??"pk_REPLACE_ME_AFTER_DOCKER_START"}
|
|
190
|
-
`}function
|
|
191
|
-
`}function
|
|
124
|
+
`}function np(t){return JSON.stringify({name:t,private:!0,scripts:{dev:"spree dev",stop:"spree stop",down:"docker compose down",update:"spree update",eject:"spree eject",logs:"spree logs","logs:worker":"spree logs worker",seed:"spree seed","load-sample-data":"spree sample-data",console:"spree console"},dependencies:{"@spree/cli":"2.0.0-beta.6"}},null,2)+`
|
|
125
|
+
`}function op(t,e,r){let n=`# ${t}
|
|
192
126
|
|
|
193
127
|
A [Spree Commerce](https://spreecommerce.org) project.
|
|
194
128
|
|
|
@@ -276,9 +210,9 @@ This project uses [\`@spree/cli\`](https://www.npmjs.com/package/@spree/cli) to
|
|
|
276
210
|
- [Spree Documentation](https://docs.spreecommerce.org)
|
|
277
211
|
- [Store API Reference](https://docs.spreecommerce.org/api-reference/store)
|
|
278
212
|
- [Spree GitHub](https://github.com/spree/spree)
|
|
279
|
-
`,n}function
|
|
213
|
+
`,n}function ip(){return`node_modules/
|
|
280
214
|
.env
|
|
281
215
|
.env.local
|
|
282
216
|
.DS_Store
|
|
283
|
-
`}import
|
|
284
|
-
`),"Project created!")}var
|
|
217
|
+
`}import sp from"fs";import kr from"path";async function ap(t){let e=kr.join(t,"apps","storefront");await me("git",["clone","--depth","1",Jl,e],{stdio:"ignore"}),sp.rmSync(kr.join(e,".git"),{recursive:!0,force:!0})}async function up(t,e){let[r,...n]=Yo(e).split(" ");await me(r,n,{cwd:t,stdio:"ignore"})}async function cp(t,e){let r=kr.join(t,"apps","storefront"),[n,...o]=Yo(e).split(" ");await me(n,o,{cwd:r,stdio:"ignore"})}function lp(t,e,r){let n=kr.join(t,"apps","storefront",".env.local");sp.writeFileSync(n,rp(e,r))}import Ne from"fs";import Fe from"path";async function pp(t){let e=Fe.join(t,"backend");await me("git",["clone","--depth","1",Xl,e],{stdio:"ignore"}),Ne.rmSync(Fe.join(e,".git"),{recursive:!0,force:!0});let r=Fe.join(e,".github","workflows");if(Ne.existsSync(r)){let n=Fe.join(t,".github","workflows");Ne.mkdirSync(n,{recursive:!0});for(let o of Ne.readdirSync(r))Ne.renameSync(Fe.join(r,o),Fe.join(n,o));Ne.rmSync(Fe.join(e,".github"),{recursive:!0,force:!0})}}async function dp(t){let e=q.resolve(t.directory),r=q.basename(e),{port:n,storefront:o}=t;t.start&&(await Ql()||(U("Docker is not running. Please start Docker and try again, or use --no-start."),process.exit(1))),z.existsSync(e)&&z.readdirSync(e).length>0&&(U(`Directory ${ie.default.bold(t.directory)} is not empty.`),process.exit(1));let s=Ni();z.mkdirSync(e,{recursive:!0}),s.start("Downloading backend template..."),await pp(e),s.stop("Backend template downloaded."),s.start("Creating project structure...");let i=q.join(e,"backend"),a=z.readFileSync(q.join(i,"docker-compose.yml"),"utf-8"),u=z.readFileSync(q.join(i,"docker-compose.dev.yml"),"utf-8");if(z.writeFileSync(q.join(e,"docker-compose.yml"),a),z.writeFileSync(q.join(e,"docker-compose.dev.yml"),u.replace("context: .","context: ./backend")),z.writeFileSync(q.join(e,".env"),tp(ep(),n)),z.writeFileSync(q.join(e,"package.json"),np(r)),z.writeFileSync(q.join(e,"README.md"),op(r,o,n)),z.writeFileSync(q.join(e,".gitignore"),ip()),s.stop("Project structure created."),s.start("Installing dependencies..."),await up(e,t.packageManager),s.stop("Dependencies installed."),o&&(s.start("Downloading storefront template..."),await ap(e),s.stop("Storefront template downloaded."),lp(e,n),s.start("Installing storefront dependencies..."),await cp(e,t.packageManager),s.stop("Storefront dependencies installed.")),t.start){let c=["spree","init"];t.sampleData||c.push("--no-sample-data"),await me("npx",c,{cwd:e,stdio:"inherit"}),o&&Y.info(`${ie.default.bold("Storefront")}: ${ie.default.cyan(`cd ${r}/apps/storefront && npm run dev`)}`)}else JC(r,o,n)}function JC(t,e,r){let n=["",`${ie.default.bold("Next steps:")}`,` cd ${t}`," npx spree dev"];e&&n.push("",` ${ie.default.dim("# In another terminal:")}`,` cd ${t}/apps/storefront`," npm install"," npm run dev"),n.push("",`${ie.default.bold("Admin Dashboard")}`,` http://localhost:${r}/admin`,` Email: ${Mr}`,` Password: ${Pr}`,"",`${ie.default.bold("Customize the backend")}`," npx spree eject",` ${ie.default.dim("# Then edit backend/Gemfile, backend/app/, backend/config/")}`),ki(n.join(`
|
|
218
|
+
`),"Project created!")}var ZC=new li().name("create-spree-app").description("Create a new Spree Commerce project").argument("[directory]","project directory").option("--no-storefront","skip Next.js storefront setup").option("--no-sample-data","skip loading sample data").option("--no-start","do not start Docker services").option("--port <number>","port for the Spree backend",String(3e3)).option("--use-npm","use npm as package manager").option("--use-yarn","use yarn as package manager").option("--use-pnpm","use pnpm as package manager").action(async(t,e)=>{Li(Ko.default.bold("Create Spree App"));let r=Zl();e.useNpm&&(r="npm"),e.useYarn&&(r="yarn"),e.usePnpm&&(r="pnpm");try{let n=await Wi({directory:t,noStorefront:e.storefront===!1?!0:void 0,noSampleData:e.sampleData===!1?!0:void 0,noStart:e.start===!1?!0:void 0,packageManager:r}),o=Number(e.port),s=await fn({port:Gi(o,o+100)});s!==o&&Y.warn(`Port ${o} is in use, using port ${Ko.default.bold(String(s))} instead.`),await dp({...n,port:s}),ji("Happy selling!")}catch(n){n instanceof Error&&n.message.includes("cancelled")&&(U("Setup cancelled."),process.exit(0)),U(n instanceof Error?n.message:"An unexpected error occurred."),process.exit(1)}});ZC.parse();
|