@mitsein-ai/cli 0.1.0 → 0.1.2
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 +142 -130
- package/package.json +3 -3
- package/src/commands/dev.ts +7 -9
- package/src/commands/version.ts +4 -2
- package/src/core/credentials.ts +12 -8
- package/src/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,143 +1,155 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`)}}function wD(u){let D=/\x1b\[\d*(;\d*)*m/g;return u.replace(D,"")}Ui.Help=AD;Ui.stripColor=wD});var Pu=O((Mi)=>{var{InvalidArgumentError:Ni}=eu();class mD{constructor(u,D){this.flags=u,this.description=D||"",this.required=u.includes("<"),this.optional=u.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(u),this.mandatory=!1;let t=Ji(u);if(this.short=t.shortFlag,this.long=t.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(u,D){return this.defaultValue=u,this.defaultValueDescription=D,this}preset(u){return this.presetArg=u,this}conflicts(u){return this.conflictsWith=this.conflictsWith.concat(u),this}implies(u){let D=u;if(typeof u==="string")D={[u]:!0};return this.implied=Object.assign(this.implied||{},D),this}env(u){return this.envVar=u,this}argParser(u){return this.parseArg=u,this}makeOptionMandatory(u=!0){return this.mandatory=!!u,this}hideHelp(u=!0){return this.hidden=!!u,this}_concatValue(u,D){if(D===this.defaultValue||!Array.isArray(D))return[u];return D.concat(u)}choices(u){return this.argChoices=u.slice(),this.parseArg=(D,t)=>{if(!this.argChoices.includes(D))throw new Ni(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(D,t);return D},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return _D(this.name().replace(/^no-/,""));return _D(this.name())}is(u){return this.short===u||this.long===u}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class bD{constructor(u){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,u.forEach((D)=>{if(D.negate)this.negativeOptions.set(D.attributeName(),D);else this.positiveOptions.set(D.attributeName(),D)}),this.negativeOptions.forEach((D,t)=>{if(this.positiveOptions.has(t))this.dualOptions.add(t)})}valueFromOption(u,D){let t=D.attributeName();if(!this.dualOptions.has(t))return!0;let r=this.negativeOptions.get(t).presetArg,n=r!==void 0?r:!1;return D.negate===(n===u)}}function _D(u){return u.split("-").reduce((D,t)=>{return D+t[0].toUpperCase()+t.slice(1)})}function Ji(u){let D,t,r=/^-[^-]$/,n=/^--[^-]/,F=u.split(/[ |,]+/).concat("guard");if(r.test(F[0]))D=F.shift();if(n.test(F[0]))t=F.shift();if(!D&&r.test(F[0]))D=F.shift();if(!D&&n.test(F[0]))D=t,t=F.shift();if(F[0].startsWith("-")){let i=F[0],e=`option creation failed due to '${i}' in option flags '${u}'`;if(/^-[^-][^-]/.test(i))throw Error(`${e}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire as G7}from"node:module";var $7=Object.create;var{getPrototypeOf:A7,defineProperty:WF,getOwnPropertyNames:w7}=Object;var m7=Object.prototype.hasOwnProperty;function _7(D){return this[D]}var R7,b7,S7=(D,u,i)=>{var C=D!=null&&typeof D==="object";if(C){var h=u?R7??=new WeakMap:b7??=new WeakMap,f=h.get(D);if(f)return f}i=D!=null?$7(A7(D)):{};let E=u||!D||!D.__esModule?WF(i,"default",{value:D,enumerable:!0}):i;for(let B of w7(D))if(!m7.call(E,B))WF(E,B,{get:_7.bind(D,B),enumerable:!0});if(C)h.set(D,E);return E};var Yu=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var l7=(D)=>D;function U7(D,u){this[D]=l7.bind(null,u)}var H0=(D,u)=>{for(var i in u)WF(D,i,{get:u[i],enumerable:!0,configurable:!0,set:U7.bind(u,i)})};var zD=(D,u)=>()=>(D&&(u=D(D=0)),u);var VD=G7(import.meta.url);var P2=Yu((T7)=>{class KF extends Error{constructor(D,u,i){super(i);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=u,this.exitCode=D,this.nestedError=void 0}}class Ci extends KF{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}T7.CommanderError=KF;T7.InvalidArgumentError=Ci});var W0=Yu((M7)=>{var{InvalidArgumentError:J7}=P2();class Ei{constructor(D,u){switch(this.description=u||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(D,u){if(u===this.defaultValue||!Array.isArray(u))return[D];return u.concat(D)}default(D,u){return this.defaultValue=D,this.defaultValueDescription=u,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(u,i)=>{if(!this.argChoices.includes(u))throw new J7(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(u,i);return u},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function N7(D){let u=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+u+">":"["+u+"]"}M7.Argument=Ei;M7.humanReadableArgName=N7});var PF=Yu((Y7)=>{var{humanReadableArgName:X7}=W0();class hi{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let u=D.commands.filter((C)=>!C._hidden),i=D._getHelpCommand();if(i&&!i._hidden)u.push(i);if(this.sortSubcommands)u.sort((C,h)=>{return C.name().localeCompare(h.name())});return u}compareOptions(D,u){let i=(C)=>{return C.short?C.short.replace(/^-/,""):C.long.replace(/^--/,"")};return i(D).localeCompare(i(u))}visibleOptions(D){let u=D.options.filter((C)=>!C.hidden),i=D._getHelpOption();if(i&&!i.hidden){let C=i.short&&D._findOption(i.short),h=i.long&&D._findOption(i.long);if(!C&&!h)u.push(i);else if(i.long&&!h)u.push(D.createOption(i.long,i.description));else if(i.short&&!C)u.push(D.createOption(i.short,i.description))}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let u=[];for(let i=D.parent;i;i=i.parent){let C=i.options.filter((h)=>!h.hidden);u.push(...C)}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((u)=>{u.description=u.description||D._argsDescription[u.name()]||""});if(D.registeredArguments.find((u)=>u.description))return D.registeredArguments;return[]}subcommandTerm(D){let u=D.registeredArguments.map((i)=>X7(i)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(u?" "+u:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,u){return u.visibleCommands(D).reduce((i,C)=>{return Math.max(i,this.displayWidth(u.styleSubcommandTerm(u.subcommandTerm(C))))},0)}longestOptionTermLength(D,u){return u.visibleOptions(D).reduce((i,C)=>{return Math.max(i,this.displayWidth(u.styleOptionTerm(u.optionTerm(C))))},0)}longestGlobalOptionTermLength(D,u){return u.visibleGlobalOptions(D).reduce((i,C)=>{return Math.max(i,this.displayWidth(u.styleOptionTerm(u.optionTerm(C))))},0)}longestArgumentTermLength(D,u){return u.visibleArguments(D).reduce((i,C)=>{return Math.max(i,this.displayWidth(u.styleArgumentTerm(u.argumentTerm(C))))},0)}commandUsage(D){let u=D._name;if(D._aliases[0])u=u+"|"+D._aliases[0];let i="";for(let C=D.parent;C;C=C.parent)i=C.name()+" "+i;return i+u+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((i)=>JSON.stringify(i)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)u.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)u.push(`env: ${D.envVar}`);if(u.length>0)return`${D.description} (${u.join(", ")})`;return D.description}argumentDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((i)=>JSON.stringify(i)).join(", ")}`);if(D.defaultValue!==void 0)u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(u.length>0){let i=`(${u.join(", ")})`;if(D.description)return`${D.description} ${i}`;return i}return D.description}formatHelp(D,u){let i=u.padWidth(D,u),C=u.helpWidth??80;function h($,R){return u.formatItem($,i,R,u)}let f=[`${u.styleTitle("Usage:")} ${u.styleUsage(u.commandUsage(D))}`,""],E=u.commandDescription(D);if(E.length>0)f=f.concat([u.boxWrap(u.styleCommandDescription(E),C),""]);let B=u.visibleArguments(D).map(($)=>{return h(u.styleArgumentTerm(u.argumentTerm($)),u.styleArgumentDescription(u.argumentDescription($)))});if(B.length>0)f=f.concat([u.styleTitle("Arguments:"),...B,""]);let s=u.visibleOptions(D).map(($)=>{return h(u.styleOptionTerm(u.optionTerm($)),u.styleOptionDescription(u.optionDescription($)))});if(s.length>0)f=f.concat([u.styleTitle("Options:"),...s,""]);if(u.showGlobalOptions){let $=u.visibleGlobalOptions(D).map((R)=>{return h(u.styleOptionTerm(u.optionTerm(R)),u.styleOptionDescription(u.optionDescription(R)))});if($.length>0)f=f.concat([u.styleTitle("Global Options:"),...$,""])}let A=u.visibleCommands(D).map(($)=>{return h(u.styleSubcommandTerm(u.subcommandTerm($)),u.styleSubcommandDescription(u.subcommandDescription($)))});if(A.length>0)f=f.concat([u.styleTitle("Commands:"),...A,""]);return f.join(`
|
|
3
|
+
`)}displayWidth(D){return ri(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((u)=>{if(u==="[options]")return this.styleOptionText(u);if(u==="[command]")return this.styleSubcommandText(u);if(u[0]==="["||u[0]==="<")return this.styleArgumentText(u);return this.styleCommandText(u)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D}styleOptionTerm(D){return this.styleOptionText(D)}styleSubcommandTerm(D){return D.split(" ").map((u)=>{if(u==="[options]")return this.styleOptionText(u);if(u[0]==="["||u[0]==="<")return this.styleArgumentText(u);return this.styleSubcommandText(u)}).join(" ")}styleArgumentTerm(D){return this.styleArgumentText(D)}styleOptionText(D){return D}styleArgumentText(D){return D}styleSubcommandText(D){return D}styleCommandText(D){return D}padWidth(D,u){return Math.max(u.longestOptionTermLength(D,u),u.longestGlobalOptionTermLength(D,u),u.longestSubcommandTermLength(D,u),u.longestArgumentTermLength(D,u))}preformatted(D){return/\n[^\S\r\n]/.test(D)}formatItem(D,u,i,C){let f=" ".repeat(2);if(!i)return f+D;let E=D.padEnd(u+D.length-C.displayWidth(D)),B=2,A=(this.helpWidth??80)-u-B-2,$;if(A<this.minWidthToWrap||C.preformatted(i))$=i;else $=C.boxWrap(i,A).replace(/\n/g,`
|
|
4
|
+
`+" ".repeat(u+B));return f+E+" ".repeat(B)+$.replace(/\n/g,`
|
|
5
|
+
${f}`)}boxWrap(D,u){if(u<this.minWidthToWrap)return D;let i=D.split(/\r\n|\n/),C=/[\s]*[^\s]+/g,h=[];return i.forEach((f)=>{let E=f.match(C);if(E===null){h.push("");return}let B=[E.shift()],s=this.displayWidth(B[0]);E.forEach((A)=>{let $=this.displayWidth(A);if(s+$<=u){B.push(A),s+=$;return}h.push(B.join(""));let R=A.trimStart();B=[R],s=this.displayWidth(R)}),h.push(B.join(""))}),h.join(`
|
|
6
|
+
`)}}function ri(D){let u=/\x1b\[\d*(;\d*)*m/g;return D.replace(u,"")}Y7.Help=hi;Y7.stripColor=ri});var qF=Yu((W7)=>{var{InvalidArgumentError:V7}=P2();class ci{constructor(D,u){this.flags=D,this.description=u||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let i=H7(D);if(this.short=i.shortFlag,this.long=i.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(D,u){return this.defaultValue=D,this.defaultValueDescription=u,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let u=D;if(typeof D==="string")u={[D]:!0};return this.implied=Object.assign(this.implied||{},u),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_concatValue(D,u){if(u===this.defaultValue||!Array.isArray(u))return[D];return u.concat(D)}choices(D){return this.argChoices=D.slice(),this.parseArg=(u,i)=>{if(!this.argChoices.includes(u))throw new V7(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(u,i);return u},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return fi(this.name().replace(/^no-/,""));return fi(this.name())}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class ni{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((u)=>{if(u.negate)this.negativeOptions.set(u.attributeName(),u);else this.positiveOptions.set(u.attributeName(),u)}),this.negativeOptions.forEach((u,i)=>{if(this.positiveOptions.has(i))this.dualOptions.add(i)})}valueFromOption(D,u){let i=u.attributeName();if(!this.dualOptions.has(i))return!0;let C=this.negativeOptions.get(i).presetArg,h=C!==void 0?C:!1;return u.negate===(h===D)}}function fi(D){return D.split("-").reduce((u,i)=>{return u+i[0].toUpperCase()+i.slice(1)})}function H7(D){let u,i,C=/^-[^-]$/,h=/^--[^-]/,f=D.split(/[ |,]+/).concat("guard");if(C.test(f[0]))u=f.shift();if(h.test(f[0]))i=f.shift();if(!u&&C.test(f[0]))u=f.shift();if(!u&&h.test(f[0]))u=i,i=f.shift();if(f[0].startsWith("-")){let E=f[0],B=`option creation failed due to '${E}' in option flags '${D}'`;if(/^-[^-][^-]/.test(E))throw Error(`${B}
|
|
8
7
|
- a short flag is a single dash and a single character
|
|
9
8
|
- either use a single dash and a single character (for a short flag)
|
|
10
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(
|
|
11
|
-
- too many short flags`);if(
|
|
12
|
-
- too many long flags`);throw Error(`${
|
|
13
|
-
- unrecognised flag format`)}if(
|
|
14
|
-
(Did you mean one of ${
|
|
15
|
-
(Did you mean ${
|
|
16
|
-
- specify the name in Command constructor or using .name()`);if(
|
|
17
|
-
Expecting one of '${
|
|
18
|
-
- already used by option '${
|
|
19
|
-
- 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(u,
|
|
20
|
-
- if '${
|
|
9
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(C.test(E))throw Error(`${B}
|
|
10
|
+
- too many short flags`);if(h.test(E))throw Error(`${B}
|
|
11
|
+
- too many long flags`);throw Error(`${B}
|
|
12
|
+
- unrecognised flag format`)}if(u===void 0&&i===void 0)throw Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:u,longFlag:i}}W7.Option=ci;W7.DualOptions=ni});var Bi=Yu((k7)=>{function q7(D,u){if(Math.abs(D.length-u.length)>3)return Math.max(D.length,u.length);let i=[];for(let C=0;C<=D.length;C++)i[C]=[C];for(let C=0;C<=u.length;C++)i[0][C]=C;for(let C=1;C<=u.length;C++)for(let h=1;h<=D.length;h++){let f=1;if(D[h-1]===u[C-1])f=0;else f=1;if(i[h][C]=Math.min(i[h-1][C]+1,i[h][C-1]+1,i[h-1][C-1]+f),h>1&&C>1&&D[h-1]===u[C-2]&&D[h-2]===u[C-1])i[h][C]=Math.min(i[h][C],i[h-2][C-2]+1)}return i[D.length][u.length]}function g7(D,u){if(!u||u.length===0)return"";u=Array.from(new Set(u));let i=D.startsWith("--");if(i)D=D.slice(2),u=u.map((E)=>E.slice(2));let C=[],h=3,f=0.4;if(u.forEach((E)=>{if(E.length<=1)return;let B=q7(D,E),s=Math.max(D.length,E.length);if((s-B)/s>f){if(B<h)h=B,C=[E];else if(B===h)C.push(E)}}),C.sort((E,B)=>E.localeCompare(B)),i)C=C.map((E)=>`--${E}`);if(C.length>1)return`
|
|
13
|
+
(Did you mean one of ${C.join(", ")}?)`;if(C.length===1)return`
|
|
14
|
+
(Did you mean ${C[0]}?)`;return""}k7.suggestSimilar=g7});var Ai=Yu((x7)=>{var j7=VD("node:events").EventEmitter,gF=VD("node:child_process"),eD=VD("node:path"),K0=VD("node:fs"),g=VD("node:process"),{Argument:O7,humanReadableArgName:o7}=W0(),{CommanderError:kF}=P2(),{Help:d7,stripColor:p7}=PF(),{Option:si,DualOptions:a7}=qF(),{suggestSimilar:ti}=Bi();class jF extends j7{constructor(D){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=D||"",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:(u)=>g.stdout.write(u),writeErr:(u)=>g.stderr.write(u),outputError:(u,i)=>i(u),getOutHelpWidth:()=>g.stdout.isTTY?g.stdout.columns:void 0,getErrHelpWidth:()=>g.stderr.isTTY?g.stderr.columns:void 0,getOutHasColors:()=>vF()??(g.stdout.isTTY&&g.stdout.hasColors?.()),getErrHasColors:()=>vF()??(g.stderr.isTTY&&g.stderr.hasColors?.()),stripColor:(u)=>p7(u)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let u=this;u;u=u.parent)D.push(u);return D}command(D,u,i){let C=u,h=i;if(typeof C==="object"&&C!==null)h=C,C=null;h=h||{};let[,f,E]=D.match(/([^ ]+) *(.*)/),B=this.createCommand(f);if(C)B.description(C),B._executableHandler=!0;if(h.isDefault)this._defaultCommandName=B._name;if(B._hidden=!!(h.noHelp||h.hidden),B._executableFile=h.executableFile||null,E)B.arguments(E);if(this._registerCommand(B),B.parent=this,B.copyInheritedSettings(this),C)return this;return B}createCommand(D){return new jF(D)}createHelp(){return Object.assign(new d7,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return Object.assign(this._outputConfiguration,D),this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,u){if(!D._name)throw Error(`Command passed to .addCommand() must have a name
|
|
15
|
+
- specify the name in Command constructor or using .name()`);if(u=u||{},u.isDefault)this._defaultCommandName=D._name;if(u.noHelp||u.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,u){return new O7(D,u)}argument(D,u,i,C){let h=this.createArgument(D,u);if(typeof i==="function")h.default(C).argParser(i);else h.default(i);return this.addArgument(h),this}arguments(D){return D.trim().split(/ +/).forEach((u)=>{this.argument(u)}),this}addArgument(D){let u=this.registeredArguments.slice(-1)[0];if(u&&u.variadic)throw Error(`only the last argument can be variadic '${u.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,u){if(typeof D==="boolean")return this._addImplicitHelpCommand=D,this;D=D??"help [command]";let[,i,C]=D.match(/([^ ]+) *(.*)/),h=u??"display help for command",f=this.createCommand(i);if(f.helpOption(!1),C)f.arguments(C);if(h)f.description(h);return this._addImplicitHelpCommand=!0,this._helpCommand=f,this}addHelpCommand(D,u){if(typeof D!=="object")return this.helpCommand(D,u),this;return this._addImplicitHelpCommand=!0,this._helpCommand=D,this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(D,u){let i=["preSubcommand","preAction","postAction"];if(!i.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
|
|
16
|
+
Expecting one of '${i.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(u);else this._lifeCycleHooks[D]=[u];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(u)=>{if(u.code!=="commander.executeSubCommandAsync")throw u};return this}_exit(D,u,i){if(this._exitCallback)this._exitCallback(new kF(D,u,i));g.exit(D)}action(D){let u=(i)=>{let C=this.registeredArguments.length,h=i.slice(0,C);if(this._storeOptionsAsProperties)h[C]=this;else h[C]=this.opts();return h.push(this),D.apply(this,h)};return this._actionHandler=u,this}createOption(D,u){return new si(D,u)}_callParseArg(D,u,i,C){try{return D.parseArg(u,i)}catch(h){if(h.code==="commander.invalidArgument"){let f=`${C} ${h.message}`;this.error(f,{exitCode:h.exitCode,code:h.code})}throw h}}_registerOption(D){let u=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(u){let i=D.long&&this._findOption(D.long)?D.long:D.short;throw Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
|
|
17
|
+
- already used by option '${u.flags}'`)}this.options.push(D)}_registerCommand(D){let u=(C)=>{return[C.name()].concat(C.aliases())},i=u(D).find((C)=>this._findCommand(C));if(i){let C=u(this._findCommand(i)).join("|"),h=u(D).join("|");throw Error(`cannot add command '${h}' as already have command '${C}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let u=D.name(),i=D.attributeName();if(D.negate){let h=D.long.replace(/^--no-/,"--");if(!this._findOption(h))this.setOptionValueWithSource(i,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(i,D.defaultValue,"default");let C=(h,f,E)=>{if(h==null&&D.presetArg!==void 0)h=D.presetArg;let B=this.getOptionValue(i);if(h!==null&&D.parseArg)h=this._callParseArg(D,h,B,f);else if(h!==null&&D.variadic)h=D._concatValue(h,B);if(h==null)if(D.negate)h=!1;else if(D.isBoolean()||D.optional)h=!0;else h="";this.setOptionValueWithSource(i,h,E)};if(this.on("option:"+u,(h)=>{let f=`error: option '${D.flags}' argument '${h}' is invalid.`;C(h,f,"cli")}),D.envVar)this.on("optionEnv:"+u,(h)=>{let f=`error: option '${D.flags}' value '${h}' from env '${D.envVar}' is invalid.`;C(h,f,"env")});return this}_optionEx(D,u,i,C,h){if(typeof u==="object"&&u instanceof si)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let f=this.createOption(u,i);if(f.makeOptionMandatory(!!D.mandatory),typeof C==="function")f.default(h).argParser(C);else if(C instanceof RegExp){let E=C;C=(B,s)=>{let A=E.exec(B);return A?A[0]:s},f.default(h).argParser(C)}else f.default(C);return this.addOption(f)}option(D,u,i,C){return this._optionEx({},D,u,i,C)}requiredOption(D,u,i,C){return this._optionEx({mandatory:!0},D,u,i,C)}combineFlagAndOptionalValue(D=!0){return this._combineFlagAndOptionalValue=!!D,this}allowUnknownOption(D=!0){return this._allowUnknownOption=!!D,this}allowExcessArguments(D=!0){return this._allowExcessArguments=!!D,this}enablePositionalOptions(D=!0){return this._enablePositionalOptions=!!D,this}passThroughOptions(D=!0){return this._passThroughOptions=!!D,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(D=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!D,this}getOptionValue(D){if(this._storeOptionsAsProperties)return this[D];return this._optionValues[D]}setOptionValue(D,u){return this.setOptionValueWithSource(D,u,void 0)}setOptionValueWithSource(D,u,i){if(this._storeOptionsAsProperties)this[D]=u;else this._optionValues[D]=u;return this._optionValueSources[D]=i,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let u;return this._getCommandAndAncestors().forEach((i)=>{if(i.getOptionValueSource(D)!==void 0)u=i.getOptionValueSource(D)}),u}_prepareUserArgs(D,u){if(D!==void 0&&!Array.isArray(D))throw Error("first parameter to parse must be array or undefined");if(u=u||{},D===void 0&&u.from===void 0){if(g.versions?.electron)u.from="electron";let C=g.execArgv??[];if(C.includes("-e")||C.includes("--eval")||C.includes("-p")||C.includes("--print"))u.from="eval"}if(D===void 0)D=g.argv;this.rawArgs=D.slice();let i;switch(u.from){case void 0:case"node":this._scriptPath=D[1],i=D.slice(2);break;case"electron":if(g.defaultApp)this._scriptPath=D[1],i=D.slice(2);else i=D.slice(1);break;case"user":i=D.slice(0);break;case"eval":i=D.slice(1);break;default:throw Error(`unexpected parse option { from: '${u.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",i}parse(D,u){this._prepareForParse();let i=this._prepareUserArgs(D,u);return this._parseCommand([],i),this}async parseAsync(D,u){this._prepareForParse();let i=this._prepareUserArgs(D,u);return await this._parseCommand([],i),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
18
|
+
- 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(D,u,i){if(K0.existsSync(D))return;let C=u?`searched for local subcommand relative to directory '${u}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",h=`'${D}' does not exist
|
|
19
|
+
- if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
21
20
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
22
|
-
- ${
|
|
21
|
+
- ${C}`;throw Error(h)}_executeSubCommand(D,u){u=u.slice();let i=!1,C=[".js",".ts",".tsx",".mjs",".cjs"];function h(A,$){let R=eD.resolve(A,$);if(K0.existsSync(R))return R;if(C.includes(eD.extname($)))return;let m=C.find((l)=>K0.existsSync(`${R}${l}`));if(m)return`${R}${m}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let f=D._executableFile||`${this._name}-${D._name}`,E=this._executableDir||"";if(this._scriptPath){let A;try{A=K0.realpathSync(this._scriptPath)}catch{A=this._scriptPath}E=eD.resolve(eD.dirname(A),E)}if(E){let A=h(E,f);if(!A&&!D._executableFile&&this._scriptPath){let $=eD.basename(this._scriptPath,eD.extname(this._scriptPath));if($!==this._name)A=h(E,`${$}-${D._name}`)}f=A||f}i=C.includes(eD.extname(f));let B;if(g.platform!=="win32")if(i)u.unshift(f),u=$i(g.execArgv).concat(u),B=gF.spawn(g.argv[0],u,{stdio:"inherit"});else B=gF.spawn(f,u,{stdio:"inherit"});else this._checkForMissingExecutable(f,E,D._name),u.unshift(f),u=$i(g.execArgv).concat(u),B=gF.spawn(g.execPath,u,{stdio:"inherit"});if(!B.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(($)=>{g.on($,()=>{if(B.killed===!1&&B.exitCode===null)B.kill($)})});let s=this._exitCallback;B.on("close",(A)=>{if(A=A??1,!s)g.exit(A);else s(new kF(A,"commander.executeSubCommandAsync","(close)"))}),B.on("error",(A)=>{if(A.code==="ENOENT")this._checkForMissingExecutable(f,E,D._name);else if(A.code==="EACCES")throw Error(`'${f}' not executable`);if(!s)g.exit(1);else{let $=new kF(1,"commander.executeSubCommandAsync","(error)");$.nestedError=A,s($)}}),this.runningCommand=B}_dispatchSubcommand(D,u,i){let C=this._findCommand(D);if(!C)this.help({error:!0});C._prepareForParse();let h;return h=this._chainOrCallSubCommandHook(h,C,"preSubcommand"),h=this._chainOrCall(h,()=>{if(C._executableHandler)this._executeSubCommand(C,u.concat(i));else return C._parseCommand(u,i)}),h}_dispatchHelpCommand(D){if(!D)this.help();let u=this._findCommand(D);if(u&&!u._executableHandler)u.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,u)=>{if(D.required&&this.args[u]==null)this.missingArgument(D.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let D=(i,C,h)=>{let f=C;if(C!==null&&i.parseArg){let E=`error: command-argument value '${C}' is invalid for argument '${i.name()}'.`;f=this._callParseArg(i,C,h,E)}return f};this._checkNumberOfArguments();let u=[];this.registeredArguments.forEach((i,C)=>{let h=i.defaultValue;if(i.variadic){if(C<this.args.length){if(h=this.args.slice(C),i.parseArg)h=h.reduce((f,E)=>{return D(i,E,f)},i.defaultValue)}else if(h===void 0)h=[]}else if(C<this.args.length){if(h=this.args[C],i.parseArg)h=D(i,h,i.defaultValue)}u[C]=h}),this.processedArgs=u}_chainOrCall(D,u){if(D&&D.then&&typeof D.then==="function")return D.then(()=>u());return u()}_chainOrCallHooks(D,u){let i=D,C=[];if(this._getCommandAndAncestors().reverse().filter((h)=>h._lifeCycleHooks[u]!==void 0).forEach((h)=>{h._lifeCycleHooks[u].forEach((f)=>{C.push({hookedCommand:h,callback:f})})}),u==="postAction")C.reverse();return C.forEach((h)=>{i=this._chainOrCall(i,()=>{return h.callback(h.hookedCommand,this)})}),i}_chainOrCallSubCommandHook(D,u,i){let C=D;if(this._lifeCycleHooks[i]!==void 0)this._lifeCycleHooks[i].forEach((h)=>{C=this._chainOrCall(C,()=>{return h(this,u)})});return C}_parseCommand(D,u){let i=this.parseOptions(u);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(i.operands),u=i.unknown,this.args=D.concat(u),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),u);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(u),this._dispatchSubcommand(this._defaultCommandName,D,u);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let C=()=>{if(i.unknown.length>0)this.unknownOption(i.unknown[0])},h=`command:${this.name()}`;if(this._actionHandler){C(),this._processArguments();let f;if(f=this._chainOrCallHooks(f,"preAction"),f=this._chainOrCall(f,()=>this._actionHandler(this.processedArgs)),this.parent)f=this._chainOrCall(f,()=>{this.parent.emit(h,D,u)});return f=this._chainOrCallHooks(f,"postAction"),f}if(this.parent&&this.parent.listenerCount(h))C(),this._processArguments(),this.parent.emit(h,D,u);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,u);if(this.listenerCount("command:*"))this.emit("command:*",D,u);else if(this.commands.length)this.unknownCommand();else C(),this._processArguments()}else if(this.commands.length)C(),this.help({error:!0});else C(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((u)=>u._name===D||u._aliases.includes(D))}_findOption(D){return this.options.find((u)=>u.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((u)=>{if(u.mandatory&&D.getOptionValue(u.attributeName())===void 0)D.missingMandatoryOptionValue(u)})})}_checkForConflictingLocalOptions(){let D=this.options.filter((i)=>{let C=i.attributeName();if(this.getOptionValue(C)===void 0)return!1;return this.getOptionValueSource(C)!=="default"});D.filter((i)=>i.conflictsWith.length>0).forEach((i)=>{let C=D.find((h)=>i.conflictsWith.includes(h.attributeName()));if(C)this._conflictingOption(i,C)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let u=[],i=[],C=u,h=D.slice();function f(B){return B.length>1&&B[0]==="-"}let E=null;while(h.length){let B=h.shift();if(B==="--"){if(C===i)C.push(B);C.push(...h);break}if(E&&!f(B)){this.emit(`option:${E.name()}`,B);continue}if(E=null,f(B)){let s=this._findOption(B);if(s){if(s.required){let A=h.shift();if(A===void 0)this.optionMissingArgument(s);this.emit(`option:${s.name()}`,A)}else if(s.optional){let A=null;if(h.length>0&&!f(h[0]))A=h.shift();this.emit(`option:${s.name()}`,A)}else this.emit(`option:${s.name()}`);E=s.variadic?s:null;continue}}if(B.length>2&&B[0]==="-"&&B[1]!=="-"){let s=this._findOption(`-${B[1]}`);if(s){if(s.required||s.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${s.name()}`,B.slice(2));else this.emit(`option:${s.name()}`),h.unshift(`-${B.slice(2)}`);continue}}if(/^--[^=]+=/.test(B)){let s=B.indexOf("="),A=this._findOption(B.slice(0,s));if(A&&(A.required||A.optional)){this.emit(`option:${A.name()}`,B.slice(s+1));continue}}if(f(B))C=i;if((this._enablePositionalOptions||this._passThroughOptions)&&u.length===0&&i.length===0){if(this._findCommand(B)){if(u.push(B),h.length>0)i.push(...h);break}else if(this._getHelpCommand()&&B===this._getHelpCommand().name()){if(u.push(B),h.length>0)u.push(...h);break}else if(this._defaultCommandName){if(i.push(B),h.length>0)i.push(...h);break}}if(this._passThroughOptions){if(C.push(B),h.length>0)C.push(...h);break}C.push(B)}return{operands:u,unknown:i}}opts(){if(this._storeOptionsAsProperties){let D={},u=this.options.length;for(let i=0;i<u;i++){let C=this.options[i].attributeName();D[C]=C===this._versionOptionName?this._version:this[C]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,u)=>Object.assign(D,u.opts()),{})}error(D,u){if(this._outputConfiguration.outputError(`${D}
|
|
23
22
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
24
23
|
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
25
|
-
`),this.outputHelp({error:!0});let
|
|
26
|
-
`),this._exit(0,"commander.version",
|
|
27
|
-
Expecting one of '${
|
|
28
|
-
`)}),this}_outputHelpIfRequested(
|
|
24
|
+
`),this.outputHelp({error:!0});let i=u||{},C=i.exitCode||1,h=i.code||"commander.error";this._exit(C,h,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in g.env){let u=D.attributeName();if(this.getOptionValue(u)===void 0||["default","config","env"].includes(this.getOptionValueSource(u)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,g.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new a7(this.options),u=(i)=>{return this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i))};this.options.filter((i)=>i.implied!==void 0&&u(i.attributeName())&&D.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach((i)=>{Object.keys(i.implied).filter((C)=>!u(C)).forEach((C)=>{this.setOptionValueWithSource(C,i.implied[C],"implied")})})}missingArgument(D){let u=`error: missing required argument '${D}'`;this.error(u,{code:"commander.missingArgument"})}optionMissingArgument(D){let u=`error: option '${D.flags}' argument missing`;this.error(u,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let u=`error: required option '${D.flags}' not specified`;this.error(u,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,u){let i=(f)=>{let E=f.attributeName(),B=this.getOptionValue(E),s=this.options.find(($)=>$.negate&&E===$.attributeName()),A=this.options.find(($)=>!$.negate&&E===$.attributeName());if(s&&(s.presetArg===void 0&&B===!1||s.presetArg!==void 0&&B===s.presetArg))return s;return A||f},C=(f)=>{let E=i(f),B=E.attributeName();if(this.getOptionValueSource(B)==="env")return`environment variable '${E.envVar}'`;return`option '${E.flags}'`},h=`error: ${C(D)} cannot be used with ${C(u)}`;this.error(h,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let u="";if(D.startsWith("--")&&this._showSuggestionAfterError){let C=[],h=this;do{let f=h.createHelp().visibleOptions(h).filter((E)=>E.long).map((E)=>E.long);C=C.concat(f),h=h.parent}while(h&&!h._enablePositionalOptions);u=ti(D,C)}let i=`error: unknown option '${D}'${u}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let u=this.registeredArguments.length,i=u===1?"":"s",h=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${u} argument${i} but got ${D.length}.`;this.error(h,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],u="";if(this._showSuggestionAfterError){let C=[];this.createHelp().visibleCommands(this).forEach((h)=>{if(C.push(h.name()),h.alias())C.push(h.alias())}),u=ti(D,C)}let i=`error: unknown command '${D}'${u}`;this.error(i,{code:"commander.unknownCommand"})}version(D,u,i){if(D===void 0)return this._version;this._version=D,u=u||"-V, --version",i=i||"output the version number";let C=this.createOption(u,i);return this._versionOptionName=C.attributeName(),this._registerOption(C),this.on("option:"+C.name(),()=>{this._outputConfiguration.writeOut(`${D}
|
|
25
|
+
`),this._exit(0,"commander.version",D)}),this}description(D,u){if(D===void 0&&u===void 0)return this._description;if(this._description=D,u)this._argsDescription=u;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let u=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)u=this.commands[this.commands.length-1];if(D===u._name)throw Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(D);if(i){let C=[i.name()].concat(i.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${C}'`)}return u._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((u)=>this.alias(u)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let u=this.registeredArguments.map((i)=>{return o7(i)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?u:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}nameFromFilename(D){return this._name=eD.basename(D,eD.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let u=this.createHelp(),i=this._getOutputContext(D);u.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let C=u.formatHelp(this,u);if(i.hasColors)return C;return this._outputConfiguration.stripColor(C)}_getOutputContext(D){D=D||{};let u=!!D.error,i,C,h;if(u)i=(E)=>this._outputConfiguration.writeErr(E),C=this._outputConfiguration.getErrHasColors(),h=this._outputConfiguration.getErrHelpWidth();else i=(E)=>this._outputConfiguration.writeOut(E),C=this._outputConfiguration.getOutHasColors(),h=this._outputConfiguration.getOutHelpWidth();return{error:u,write:(E)=>{if(!C)E=this._outputConfiguration.stripColor(E);return i(E)},hasColors:C,helpWidth:h}}outputHelp(D){let u;if(typeof D==="function")u=D,D=void 0;let i=this._getOutputContext(D),C={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach((f)=>f.emit("beforeAllHelp",C)),this.emit("beforeHelp",C);let h=this.helpInformation({error:i.error});if(u){if(h=u(h),typeof h!=="string"&&!Buffer.isBuffer(h))throw Error("outputHelp callback must return a string or a Buffer")}if(i.write(h),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",C),this._getCommandAndAncestors().forEach((f)=>f.emit("afterAllHelp",C))}helpOption(D,u){if(typeof D==="boolean"){if(D)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return D=D??"-h, --help",u=u??"display help for command",this._helpOption=this.createOption(D,u),this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this}help(D){this.outputHelp(D);let u=Number(g.exitCode??0);if(u===0&&D&&typeof D!=="function"&&D.error)u=1;this._exit(u,"commander.help","(outputHelp)")}addHelpText(D,u){let i=["beforeAll","before","after","afterAll"];if(!i.includes(D))throw Error(`Unexpected value for position to addHelpText.
|
|
26
|
+
Expecting one of '${i.join("', '")}'`);let C=`${D}Help`;return this.on(C,(h)=>{let f;if(typeof u==="function")f=u({error:h.error,command:h.command});else f=u;if(f)h.write(`${f}
|
|
27
|
+
`)}),this}_outputHelpIfRequested(D){let u=this._getHelpOption();if(u&&D.find((C)=>u.is(C)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function $i(D){return D.map((u)=>{if(!u.startsWith("--inspect"))return u;let i,C="127.0.0.1",h="9229",f;if((f=u.match(/^(--inspect(-brk)?)$/))!==null)i=f[1];else if((f=u.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(i=f[1],/^\d+$/.test(f[3]))h=f[3];else C=f[3];else if((f=u.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)i=f[1],C=f[3],h=f[4];if(i&&h!=="0")return`${i}=${C}:${parseInt(h)+1}`;return u})}function vF(){if(g.env.NO_COLOR||g.env.FORCE_COLOR==="0"||g.env.FORCE_COLOR==="false")return!1;if(g.env.FORCE_COLOR||g.env.CLICOLOR_FORCE!==void 0)return!0;return}x7.Command=jF;x7.useColor=vF});var Ri=Yu((i9)=>{var{Argument:wi}=W0(),{Command:OF}=Ai(),{CommanderError:u9,InvalidArgumentError:mi}=P2(),{Help:F9}=PF(),{Option:_i}=qF();i9.program=new OF;i9.createCommand=(D)=>new OF(D);i9.createOption=(D,u)=>new _i(D,u);i9.createArgument=(D,u)=>new wi(D,u);i9.Command=OF;i9.Option=_i;i9.Argument=wi;i9.Help=F9;i9.CommanderError=u9;i9.InvalidArgumentError=mi;i9.InvalidOptionArgumentError=mi});var uC={};H0(uC,{prompt:()=>DC,kCancel:()=>ei});import TD,{stdin as Y9,stdout as Z9}from"node:process";import Qi from"node:readline";import{WriteStream as z9}from"node:tty";function V9(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function H9(){if(Li)return u8;Li=1;let D="\x1B",u=`${D}[`,i="\x07",C={to(E,B){if(!B)return`${u}${E+1}G`;return`${u}${B+1};${E+1}H`},move(E,B){let s="";if(E<0)s+=`${u}${-E}D`;else if(E>0)s+=`${u}${E}C`;if(B<0)s+=`${u}${-B}A`;else if(B>0)s+=`${u}${B}B`;return s},up:(E=1)=>`${u}${E}A`,down:(E=1)=>`${u}${E}B`,forward:(E=1)=>`${u}${E}C`,backward:(E=1)=>`${u}${E}D`,nextLine:(E=1)=>`${u}E`.repeat(E),prevLine:(E=1)=>`${u}F`.repeat(E),left:`${u}G`,hide:`${u}?25l`,show:`${u}?25h`,save:`${D}7`,restore:`${D}8`},h={up:(E=1)=>`${u}S`.repeat(E),down:(E=1)=>`${u}T`.repeat(E)},f={screen:`${u}2J`,up:(E=1)=>`${u}1J`.repeat(E),down:(E=1)=>`${u}J`.repeat(E),line:`${u}2K`,lineEnd:`${u}K`,lineStart:`${u}1K`,lines(E){let B="";for(let s=0;s<E;s++)B+=this.line+(s<E-1?C.up():"");if(E)B+=C.left;return B}};return u8={cursor:C,scroll:h,erase:f,beep:i},u8}function W9(){if(Xi)return g0.exports;Xi=1;let D=process||{},u=D.argv||[],i=D.env||{},C=!(!!i.NO_COLOR||u.includes("--no-color"))&&(!!i.FORCE_COLOR||u.includes("--color")||D.platform==="win32"||(D.stdout||{}).isTTY&&i.TERM!=="dumb"||!!i.CI),h=(B,s,A=B)=>($)=>{let R=""+$,m=R.indexOf(s,B.length);return~m?B+f(R,s,A,m)+s:B+R+s},f=(B,s,A,$)=>{let R="",m=0;do R+=B.substring(m,$)+A,m=$+s.length,$=B.indexOf(s,m);while(~$);return R+B.substring(m)},E=(B=C)=>{let s=B?h:()=>String;return{isColorSupported:B,reset:s("\x1B[0m","\x1B[0m"),bold:s("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:s("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:s("\x1B[3m","\x1B[23m"),underline:s("\x1B[4m","\x1B[24m"),inverse:s("\x1B[7m","\x1B[27m"),hidden:s("\x1B[8m","\x1B[28m"),strikethrough:s("\x1B[9m","\x1B[29m"),black:s("\x1B[30m","\x1B[39m"),red:s("\x1B[31m","\x1B[39m"),green:s("\x1B[32m","\x1B[39m"),yellow:s("\x1B[33m","\x1B[39m"),blue:s("\x1B[34m","\x1B[39m"),magenta:s("\x1B[35m","\x1B[39m"),cyan:s("\x1B[36m","\x1B[39m"),white:s("\x1B[37m","\x1B[39m"),gray:s("\x1B[90m","\x1B[39m"),bgBlack:s("\x1B[40m","\x1B[49m"),bgRed:s("\x1B[41m","\x1B[49m"),bgGreen:s("\x1B[42m","\x1B[49m"),bgYellow:s("\x1B[43m","\x1B[49m"),bgBlue:s("\x1B[44m","\x1B[49m"),bgMagenta:s("\x1B[45m","\x1B[49m"),bgCyan:s("\x1B[46m","\x1B[49m"),bgWhite:s("\x1B[47m","\x1B[49m"),blackBright:s("\x1B[90m","\x1B[39m"),redBright:s("\x1B[91m","\x1B[39m"),greenBright:s("\x1B[92m","\x1B[39m"),yellowBright:s("\x1B[93m","\x1B[39m"),blueBright:s("\x1B[94m","\x1B[39m"),magentaBright:s("\x1B[95m","\x1B[39m"),cyanBright:s("\x1B[96m","\x1B[39m"),whiteBright:s("\x1B[97m","\x1B[39m"),bgBlackBright:s("\x1B[100m","\x1B[49m"),bgRedBright:s("\x1B[101m","\x1B[49m"),bgGreenBright:s("\x1B[102m","\x1B[49m"),bgYellowBright:s("\x1B[103m","\x1B[49m"),bgBlueBright:s("\x1B[104m","\x1B[49m"),bgMagentaBright:s("\x1B[105m","\x1B[49m"),bgCyanBright:s("\x1B[106m","\x1B[49m"),bgWhiteBright:s("\x1B[107m","\x1B[49m")}};return g0.exports=E(),g0.exports.createColors=E,g0.exports}function P9({onlyFirst:D=!1}={}){let u=["[\\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(u,D?void 0:"g")}function ki(D){if(typeof D!="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(q9,"")}function vi(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function q2(D,u={}){if(typeof D!="string"||D.length===0||(u={ambiguousIsNarrow:!0,...u},D=ki(D),D.length===0))return 0;D=D.replace(j9()," ");let i=u.ambiguousIsNarrow?1:2,C=0;for(let h of D){let f=h.codePointAt(0);if(f<=31||f>=127&&f<=159||f>=768&&f<=879)continue;switch(k9.eastAsianWidth(h)){case"F":case"W":C+=2;break;case"A":C+=i;break;default:C+=1}}return C}function d9(){let D=new Map;for(let[u,i]of Object.entries(x)){for(let[C,h]of Object.entries(i))x[C]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},i[C]=x[C],D.set(h[0],h[1]);Object.defineProperty(x,u,{value:i,enumerable:!1})}return Object.defineProperty(x,"codes",{value:D,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=Yi(),x.color.ansi256=Zi(),x.color.ansi16m=zi(),x.bgColor.ansi=Yi(F8),x.bgColor.ansi256=Zi(F8),x.bgColor.ansi16m=zi(F8),Object.defineProperties(x,{rgbToAnsi256:{value:(u,i,C)=>u===i&&i===C?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(i/255*5)+Math.round(C/255*5),enumerable:!1},hexToRgb:{value:(u)=>{let i=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!i)return[0,0,0];let[C]=i;C.length===3&&(C=[...C].map((f)=>f+f).join(""));let h=Number.parseInt(C,16);return[h>>16&255,h>>8&255,h&255]},enumerable:!1},hexToAnsi256:{value:(u)=>x.rgbToAnsi256(...x.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:(u)=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let i,C,h;if(u>=232)i=((u-232)*10+8)/255,C=i,h=i;else{u-=16;let B=u%36;i=Math.floor(u/36)/5,C=Math.floor(B/6)/5,h=B%6/5}let f=Math.max(i,C,h)*2;if(f===0)return 30;let E=30+(Math.round(h)<<2|Math.round(C)<<1|Math.round(i));return f===2&&(E+=60),E},enumerable:!1},rgbToAnsi:{value:(u,i,C)=>x.ansi256ToAnsi(x.rgbToAnsi256(u,i,C)),enumerable:!1},hexToAnsi:{value:(u)=>x.ansi256ToAnsi(x.hexToAnsi256(u)),enumerable:!1}}),x}function Wi(D,u,i){return String(D).normalize().replace(/\r\n/g,`
|
|
29
28
|
`).split(`
|
|
30
|
-
`).map((
|
|
31
|
-
`)}function
|
|
32
|
-
`),
|
|
33
|
-
`),
|
|
34
|
-
`),
|
|
35
|
-
`).length-1;this.output.write(
|
|
36
|
-
`);this.output.write(
|
|
37
|
-
`).slice(
|
|
38
|
-
`)),this._prevFrame=u;return}this.output.write(W.erase.down())}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u}}}function rr(){return Q.platform!=="win32"?Q.env.TERM!=="linux":!!Q.env.CI||!!Q.env.WT_SESSION||!!Q.env.TERMINUS_SUBLIME||Q.env.ConEmuTask==="{cmd::Cmder}"||Q.env.TERM_PROGRAM==="Terminus-Sublime"||Q.env.TERM_PROGRAM==="vscode"||Q.env.TERM==="xterm-256color"||Q.env.TERM==="alacritty"||Q.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function ht(u,D={}){let t=(r)=>{if(typeof r!=="symbol"||r.toString()!=="Symbol(clack:cancel)")return r;switch(D.cancel){case"reject":{let n=Error("Prompt cancelled.");if(n.name="ConsolaPromptCancelledError",Error.captureStackTrace)Error.captureStackTrace(n,ht);throw n}case"undefined":return;case"null":return null;case"symbol":return Et;default:case"default":return D.default??D.initial}};if(!D.type||D.type==="text")return await hr({message:u,defaultValue:D.default,placeholder:D.placeholder,initialValue:D.initial}).then(t);if(D.type==="confirm")return await cr({message:u,initialValue:D.initial}).then(t);if(D.type==="select")return await Br({message:u,options:D.options.map((r)=>typeof r==="string"?{value:r,label:r}:r),initialValue:D.initial}).then(t);if(D.type==="multiselect")return await or({message:u,options:D.options.map((r)=>typeof r==="string"?{value:r,label:r}:r),required:D.required,initialValues:D.initial}).then(t);throw Error(`Unknown prompt type: ${D.type}`)}var vu,HD,W,$u,VD,g2,h,P2,rt,Q2,W2,z2=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},Y2,ju=10,kD=(u=0)=>(D)=>`\x1B[${D+u}m`,KD=(u=0)=>(D)=>`\x1B[${38+u};5;${D}m`,vD=(u=0)=>(D,t,r)=>`\x1B[${38+u};2;${D};${t};${r}m`,U,q2,Z2,X2,_u,H2=39,uD="\x07",nt="[",V2="]",Ft="m",DD,jD=(u)=>`${_u.values().next().value}${nt}${u}${Ft}`,OD=(u)=>`${_u.values().next().value}${DD}${u}${uD}`,k2=(u)=>u.split(" ").map((D)=>su(D)),Ou=(u,D,t)=>{let r=[...D],n=!1,F=!1,i=su(tt(u[u.length-1]));for(let[e,s]of r.entries()){let f=su(s);if(i+f<=t?u[u.length-1]+=s:(u.push(s),i=0),_u.has(s)&&(n=!0,F=r.slice(e+1).join("").startsWith(DD)),n){F?s===uD&&(n=!1,F=!1):s===Ft&&(n=!1);continue}i+=f,i===t&&e<r.length-1&&(u.push(""),i=0)}!i&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},K2=(u)=>{let D=u.split(" "),t=D.length;for(;t>0&&!(su(D[t-1])>0);)t--;return t===D.length?u:D.slice(0,t).join(" ")+D.slice(t).join("")},v2=(u,D,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let r="",n,F,i=k2(u),e=[""];for(let[f,C]of u.split(" ").entries()){t.trim!==!1&&(e[e.length-1]=e[e.length-1].trimStart());let E=su(e[e.length-1]);if(f!==0&&(E>=D&&(t.wordWrap===!1||t.trim===!1)&&(e.push(""),E=0),(E>0||t.trim===!1)&&(e[e.length-1]+=" ",E++)),t.hard&&i[f]>D){let c=D-E,B=1+Math.floor((i[f]-c-1)/D);Math.floor((i[f]-1)/D)<B&&e.push(""),Ou(e,C,D);continue}if(E+i[f]>D&&E>0&&i[f]>0){if(t.wordWrap===!1&&E<D){Ou(e,C,D);continue}e.push("")}if(E+i[f]>D&&t.wordWrap===!1){Ou(e,C,D);continue}e[e.length-1]+=C}t.trim!==!1&&(e=e.map((f)=>K2(f)));let s=[...e.join(`
|
|
39
|
-
`)];for(let[
|
|
40
|
-
`?(
|
|
41
|
-
`&&(
|
|
42
|
-
${
|
|
43
|
-
`,
|
|
44
|
-
${
|
|
45
|
-
${
|
|
46
|
-
`;case"submit":return`${
|
|
47
|
-
${
|
|
48
|
-
${
|
|
49
|
-
`}}}).prompt(),
|
|
50
|
-
${
|
|
51
|
-
`,
|
|
52
|
-
${
|
|
53
|
-
${
|
|
54
|
-
`}}}).prompt()},
|
|
55
|
-
${
|
|
56
|
-
`;switch(this.state){case"submit":return`${
|
|
57
|
-
${
|
|
58
|
-
${
|
|
59
|
-
${
|
|
60
|
-
`}}}).prompt()},
|
|
61
|
-
${
|
|
62
|
-
${
|
|
63
|
-
`,
|
|
64
|
-
${
|
|
65
|
-
`).map((
|
|
66
|
-
`);return`${
|
|
67
|
-
${
|
|
68
|
-
${
|
|
69
|
-
`}default:return`${
|
|
70
|
-
${
|
|
71
|
-
${
|
|
72
|
-
`}}}).prompt()},Et;var Bt=$i(()=>{W=J2(),$u={exports:{}};g2=M2(),h=N2(g2);P2=L2();rt={exports:{}};(function(u){var D={};u.exports=D,D.eastAsianWidth=function(r){var n=r.charCodeAt(0),F=r.length==2?r.charCodeAt(1):0,i=n;return 55296<=n&&n<=56319&&56320<=F&&F<=57343&&(n&=1023,F&=1023,i=n<<10|F,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"},D.characterLength=function(r){var n=this.eastAsianWidth(r);return n=="F"||n=="W"||n=="A"?2:1};function t(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}D.length=function(r){for(var n=t(r),F=0,i=0;i<n.length;i++)F=F+this.characterLength(n[i]);return F},D.slice=function(r,n,F){textLen=D.length(r),n=n||0,F=F||1,n<0&&(n=textLen+n),F<0&&(F=textLen+F);for(var i="",e=0,s=t(r),f=0;f<s.length;f++){var C=s[f],E=D.length(C);if(e>=n-(E==2?1:0))if(e+E<=F)i+=C;else break;e+=E}return i}})(rt);Q2=rt.exports,W2=it(Q2),Y2=it(z2);U={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(U.modifier);q2=Object.keys(U.color),Z2=Object.keys(U.bgColor);[...q2,...Z2];X2=a2(),_u=new Set(["\x1B","\x9B"]),DD=`${V2}8;;`;j2=["up","down","left","right","space","enter","cancel"],wu={actions:new Set(j2),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");pD=Symbol("clack:cancel");d2=Object.defineProperty;st=class st extends Cu{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,!1),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(D)=>{this.output.write(W.cursor.move(0,-1)),this.value=D,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};x2=Object.defineProperty,Dr=class extends Cu{constructor(u){super(u,!1),xD(this,"options"),xD(this,"cursor",0),this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:D})=>D===u.cursorAt),0),this.on("key",(D)=>{D==="a"&&this.toggleAll()}),this.on("cursor",(D)=>{switch(D){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let u=this.value.length===this.options.length;this.value=u?[]:this.options.map((D)=>D.value)}toggleValue(){let u=this.value.includes(this._value);this.value=u?this.value.filter((D)=>D!==this._value):[...this.value,this._value]}},tr=Object.defineProperty;Ct=class Ct extends Cu{constructor(u){super(u,!1),ut(this,"options"),ut(this,"cursor",0),this.options=u.options,this.cursor=this.options.findIndex(({value:D})=>D===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(D)=>{switch(D){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};ft=class ft extends Cu{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let u=this.value.slice(0,this.cursor),[D,...t]=this.value.slice(this.cursor);return`${u}${h.inverse(D)}${t.join("")}`}get cursor(){return this._cursor}constructor(u){super(u),this.on("finalize",()=>{this.value||(this.value=u.defaultValue)})}};nr=rr(),Fr=z("\u276F",">"),er=z("\u25A0","x"),sr=z("\u25B2","x"),Cr=z("\u2714","\u221A"),T=z(""),tu=z(""),du=z("\u25CF",">"),pu=z("\u25CB"," "),fr=z("\u25FB","[\u2022]"),Dt=z("\u25FC","[+]"),Er=z("\u25FB","[ ]");`${h.gray(T)} `;Et=Symbol.for("cancel")});var MD=ci(JD(),1),{program:z0,createCommand:Y0,createArgument:q0,createOption:Z0,CommanderError:a0,InvalidArgumentError:X0,InvalidOptionArgumentError:H0,Command:gD,Argument:V0,Option:k0,Help:K0}=MD.default;var J={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},Hu={silent:{level:-1},fatal:{level:J.fatal},error:{level:J.error},warn:{level:J.warn},log:{level:J.log},info:{level:J.info},success:{level:J.success},fail:{level:J.fail},ready:{level:J.info},start:{level:J.info},box:{level:J.info},debug:{level:J.debug},trace:{level:J.trace},verbose:{level:J.verbose}};function Zu(u){if(u===null||typeof u!=="object")return!1;let D=Object.getPrototypeOf(u);if(D!==null&&D!==Object.prototype&&Object.getPrototypeOf(D)!==null)return!1;if(Symbol.iterator in u)return!1;if(Symbol.toStringTag in u)return Object.prototype.toString.call(u)==="[object Module]";return!0}function Vu(u,D,t=".",r){if(!Zu(D))return Vu(u,{},t,r);let n=Object.assign({},D);for(let F in u){if(F==="__proto__"||F==="constructor")continue;let i=u[F];if(i===null||i===void 0)continue;if(r&&r(n,F,i,t))continue;if(Array.isArray(i)&&Array.isArray(n[F]))n[F]=[...i,...n[F]];else if(Zu(i)&&Zu(n[F]))n[F]=Vu(i,n[F],(t?`${t}.`:"")+F.toString(),r);else n[F]=i}return n}function s2(u){return(...D)=>D.reduce((t,r)=>Vu(t,r,"",u),{})}var C2=s2();function f2(u){return Object.prototype.toString.call(u)==="[object Object]"}function E2(u){if(!f2(u))return!1;if(!u.message&&!u.args)return!1;if(u.stack)return!1;return!0}var au=!1,LD=[];class N{options;_lastLog;_mockFn;constructor(u={}){let D=u.types||Hu;this.options=C2({...u,defaults:{...u.defaults},level:Xu(u.level,D),reporters:[...u.reporters||[]]},{types:Hu,throttle:1000,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let t in D){let r={type:t,...this.options.defaults,...D[t]};this[t]=this._wrapLogFn(r),this[t].raw=this._wrapLogFn(r,!0)}if(this.options.mockFn)this.mockTypes();this._lastLog={}}get level(){return this.options.level}set level(u){this.options.level=Xu(u,this.options.types,this.options.level)}prompt(u,D){if(!this.options.prompt)throw Error("prompt is not supported!");return this.options.prompt(u,D)}create(u){let D=new N({...this.options,...u});if(this._mockFn)D.mockTypes(this._mockFn);return D}withDefaults(u){return this.create({...this.options,defaults:{...this.options.defaults,...u}})}withTag(u){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+u:u})}addReporter(u){return this.options.reporters.push(u),this}removeReporter(u){if(u){let D=this.options.reporters.indexOf(u);if(D!==-1)return this.options.reporters.splice(D,1)}else this.options.reporters.splice(0);return this}setReporters(u){return this.options.reporters=Array.isArray(u)?u:[u],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let u in this.options.types){if(!console["__"+u])console["__"+u]=console[u];console[u]=this[u].raw}}restoreConsole(){for(let u in this.options.types)if(console["__"+u])console[u]=console["__"+u],delete console["__"+u]}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(u,D){if(!u)return;if(!u.__write)u.__write=u.write;u.write=(t)=>{this[D].raw(String(t).trim())}}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(u){if(!u)return;if(u.__write)u.write=u.__write,delete u.__write}pauseLogs(){au=!0}resumeLogs(){au=!1;let u=LD.splice(0);for(let D of u)D[0]._logFn(D[1],D[2])}mockTypes(u){let D=u||this.options.mockFn;if(this._mockFn=D,typeof D!=="function")return;for(let t in this.options.types)this[t]=D(t,this.options.types[t])||this[t],this[t].raw=this[t]}_wrapLogFn(u,D){return(...t)=>{if(au){LD.push([this,u,t,D]);return}return this._logFn(u,t,D)}}_logFn(u,D,t){if((u.level||0)>this.level)return!1;let r={date:new Date,args:[],...u,level:Xu(u.level,this.options.types)};if(!t&&D.length===1&&E2(D[0]))Object.assign(r,D[0]);else r.args=[...D];if(r.message)r.args.unshift(r.message),delete r.message;if(r.additional){if(!Array.isArray(r.additional))r.additional=r.additional.split(`
|
|
73
|
-
`);r.args.push(`
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
`)
|
|
78
|
-
|
|
29
|
+
`).map((C)=>u4(C,u,i)).join(`
|
|
30
|
+
`)}function di(D,u){if(typeof D=="string")return v0.aliases.get(D)===u;for(let i of D)if(i!==void 0&&di(i,u))return!0;return!1}function i4(D,u){if(D===u)return;let i=D.split(`
|
|
31
|
+
`),C=u.split(`
|
|
32
|
+
`),h=[];for(let f=0;f<Math.max(i.length,C.length);f++)i[f]!==C[f]&&h.push(f);return h}function k0(D,u){let i=D;i.isTTY&&i.setRawMode(u)}class g2{constructor(D,u=!0){mD(this,"input"),mD(this,"output"),mD(this,"_abortSignal"),mD(this,"rl"),mD(this,"opts"),mD(this,"_render"),mD(this,"_track",!1),mD(this,"_prevFrame",""),mD(this,"_subscribers",new Map),mD(this,"_cursor",0),mD(this,"state","initial"),mD(this,"error",""),mD(this,"value");let{input:i=Y9,output:C=Z9,render:h,signal:f,...E}=D;this.opts=E,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=h.bind(this),this._track=u,this._abortSignal=f,this.input=i,this.output=C}unsubscribe(){this._subscribers.clear()}setSubscriber(D,u){let i=this._subscribers.get(D)??[];i.push(u),this._subscribers.set(D,i)}on(D,u){this.setSubscriber(D,{cb:u})}once(D,u){this.setSubscriber(D,{cb:u,once:!0})}emit(D,...u){let i=this._subscribers.get(D)??[],C=[];for(let h of i)h.cb(...u),h.once&&C.push(()=>i.splice(i.indexOf(h),1));for(let h of C)h()}prompt(){return new Promise((D,u)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(Ki);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let i=new z9(0);i._write=(C,h,f)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),f()},this.input.pipe(i),this.rl=Qi.createInterface({input:this.input,output:i,tabSize:2,prompt:"",escapeCodeTimeout:50}),Qi.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),k0(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(ID.cursor.show),this.output.off("resize",this.render),k0(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(ID.cursor.show),this.output.off("resize",this.render),k0(this.input,!1),D(Ki)})})}onKeypress(D,u){if(this.state==="error"&&(this.state="active"),u?.name&&(!this._track&&v0.aliases.has(u.name)&&this.emit("cursor",v0.aliases.get(u.name)),v0.actions.has(u.name)&&this.emit("cursor",u.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),D==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),D&&this.emit("key",D.toLowerCase()),u?.name==="return"){if(this.opts.validate){let i=this.opts.validate(this.value);i&&(this.error=i instanceof Error?i.message:i,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}di([D,u?.name,u?.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(`
|
|
33
|
+
`),k0(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let D=Wi(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
34
|
+
`).length-1;this.output.write(ID.cursor.move(-999,D*-1))}render(){let D=Wi(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(ID.cursor.hide);else{let u=i4(this._prevFrame,D);if(this.restoreCursor(),u&&u?.length===1){let i=u[0];this.output.write(ID.cursor.move(0,i)),this.output.write(ID.erase.lines(1));let C=D.split(`
|
|
35
|
+
`);this.output.write(C[i]),this._prevFrame=D,this.output.write(ID.cursor.move(0,C.length-i-1));return}if(u&&u?.length>1){let i=u[0];this.output.write(ID.cursor.move(0,i)),this.output.write(ID.erase.down());let C=D.split(`
|
|
36
|
+
`).slice(i);this.output.write(C.join(`
|
|
37
|
+
`)),this._prevFrame=D;return}this.output.write(ID.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}}function B4(){return TD.platform!=="win32"?TD.env.TERM!=="linux":!!TD.env.CI||!!TD.env.WT_SESSION||!!TD.env.TERMINUS_SUBLIME||TD.env.ConEmuTask==="{cmd::Cmder}"||TD.env.TERM_PROGRAM==="Terminus-Sublime"||TD.env.TERM_PROGRAM==="vscode"||TD.env.TERM==="xterm-256color"||TD.env.TERM==="alacritty"||TD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function DC(D,u={}){let i=(C)=>{if(typeof C!=="symbol"||C.toString()!=="Symbol(clack:cancel)")return C;switch(u.cancel){case"reject":{let h=Error("Prompt cancelled.");if(h.name="ConsolaPromptCancelledError",Error.captureStackTrace)Error.captureStackTrace(h,DC);throw h}case"undefined":return;case"null":return null;case"symbol":return ei;default:case"default":return u.default??u.initial}};if(!u.type||u.type==="text")return await R4({message:D,defaultValue:u.default,placeholder:u.placeholder,initialValue:u.initial}).then(i);if(u.type==="confirm")return await b4({message:D,initialValue:u.initial}).then(i);if(u.type==="select")return await S4({message:D,options:u.options.map((C)=>typeof C==="string"?{value:C,label:C}:C),initialValue:u.initial}).then(i);if(u.type==="multiselect")return await l4({message:D,options:u.options.map((C)=>typeof C==="string"?{value:C,label:C}:C),required:u.required,initialValues:u.initial}).then(i);throw Error(`Unknown prompt type: ${u.type}`)}var u8,Li,ID,g0,Xi,K9,U,q9,ji,g9,k9,v9=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},j9,F8=10,Yi=(D=0)=>(u)=>`\x1B[${u+D}m`,Zi=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,zi=(D=0)=>(u,i,C)=>`\x1B[${38+D};2;${u};${i};${C}m`,x,O9,o9,p9,j0,a9=39,r8="\x07",Oi="[",x9="]",oi="m",f8,Vi=(D)=>`${j0.values().next().value}${Oi}${D}${oi}`,Hi=(D)=>`${j0.values().next().value}${f8}${D}${r8}`,e9=(D)=>D.split(" ").map((u)=>q2(u)),i8=(D,u,i)=>{let C=[...u],h=!1,f=!1,E=q2(ki(D[D.length-1]));for(let[B,s]of C.entries()){let A=q2(s);if(E+A<=i?D[D.length-1]+=s:(D.push(s),E=0),j0.has(s)&&(h=!0,f=C.slice(B+1).join("").startsWith(f8)),h){f?s===r8&&(h=!1,f=!1):s===oi&&(h=!1);continue}E+=A,E===i&&B<C.length-1&&(D.push(""),E=0)}!E&&D[D.length-1].length>0&&D.length>1&&(D[D.length-2]+=D.pop())},D4=(D)=>{let u=D.split(" "),i=u.length;for(;i>0&&!(q2(u[i-1])>0);)i--;return i===u.length?D:u.slice(0,i).join(" ")+u.slice(i).join("")},u4=(D,u,i={})=>{if(i.trim!==!1&&D.trim()==="")return"";let C="",h,f,E=e9(D),B=[""];for(let[A,$]of D.split(" ").entries()){i.trim!==!1&&(B[B.length-1]=B[B.length-1].trimStart());let R=q2(B[B.length-1]);if(A!==0&&(R>=u&&(i.wordWrap===!1||i.trim===!1)&&(B.push(""),R=0),(R>0||i.trim===!1)&&(B[B.length-1]+=" ",R++)),i.hard&&E[A]>u){let m=u-R,l=1+Math.floor((E[A]-m-1)/u);Math.floor((E[A]-1)/u)<l&&B.push(""),i8(B,$,u);continue}if(R+E[A]>u&&R>0&&E[A]>0){if(i.wordWrap===!1&&R<u){i8(B,$,u);continue}B.push("")}if(R+E[A]>u&&i.wordWrap===!1){i8(B,$,u);continue}B[B.length-1]+=$}i.trim!==!1&&(B=B.map((A)=>D4(A)));let s=[...B.join(`
|
|
38
|
+
`)];for(let[A,$]of s.entries()){if(C+=$,j0.has($)){let{groups:m}=new RegExp(`(?:\\${Oi}(?<code>\\d+)m|\\${f8}(?<uri>.*)${r8})`).exec(s.slice(A).join(""))||{groups:{}};if(m.code!==void 0){let l=Number.parseFloat(m.code);h=l===a9?void 0:l}else m.uri!==void 0&&(f=m.uri.length===0?void 0:m.uri)}let R=p9.codes.get(Number(h));s[A+1]===`
|
|
39
|
+
`?(f&&(C+=Hi("")),h&&R&&(C+=Vi(R))):$===`
|
|
40
|
+
`&&(h&&R&&(C+=Vi(h)),f&&(C+=Hi(f)))}return C},F4,v0,Ki,C4,E4=(D,u,i)=>(u in D)?C4(D,u,{enumerable:!0,configurable:!0,writable:!0,value:i}):D[u]=i,mD=(D,u,i)=>(E4(D,typeof u!="symbol"?u+"":u,i),i),pi,h4,r4=(D,u,i)=>(u in D)?h4(D,u,{enumerable:!0,configurable:!0,writable:!0,value:i}):D[u]=i,Pi=(D,u,i)=>(r4(D,typeof u!="symbol"?u+"":u,i),i),f4,c4,n4=(D,u,i)=>(u in D)?c4(D,u,{enumerable:!0,configurable:!0,writable:!0,value:i}):D[u]=i,qi=(D,u,i)=>(n4(D,typeof u!="symbol"?u+"":u,i),i),ai,xi,s4,yD=(D,u)=>s4?D:u,t4,$4,A4,w4,o,i2,C8,E8,m4,gi,_4,O0=(D)=>{switch(D){case"initial":case"active":return U.cyan(t4);case"cancel":return U.red($4);case"error":return U.yellow(A4);case"submit":return U.green(w4)}},h8=(D)=>{let{cursor:u,options:i,style:C}=D,h=D.maxItems??Number.POSITIVE_INFINITY,f=Math.max(process.stdout.rows-4,0),E=Math.min(f,Math.max(h,5)),B=0;u>=B+E-3?B=Math.max(Math.min(u-E+3,i.length-E),0):u<B+2&&(B=Math.max(u-2,0));let s=E<i.length&&B>0,A=E<i.length&&B+E<i.length;return i.slice(B,B+E).map(($,R,m)=>{let l=R===0&&s,S=R===m.length-1&&A;return l||S?U.dim("..."):C($,R+B===u)})},R4=(D)=>new xi({validate:D.validate,placeholder:D.placeholder,defaultValue:D.defaultValue,initialValue:D.initialValue,render(){let u=`${U.gray(o)}
|
|
41
|
+
${O0(this.state)} ${D.message}
|
|
42
|
+
`,i=D.placeholder?U.inverse(D.placeholder[0])+U.dim(D.placeholder.slice(1)):U.inverse(U.hidden("_")),C=this.value?this.valueWithCursor:i;switch(this.state){case"error":return`${u.trim()}
|
|
43
|
+
${U.yellow(o)} ${C}
|
|
44
|
+
${U.yellow(i2)} ${U.yellow(this.error)}
|
|
45
|
+
`;case"submit":return`${u}${U.gray(o)} ${U.dim(this.value||D.placeholder)}`;case"cancel":return`${u}${U.gray(o)} ${U.strikethrough(U.dim(this.value??""))}${this.value?.trim()?`
|
|
46
|
+
${U.gray(o)}`:""}`;default:return`${u}${U.cyan(o)} ${C}
|
|
47
|
+
${U.cyan(i2)}
|
|
48
|
+
`}}}).prompt(),b4=(D)=>{let u=D.active??"Yes",i=D.inactive??"No";return new pi({active:u,inactive:i,initialValue:D.initialValue??!0,render(){let C=`${U.gray(o)}
|
|
49
|
+
${O0(this.state)} ${D.message}
|
|
50
|
+
`,h=this.value?u:i;switch(this.state){case"submit":return`${C}${U.gray(o)} ${U.dim(h)}`;case"cancel":return`${C}${U.gray(o)} ${U.strikethrough(U.dim(h))}
|
|
51
|
+
${U.gray(o)}`;default:return`${C}${U.cyan(o)} ${this.value?`${U.green(C8)} ${u}`:`${U.dim(E8)} ${U.dim(u)}`} ${U.dim("/")} ${this.value?`${U.dim(E8)} ${U.dim(i)}`:`${U.green(C8)} ${i}`}
|
|
52
|
+
${U.cyan(i2)}
|
|
53
|
+
`}}}).prompt()},S4=(D)=>{let u=(i,C)=>{let h=i.label??String(i.value);switch(C){case"selected":return`${U.dim(h)}`;case"active":return`${U.green(C8)} ${h} ${i.hint?U.dim(`(${i.hint})`):""}`;case"cancelled":return`${U.strikethrough(U.dim(h))}`;default:return`${U.dim(E8)} ${U.dim(h)}`}};return new ai({options:D.options,initialValue:D.initialValue,render(){let i=`${U.gray(o)}
|
|
54
|
+
${O0(this.state)} ${D.message}
|
|
55
|
+
`;switch(this.state){case"submit":return`${i}${U.gray(o)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${i}${U.gray(o)} ${u(this.options[this.cursor],"cancelled")}
|
|
56
|
+
${U.gray(o)}`;default:return`${i}${U.cyan(o)} ${h8({cursor:this.cursor,options:this.options,maxItems:D.maxItems,style:(C,h)=>u(C,h?"active":"inactive")}).join(`
|
|
57
|
+
${U.cyan(o)} `)}
|
|
58
|
+
${U.cyan(i2)}
|
|
59
|
+
`}}}).prompt()},l4=(D)=>{let u=(i,C)=>{let h=i.label??String(i.value);return C==="active"?`${U.cyan(m4)} ${h} ${i.hint?U.dim(`(${i.hint})`):""}`:C==="selected"?`${U.green(gi)} ${U.dim(h)}`:C==="cancelled"?`${U.strikethrough(U.dim(h))}`:C==="active-selected"?`${U.green(gi)} ${h} ${i.hint?U.dim(`(${i.hint})`):""}`:C==="submitted"?`${U.dim(h)}`:`${U.dim(_4)} ${U.dim(h)}`};return new f4({options:D.options,initialValues:D.initialValues,required:D.required??!0,cursorAt:D.cursorAt,validate(i){if(this.required&&i.length===0)return`Please select at least one option.
|
|
60
|
+
${U.reset(U.dim(`Press ${U.gray(U.bgWhite(U.inverse(" space ")))} to select, ${U.gray(U.bgWhite(U.inverse(" enter ")))} to submit`))}`},render(){let i=`${U.gray(o)}
|
|
61
|
+
${O0(this.state)} ${D.message}
|
|
62
|
+
`,C=(h,f)=>{let E=this.value.includes(h.value);return f&&E?u(h,"active-selected"):E?u(h,"selected"):u(h,f?"active":"inactive")};switch(this.state){case"submit":return`${i}${U.gray(o)} ${this.options.filter(({value:h})=>this.value.includes(h)).map((h)=>u(h,"submitted")).join(U.dim(", "))||U.dim("none")}`;case"cancel":{let h=this.options.filter(({value:f})=>this.value.includes(f)).map((f)=>u(f,"cancelled")).join(U.dim(", "));return`${i}${U.gray(o)} ${h.trim()?`${h}
|
|
63
|
+
${U.gray(o)}`:""}`}case"error":{let h=this.error.split(`
|
|
64
|
+
`).map((f,E)=>E===0?`${U.yellow(i2)} ${U.yellow(f)}`:` ${f}`).join(`
|
|
65
|
+
`);return`${i+U.yellow(o)} ${h8({options:this.options,cursor:this.cursor,maxItems:D.maxItems,style:C}).join(`
|
|
66
|
+
${U.yellow(o)} `)}
|
|
67
|
+
${h}
|
|
68
|
+
`}default:return`${i}${U.cyan(o)} ${h8({options:this.options,cursor:this.cursor,maxItems:D.maxItems,style:C}).join(`
|
|
69
|
+
${U.cyan(o)} `)}
|
|
70
|
+
${U.cyan(i2)}
|
|
71
|
+
`}}}).prompt()},ei;var FC=zD(()=>{ID=H9(),g0={exports:{}};K9=W9(),U=V9(K9);q9=P9();ji={exports:{}};(function(D){var u={};D.exports=u,u.eastAsianWidth=function(C){var h=C.charCodeAt(0),f=C.length==2?C.charCodeAt(1):0,E=h;return 55296<=h&&h<=56319&&56320<=f&&f<=57343&&(h&=1023,f&=1023,E=h<<10|f,E+=65536),E==12288||65281<=E&&E<=65376||65504<=E&&E<=65510?"F":E==8361||65377<=E&&E<=65470||65474<=E&&E<=65479||65482<=E&&E<=65487||65490<=E&&E<=65495||65498<=E&&E<=65500||65512<=E&&E<=65518?"H":4352<=E&&E<=4447||4515<=E&&E<=4519||4602<=E&&E<=4607||9001<=E&&E<=9002||11904<=E&&E<=11929||11931<=E&&E<=12019||12032<=E&&E<=12245||12272<=E&&E<=12283||12289<=E&&E<=12350||12353<=E&&E<=12438||12441<=E&&E<=12543||12549<=E&&E<=12589||12593<=E&&E<=12686||12688<=E&&E<=12730||12736<=E&&E<=12771||12784<=E&&E<=12830||12832<=E&&E<=12871||12880<=E&&E<=13054||13056<=E&&E<=19903||19968<=E&&E<=42124||42128<=E&&E<=42182||43360<=E&&E<=43388||44032<=E&&E<=55203||55216<=E&&E<=55238||55243<=E&&E<=55291||63744<=E&&E<=64255||65040<=E&&E<=65049||65072<=E&&E<=65106||65108<=E&&E<=65126||65128<=E&&E<=65131||110592<=E&&E<=110593||127488<=E&&E<=127490||127504<=E&&E<=127546||127552<=E&&E<=127560||127568<=E&&E<=127569||131072<=E&&E<=194367||177984<=E&&E<=196605||196608<=E&&E<=262141?"W":32<=E&&E<=126||162<=E&&E<=163||165<=E&&E<=166||E==172||E==175||10214<=E&&E<=10221||10629<=E&&E<=10630?"Na":E==161||E==164||167<=E&&E<=168||E==170||173<=E&&E<=174||176<=E&&E<=180||182<=E&&E<=186||188<=E&&E<=191||E==198||E==208||215<=E&&E<=216||222<=E&&E<=225||E==230||232<=E&&E<=234||236<=E&&E<=237||E==240||242<=E&&E<=243||247<=E&&E<=250||E==252||E==254||E==257||E==273||E==275||E==283||294<=E&&E<=295||E==299||305<=E&&E<=307||E==312||319<=E&&E<=322||E==324||328<=E&&E<=331||E==333||338<=E&&E<=339||358<=E&&E<=359||E==363||E==462||E==464||E==466||E==468||E==470||E==472||E==474||E==476||E==593||E==609||E==708||E==711||713<=E&&E<=715||E==717||E==720||728<=E&&E<=731||E==733||E==735||768<=E&&E<=879||913<=E&&E<=929||931<=E&&E<=937||945<=E&&E<=961||963<=E&&E<=969||E==1025||1040<=E&&E<=1103||E==1105||E==8208||8211<=E&&E<=8214||8216<=E&&E<=8217||8220<=E&&E<=8221||8224<=E&&E<=8226||8228<=E&&E<=8231||E==8240||8242<=E&&E<=8243||E==8245||E==8251||E==8254||E==8308||E==8319||8321<=E&&E<=8324||E==8364||E==8451||E==8453||E==8457||E==8467||E==8470||8481<=E&&E<=8482||E==8486||E==8491||8531<=E&&E<=8532||8539<=E&&E<=8542||8544<=E&&E<=8555||8560<=E&&E<=8569||E==8585||8592<=E&&E<=8601||8632<=E&&E<=8633||E==8658||E==8660||E==8679||E==8704||8706<=E&&E<=8707||8711<=E&&E<=8712||E==8715||E==8719||E==8721||E==8725||E==8730||8733<=E&&E<=8736||E==8739||E==8741||8743<=E&&E<=8748||E==8750||8756<=E&&E<=8759||8764<=E&&E<=8765||E==8776||E==8780||E==8786||8800<=E&&E<=8801||8804<=E&&E<=8807||8810<=E&&E<=8811||8814<=E&&E<=8815||8834<=E&&E<=8835||8838<=E&&E<=8839||E==8853||E==8857||E==8869||E==8895||E==8978||9312<=E&&E<=9449||9451<=E&&E<=9547||9552<=E&&E<=9587||9600<=E&&E<=9615||9618<=E&&E<=9621||9632<=E&&E<=9633||9635<=E&&E<=9641||9650<=E&&E<=9651||9654<=E&&E<=9655||9660<=E&&E<=9661||9664<=E&&E<=9665||9670<=E&&E<=9672||E==9675||9678<=E&&E<=9681||9698<=E&&E<=9701||E==9711||9733<=E&&E<=9734||E==9737||9742<=E&&E<=9743||9748<=E&&E<=9749||E==9756||E==9758||E==9792||E==9794||9824<=E&&E<=9825||9827<=E&&E<=9829||9831<=E&&E<=9834||9836<=E&&E<=9837||E==9839||9886<=E&&E<=9887||9918<=E&&E<=9919||9924<=E&&E<=9933||9935<=E&&E<=9953||E==9955||9960<=E&&E<=9983||E==10045||E==10071||10102<=E&&E<=10111||11093<=E&&E<=11097||12872<=E&&E<=12879||57344<=E&&E<=63743||65024<=E&&E<=65039||E==65533||127232<=E&&E<=127242||127248<=E&&E<=127277||127280<=E&&E<=127337||127344<=E&&E<=127386||917760<=E&&E<=917999||983040<=E&&E<=1048573||1048576<=E&&E<=1114109?"A":"N"},u.characterLength=function(C){var h=this.eastAsianWidth(C);return h=="F"||h=="W"||h=="A"?2:1};function i(C){return C.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(C){for(var h=i(C),f=0,E=0;E<h.length;E++)f=f+this.characterLength(h[E]);return f},u.slice=function(C,h,f){textLen=u.length(C),h=h||0,f=f||1,h<0&&(h=textLen+h),f<0&&(f=textLen+f);for(var E="",B=0,s=i(C),A=0;A<s.length;A++){var $=s[A],R=u.length($);if(B>=h-(R==2?1:0))if(B+R<=f)E+=$;else break;B+=R}return E}})(ji);g9=ji.exports,k9=vi(g9),j9=vi(v9);x={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(x.modifier);O9=Object.keys(x.color),o9=Object.keys(x.bgColor);[...O9,...o9];p9=d9(),j0=new Set(["\x1B",""]),f8=`${x9}8;;`;F4=["up","down","left","right","space","enter","cancel"],v0={actions:new Set(F4),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");Ki=Symbol("clack:cancel");C4=Object.defineProperty;pi=class pi extends g2{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(u)=>{this.output.write(ID.cursor.move(0,-1)),this.value=u,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};h4=Object.defineProperty,f4=class extends g2{constructor(D){super(D,!1),Pi(this,"options"),Pi(this,"cursor",0),this.options=D.options,this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:u})=>u===D.cursorAt),0),this.on("key",(u)=>{u==="a"&&this.toggleAll()}),this.on("cursor",(u)=>{switch(u){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let D=this.value.length===this.options.length;this.value=D?[]:this.options.map((u)=>u.value)}toggleValue(){let D=this.value.includes(this._value);this.value=D?this.value.filter((u)=>u!==this._value):[...this.value,this._value]}},c4=Object.defineProperty;ai=class ai extends g2{constructor(D){super(D,!1),qi(this,"options"),qi(this,"cursor",0),this.options=D.options,this.cursor=this.options.findIndex(({value:u})=>u===D.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(u)=>{switch(u){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};xi=class xi extends g2{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let D=this.value.slice(0,this.cursor),[u,...i]=this.value.slice(this.cursor);return`${D}${U.inverse(u)}${i.join("")}`}get cursor(){return this._cursor}constructor(D){super(D),this.on("finalize",()=>{this.value||(this.value=D.defaultValue)})}};s4=B4(),t4=yD("❯",">"),$4=yD("■","x"),A4=yD("▲","x"),w4=yD("✔","√"),o=yD(""),i2=yD(""),C8=yD("●",">"),E8=yD("○"," "),m4=yD("◻","[•]"),gi=yD("◼","[+]"),_4=yD("◻","[ ]");`${U.gray(o)} `;ei=Symbol.for("cancel")});function s8(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var rh,fh=(D,u)=>rh(D,"name",{value:u,configurable:!0}),B8;var p0=zD(()=>{rh=Object.defineProperty,B8=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};fh(s8,"getDefaultExportFromCjs")});var $C={};H0($C,{toFormData:()=>tC});function sC(D){let u=D.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!u)return;let i=u[2]||u[3]||"",C=i.slice(i.lastIndexOf("\\")+1);return C=C.replace(/%22/g,'"'),C=C.replace(/&#(\d{4});/g,(h,f)=>String.fromCharCode(f)),C}async function tC(D,u){if(!/multipart/i.test(u))throw TypeError("Failed to fetch");let i=u.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!i)throw TypeError("no or bad content-type header, no multipart boundary");let C=new Ah(i[1]||i[2]),h,f,E,B,s,A,$=[],R=new Vu,m=_D((M)=>{E+=J.decode(M,{stream:!0})},"onPartData"),l=_D((M)=>{$.push(M)},"appendToFile"),S=_D(()=>{let M=new C2($,A,{type:s});R.append(B,M)},"appendFileToFormData"),y=_D(()=>{R.append(B,E)},"appendEntryToFormData"),J=new TextDecoder("utf-8");J.decode(),C.onPartBegin=function(){C.onPartData=m,C.onPartEnd=y,h="",f="",E="",B="",s="",A=null,$.length=0},C.onHeaderField=function(M){h+=J.decode(M,{stream:!0})},C.onHeaderValue=function(M){f+=J.decode(M,{stream:!0})},C.onHeaderEnd=function(){if(f+=J.decode(),h=h.toLowerCase(),h==="content-disposition"){let M=f.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);M&&(B=M[2]||M[3]||""),A=sC(f),A&&(C.onPartData=l,C.onPartEnd=S)}else h==="content-type"&&(s=f);f="",h=""};for await(let M of D)C.write(M);return C.end(),R}var ch,_D=(D,u)=>ch(D,"name",{value:u,configurable:!0}),WD=0,d,nC=1,Ru,a0=10,x0=13,nh=32,v2=45,Bh=58,sh=97,th=122,$h,zu,BC=class{constructor(u){this.index=0,this.flags=0,this.onHeaderEnd=zu,this.onHeaderField=zu,this.onHeadersEnd=zu,this.onHeaderValue=zu,this.onPartBegin=zu,this.onPartData=zu,this.onPartEnd=zu,this.boundaryChars={},u=`\r
|
|
72
|
+
--`+u;let i=new Uint8Array(u.length);for(let C=0;C<u.length;C++)i[C]=u.charCodeAt(C),this.boundaryChars[i[C]]=!0;this.boundary=i,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=d.START_BOUNDARY}write(u){let i=0,C=u.length,h=this.index,{lookbehind:f,boundary:E,boundaryChars:B,index:s,state:A,flags:$}=this,R=this.boundary.length,m=R-1,l=u.length,S,y,J=_D((Q)=>{this[Q+"Mark"]=i},"mark"),M=_D((Q)=>{delete this[Q+"Mark"]},"clear"),L=_D((Q,W,a,Fu)=>{(W===void 0||W!==a)&&this[Q](Fu&&Fu.subarray(W,a))},"callback"),v=_D((Q,W)=>{let a=Q+"Mark";a in this&&(W?(L(Q,this[a],i,u),delete this[a]):(L(Q,this[a],u.length,u),this[a]=0))},"dataCallback");for(i=0;i<C;i++)switch(S=u[i],A){case d.START_BOUNDARY:if(s===E.length-2){if(S===v2)$|=Ru.LAST_BOUNDARY;else if(S!==x0)return;s++;break}else if(s-1===E.length-2){if($&Ru.LAST_BOUNDARY&&S===v2)A=d.END,$=0;else if(!($&Ru.LAST_BOUNDARY)&&S===a0)s=0,L("onPartBegin"),A=d.HEADER_FIELD_START;else return;break}S!==E[s+2]&&(s=-2),S===E[s+2]&&s++;break;case d.HEADER_FIELD_START:A=d.HEADER_FIELD,J("onHeaderField"),s=0;case d.HEADER_FIELD:if(S===x0){M("onHeaderField"),A=d.HEADERS_ALMOST_DONE;break}if(s++,S===v2)break;if(S===Bh){if(s===1)return;v("onHeaderField",!0),A=d.HEADER_VALUE_START;break}if(y=$h(S),y<sh||y>th)return;break;case d.HEADER_VALUE_START:if(S===nh)break;J("onHeaderValue"),A=d.HEADER_VALUE;case d.HEADER_VALUE:S===x0&&(v("onHeaderValue",!0),L("onHeaderEnd"),A=d.HEADER_VALUE_ALMOST_DONE);break;case d.HEADER_VALUE_ALMOST_DONE:if(S!==a0)return;A=d.HEADER_FIELD_START;break;case d.HEADERS_ALMOST_DONE:if(S!==a0)return;L("onHeadersEnd"),A=d.PART_DATA_START;break;case d.PART_DATA_START:A=d.PART_DATA,J("onPartData");case d.PART_DATA:if(h=s,s===0){for(i+=m;i<l&&!(u[i]in B);)i+=R;i-=m,S=u[i]}if(s<E.length)E[s]===S?(s===0&&v("onPartData",!0),s++):s=0;else if(s===E.length)s++,S===x0?$|=Ru.PART_BOUNDARY:S===v2?$|=Ru.LAST_BOUNDARY:s=0;else if(s-1===E.length)if($&Ru.PART_BOUNDARY){if(s=0,S===a0){$&=~Ru.PART_BOUNDARY,L("onPartEnd"),L("onPartBegin"),A=d.HEADER_FIELD_START;break}}else $&Ru.LAST_BOUNDARY&&S===v2?(L("onPartEnd"),A=d.END,$=0):s=0;if(s>0)f[s-1]=S;else if(h>0){let Q=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);L("onPartData",0,h,Q),h=0,J("onPartData"),i--}break;case d.END:break;default:throw Error(`Unexpected state entered: ${A}`)}v("onHeaderField"),v("onHeaderValue"),v("onPartData"),this.index=s,this.state=A,this.flags=$}end(){if(this.state===d.HEADER_FIELD_START&&this.index===0||this.state===d.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==d.END)throw Error("MultipartParser.end(): stream ended unexpectedly")}},Ah;var AC=zD(()=>{e0();p0();ch=Object.defineProperty,d={START_BOUNDARY:WD++,HEADER_FIELD_START:WD++,HEADER_FIELD:WD++,HEADER_VALUE_START:WD++,HEADER_VALUE:WD++,HEADER_VALUE_ALMOST_DONE:WD++,HEADERS_ALMOST_DONE:WD++,PART_DATA_START:WD++,PART_DATA:WD++,END:WD++},Ru={PART_BOUNDARY:nC,LAST_BOUNDARY:nC*=2},$h=_D((D)=>D|32,"lower"),zu=_D(()=>{},"noop");_D(BC,"MultipartParser");Ah=BC;_D(sC,"_fileName");_D(tC,"toFormData")});import a2 from"node:http";import mh from"node:https";import h2 from"node:zlib";import qD,{PassThrough as f3,pipeline as r2}from"node:stream";import{Buffer as rD}from"node:buffer";import{types as c3,deprecate as n3,promisify as _h}from"node:util";import{format as Rh}from"node:url";import{isIP as bh}from"node:net";import{promises as Sh,statSync as JC,createReadStream as lh}from"node:fs";import{basename as Uh}from"node:path";function NC(D){if(!/^data:/i.test(D))throw TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');D=D.replace(/\r?\n/g,"");let u=D.indexOf(",");if(u===-1||u<=4)throw TypeError("malformed data: URI");let i=D.substring(5,u).split(";"),C="",h=!1,f=i[0]||"text/plain",E=f;for(let $=1;$<i.length;$++)i[$]==="base64"?h=!0:i[$]&&(E+=`;${i[$]}`,i[$].indexOf("charset=")===0&&(C=i[$].substring(8)));!i[0]&&!C.length&&(E+=";charset=US-ASCII",C="US-ASCII");let B=h?"base64":"ascii",s=unescape(D.substring(u+1)),A=Buffer.from(s,B);return A.type=f,A.typeFull=E,A.charset=C,A}function MC(){return mC||(mC=1,function(D,u){(function(i,C){C(u)})(Gh,function(i){function C(){}c(C,"noop");function h(F){return typeof F=="object"&&F!==null||typeof F=="function"}c(h,"typeIsObject");let f=C;function E(F,r){try{Object.defineProperty(F,"name",{value:r,configurable:!0})}catch{}}c(E,"setFunctionName");let B=Promise,s=Promise.prototype.then,A=Promise.reject.bind(B);function $(F){return new B(F)}c($,"newPromise");function R(F){return $((r)=>r(F))}c(R,"promiseResolvedWith");function m(F){return A(F)}c(m,"promiseRejectedWith");function l(F,r,n){return s.call(F,r,n)}c(l,"PerformPromiseThen");function S(F,r,n){l(l(F,r,n),void 0,f)}c(S,"uponPromise");function y(F,r){S(F,r)}c(y,"uponFulfillment");function J(F,r){S(F,void 0,r)}c(J,"uponRejection");function M(F,r,n){return l(F,r,n)}c(M,"transformPromiseWith");function L(F){l(F,void 0,f)}c(L,"setPromiseIsHandledToTrue");let v=c((F)=>{if(typeof queueMicrotask=="function")v=queueMicrotask;else{let r=R(void 0);v=c((n)=>l(r,n),"_queueMicrotask")}return v(F)},"_queueMicrotask");function Q(F,r,n){if(typeof F!="function")throw TypeError("Argument is not a function");return Function.prototype.apply.call(F,r,n)}c(Q,"reflectCall");function W(F,r,n){try{return R(Q(F,r,n))}catch(t){return m(t)}}c(W,"promiseCall");let a=16384,Fu=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(r){let n=this._back,t=n;n._elements.length===a-1&&(t={_elements:[],_next:void 0}),n._elements.push(r),t!==n&&(this._back=t,n._next=t),++this._size}shift(){let r=this._front,n=r,t=this._cursor,w=t+1,_=r._elements,b=_[t];return w===a&&(n=r._next,w=0),--this._size,this._cursor=w,r!==n&&(this._front=n),_[t]=void 0,b}forEach(r){let n=this._cursor,t=this._front,w=t._elements;for(;(n!==w.length||t._next!==void 0)&&!(n===w.length&&(t=t._next,w=t._elements,n=0,w.length===0));)r(w[n]),++n}peek(){let r=this._front,n=this._cursor;return r._elements[n]}};c(Fu,"SimpleQueue");let BD=Fu,d8=Symbol("[[AbortSteps]]"),p8=Symbol("[[ErrorSteps]]"),U3=Symbol("[[CancelSteps]]"),G3=Symbol("[[PullSteps]]"),T3=Symbol("[[ReleaseSteps]]");function I3(F,r){F._ownerReadableStream=r,r._reader=F,r._state==="readable"?C0(F):r._state==="closed"?a8(F):y3(F,r._storedError)}c(I3,"ReadableStreamReaderGenericInitialize");function i0(F,r){let n=F._ownerReadableStream;return bD(n,r)}c(i0,"ReadableStreamReaderGenericCancel");function YD(F){let r=F._ownerReadableStream;r._state==="readable"?E0(F,TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):x8(F,TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),r._readableStreamController[T3](),r._reader=void 0,F._ownerReadableStream=void 0}c(YD,"ReadableStreamReaderGenericRelease");function A2(F){return TypeError("Cannot "+F+" a stream using a released reader")}c(A2,"readerLockException");function C0(F){F._closedPromise=$((r,n)=>{F._closedPromise_resolve=r,F._closedPromise_reject=n})}c(C0,"defaultReaderClosedPromiseInitialize");function y3(F,r){C0(F),E0(F,r)}c(y3,"defaultReaderClosedPromiseInitializeAsRejected");function a8(F){C0(F),J3(F)}c(a8,"defaultReaderClosedPromiseInitializeAsResolved");function E0(F,r){F._closedPromise_reject!==void 0&&(L(F._closedPromise),F._closedPromise_reject(r),F._closedPromise_resolve=void 0,F._closedPromise_reject=void 0)}c(E0,"defaultReaderClosedPromiseReject");function x8(F,r){y3(F,r)}c(x8,"defaultReaderClosedPromiseResetToRejected");function J3(F){F._closedPromise_resolve!==void 0&&(F._closedPromise_resolve(void 0),F._closedPromise_resolve=void 0,F._closedPromise_reject=void 0)}c(J3,"defaultReaderClosedPromiseResolve");let e8=Number.isFinite||function(F){return typeof F=="number"&&isFinite(F)},c7=Math.trunc||function(F){return F<0?Math.ceil(F):Math.floor(F)};function D1(F){return typeof F=="object"||typeof F=="function"}c(D1,"isDictionary");function lD(F,r){if(F!==void 0&&!D1(F))throw TypeError(`${r} is not an object.`)}c(lD,"assertDictionary");function AD(F,r){if(typeof F!="function")throw TypeError(`${r} is not a function.`)}c(AD,"assertFunction");function u1(F){return typeof F=="object"&&F!==null||typeof F=="function"}c(u1,"isObject");function N3(F,r){if(!u1(F))throw TypeError(`${r} is not an object.`)}c(N3,"assertObject");function ZD(F,r,n){if(F===void 0)throw TypeError(`Parameter ${r} is required in '${n}'.`)}c(ZD,"assertRequiredArgument");function h0(F,r,n){if(F===void 0)throw TypeError(`${r} is required in '${n}'.`)}c(h0,"assertRequiredField");function r0(F){return Number(F)}c(r0,"convertUnrestrictedDouble");function M3(F){return F===0?0:F}c(M3,"censorNegativeZero");function F1(F){return M3(c7(F))}c(F1,"integerPart");function f0(F,r){let n=Number.MAX_SAFE_INTEGER,t=Number(F);if(t=M3(t),!e8(t))throw TypeError(`${r} is not a finite number`);if(t=F1(t),t<0||t>n)throw TypeError(`${r} is outside the accepted range of 0 to ${n}, inclusive`);return!e8(t)||t===0?0:t}c(f0,"convertUnsignedLongLongWithEnforceRange");function c0(F,r){if(!dD(F))throw TypeError(`${r} is not a ReadableStream.`)}c(c0,"assertReadableStream");function Iu(F){return new iu(F)}c(Iu,"AcquireReadableStreamDefaultReader");function Q3(F,r){F._reader._readRequests.push(r)}c(Q3,"ReadableStreamAddReadRequest");function n0(F,r,n){let t=F._reader._readRequests.shift();n?t._closeSteps():t._chunkSteps(r)}c(n0,"ReadableStreamFulfillReadRequest");function w2(F){return F._reader._readRequests.length}c(w2,"ReadableStreamGetNumReadRequests");function L3(F){let r=F._reader;return!(r===void 0||!gD(r))}c(L3,"ReadableStreamHasDefaultReader");let i1=class{constructor(r){if(ZD(r,1,"ReadableStreamDefaultReader"),c0(r,"First parameter"),pD(r))throw TypeError("This stream has already been locked for exclusive reading by another reader");I3(this,r),this._readRequests=new BD}get closed(){return gD(this)?this._closedPromise:m(m2("closed"))}cancel(r=void 0){return gD(this)?this._ownerReadableStream===void 0?m(A2("cancel")):i0(this,r):m(m2("cancel"))}read(){if(!gD(this))return m(m2("read"));if(this._ownerReadableStream===void 0)return m(A2("read from"));let r,n,t=$((w,_)=>{r=w,n=_});return ku(this,{_chunkSteps:c((w)=>r({value:w,done:!1}),"_chunkSteps"),_closeSteps:c(()=>r({value:void 0,done:!0}),"_closeSteps"),_errorSteps:c((w)=>n(w),"_errorSteps")}),t}releaseLock(){if(!gD(this))throw m2("releaseLock");this._ownerReadableStream!==void 0&&C1(this)}};c(i1,"ReadableStreamDefaultReader");let iu=i1;Object.defineProperties(iu.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),E(iu.prototype.cancel,"cancel"),E(iu.prototype.read,"read"),E(iu.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(iu.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function gD(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_readRequests")?!1:F instanceof iu}c(gD,"IsReadableStreamDefaultReader");function ku(F,r){let n=F._ownerReadableStream;n._disturbed=!0,n._state==="closed"?r._closeSteps():n._state==="errored"?r._errorSteps(n._storedError):n._readableStreamController[G3](r)}c(ku,"ReadableStreamDefaultReaderRead");function C1(F){YD(F);let r=TypeError("Reader was released");X3(F,r)}c(C1,"ReadableStreamDefaultReaderRelease");function X3(F,r){let n=F._readRequests;F._readRequests=new BD,n.forEach((t)=>{t._errorSteps(r)})}c(X3,"ReadableStreamDefaultReaderErrorReadRequests");function m2(F){return TypeError(`ReadableStreamDefaultReader.prototype.${F} can only be used on a ReadableStreamDefaultReader`)}c(m2,"defaultReaderBrandCheckException");let n7=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),E1=class{constructor(r,n){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=r,this._preventCancel=n}next(){let r=c(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?M(this._ongoingPromise,r,r):r(),this._ongoingPromise}return(r){let n=c(()=>this._returnSteps(r),"returnSteps");return this._ongoingPromise?M(this._ongoingPromise,n,n):n()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let r=this._reader,n,t,w=$((_,b)=>{n=_,t=b});return ku(r,{_chunkSteps:c((_)=>{this._ongoingPromise=void 0,v(()=>n({value:_,done:!1}))},"_chunkSteps"),_closeSteps:c(()=>{this._ongoingPromise=void 0,this._isFinished=!0,YD(r),n({value:void 0,done:!0})},"_closeSteps"),_errorSteps:c((_)=>{this._ongoingPromise=void 0,this._isFinished=!0,YD(r),t(_)},"_errorSteps")}),w}_returnSteps(r){if(this._isFinished)return Promise.resolve({value:r,done:!0});this._isFinished=!0;let n=this._reader;if(!this._preventCancel){let t=i0(n,r);return YD(n),M(t,()=>({value:r,done:!0}))}return YD(n),R({value:r,done:!0})}};c(E1,"ReadableStreamAsyncIteratorImpl");let h1=E1,r1={next(){return Y3(this)?this._asyncIteratorImpl.next():m(Z3("next"))},return(F){return Y3(this)?this._asyncIteratorImpl.return(F):m(Z3("return"))}};Object.setPrototypeOf(r1,n7);function f1(F,r){let n=Iu(F),t=new h1(n,r),w=Object.create(r1);return w._asyncIteratorImpl=t,w}c(f1,"AcquireReadableStreamAsyncIterator");function Y3(F){if(!h(F)||!Object.prototype.hasOwnProperty.call(F,"_asyncIteratorImpl"))return!1;try{return F._asyncIteratorImpl instanceof h1}catch{return!1}}c(Y3,"IsReadableStreamAsyncIterator");function Z3(F){return TypeError(`ReadableStreamAsyncIterator.${F} can only be used on a ReadableSteamAsyncIterator`)}c(Z3,"streamAsyncIteratorBrandCheckException");let c1=Number.isNaN||function(F){return F!==F};var z3,V3,H3;function vu(F){return F.slice()}c(vu,"CreateArrayFromList");function W3(F,r,n,t,w){new Uint8Array(F).set(new Uint8Array(n,t,w),r)}c(W3,"CopyDataBlockBytes");let kD=c((F)=>(typeof F.transfer=="function"?kD=c((r)=>r.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?kD=c((r)=>structuredClone(r,{transfer:[r]}),"TransferArrayBuffer"):kD=c((r)=>r,"TransferArrayBuffer"),kD(F)),"TransferArrayBuffer"),Cu=c((F)=>(typeof F.detached=="boolean"?Cu=c((r)=>r.detached,"IsDetachedBuffer"):Cu=c((r)=>r.byteLength===0,"IsDetachedBuffer"),Cu(F)),"IsDetachedBuffer");function K3(F,r,n){if(F.slice)return F.slice(r,n);let t=n-r,w=new ArrayBuffer(t);return W3(w,0,F,r,t),w}c(K3,"ArrayBufferSlice");function _2(F,r){let n=F[r];if(n!=null){if(typeof n!="function")throw TypeError(`${String(r)} is not a function`);return n}}c(_2,"GetMethod");function n1(F){let r={[Symbol.iterator]:()=>F.iterator},n=async function*(){return yield*r}(),t=n.next;return{iterator:n,nextMethod:t,done:!1}}c(n1,"CreateAsyncFromSyncIterator");let P3=(H3=(z3=Symbol.asyncIterator)!==null&&z3!==void 0?z3:(V3=Symbol.for)===null||V3===void 0?void 0:V3.call(Symbol,"Symbol.asyncIterator"))!==null&&H3!==void 0?H3:"@@asyncIterator";function q3(F,r="sync",n){if(n===void 0)if(r==="async"){if(n=_2(F,P3),n===void 0){let _=_2(F,Symbol.iterator),b=q3(F,"sync",_);return n1(b)}}else n=_2(F,Symbol.iterator);if(n===void 0)throw TypeError("The object is not iterable");let t=Q(n,F,[]);if(!h(t))throw TypeError("The iterator method must return an object");let w=t.next;return{iterator:t,nextMethod:w,done:!1}}c(q3,"GetIterator");function B1(F){let r=Q(F.nextMethod,F.iterator,[]);if(!h(r))throw TypeError("The iterator.next() method must return an object");return r}c(B1,"IteratorNext");function s1(F){return!!F.done}c(s1,"IteratorComplete");function t1(F){return F.value}c(t1,"IteratorValue");function $1(F){return!(typeof F!="number"||c1(F)||F<0)}c($1,"IsNonNegativeNumber");function g3(F){let r=K3(F.buffer,F.byteOffset,F.byteOffset+F.byteLength);return new Uint8Array(r)}c(g3,"CloneAsUint8Array");function B0(F){let r=F._queue.shift();return F._queueTotalSize-=r.size,F._queueTotalSize<0&&(F._queueTotalSize=0),r.value}c(B0,"DequeueValue");function s0(F,r,n){if(!$1(n)||n===1/0)throw RangeError("Size must be a finite, non-NaN, non-negative number.");F._queue.push({value:r,size:n}),F._queueTotalSize+=n}c(s0,"EnqueueValueWithSize");function A1(F){return F._queue.peek().value}c(A1,"PeekQueueValue");function vD(F){F._queue=new BD,F._queueTotalSize=0}c(vD,"ResetQueue");function k3(F){return F===DataView}c(k3,"isDataViewConstructor");function w1(F){return k3(F.constructor)}c(w1,"isDataView");function m1(F){return k3(F)?1:F.BYTES_PER_ELEMENT}c(m1,"arrayBufferViewElementSize");let _1=class{constructor(){throw TypeError("Illegal constructor")}get view(){if(!t0(this))throw _0("view");return this._view}respond(r){if(!t0(this))throw _0("respond");if(ZD(r,1,"respond"),r=f0(r,"First parameter"),this._associatedReadableByteStreamController===void 0)throw TypeError("This BYOB request has been invalidated");if(Cu(this._view.buffer))throw TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");l2(this._associatedReadableByteStreamController,r)}respondWithNewView(r){if(!t0(this))throw _0("respondWithNewView");if(ZD(r,1,"respondWithNewView"),!ArrayBuffer.isView(r))throw TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw TypeError("This BYOB request has been invalidated");if(Cu(r.buffer))throw TypeError("The given view's buffer has been detached and so cannot be used as a response");U2(this._associatedReadableByteStreamController,r)}};c(_1,"ReadableStreamBYOBRequest");let yu=_1;Object.defineProperties(yu.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),E(yu.prototype.respond,"respond"),E(yu.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(yu.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});let R1=class{constructor(){throw TypeError("Illegal constructor")}get byobRequest(){if(!Eu(this))throw Ou("byobRequest");return m0(this)}get desiredSize(){if(!Eu(this))throw Ou("desiredSize");return DF(this)}close(){if(!Eu(this))throw Ou("close");if(this._closeRequested)throw TypeError("The stream has already been closed; do not close it again!");let r=this._controlledReadableByteStream._state;if(r!=="readable")throw TypeError(`The stream (in ${r} state) is not in the readable state and cannot be closed`);ju(this)}enqueue(r){if(!Eu(this))throw Ou("enqueue");if(ZD(r,1,"enqueue"),!ArrayBuffer.isView(r))throw TypeError("chunk must be an array buffer view");if(r.byteLength===0)throw TypeError("chunk must have non-zero byteLength");if(r.buffer.byteLength===0)throw TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw TypeError("stream is closed or draining");let n=this._controlledReadableByteStream._state;if(n!=="readable")throw TypeError(`The stream (in ${n} state) is not in the readable state and cannot be enqueued to`);S2(this,r)}error(r=void 0){if(!Eu(this))throw Ou("error");wD(this,r)}[U3](r){v3(this),vD(this);let n=this._cancelAlgorithm(r);return b2(this),n}[G3](r){let n=this._controlledReadableByteStream;if(this._queueTotalSize>0){e3(this,r);return}let t=this._autoAllocateChunkSize;if(t!==void 0){let w;try{w=new ArrayBuffer(t)}catch(b){r._errorSteps(b);return}let _={buffer:w,bufferByteLength:t,byteOffset:0,byteLength:t,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(_)}Q3(n,r),hu(this)}[T3](){if(this._pendingPullIntos.length>0){let r=this._pendingPullIntos.peek();r.readerType="none",this._pendingPullIntos=new BD,this._pendingPullIntos.push(r)}}};c(R1,"ReadableByteStreamController");let jD=R1;Object.defineProperties(jD.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),E(jD.prototype.close,"close"),E(jD.prototype.enqueue,"enqueue"),E(jD.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(jD.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Eu(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_controlledReadableByteStream")?!1:F instanceof jD}c(Eu,"IsReadableByteStreamController");function t0(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_associatedReadableByteStreamController")?!1:F instanceof yu}c(t0,"IsReadableStreamBYOBRequest");function hu(F){if(!G1(F))return;if(F._pulling){F._pullAgain=!0;return}F._pulling=!0;let r=F._pullAlgorithm();S(r,()=>(F._pulling=!1,F._pullAgain&&(F._pullAgain=!1,hu(F)),null),(n)=>(wD(F,n),null))}c(hu,"ReadableByteStreamControllerCallPullIfNeeded");function v3(F){A0(F),F._pendingPullIntos=new BD}c(v3,"ReadableByteStreamControllerClearPendingPullIntos");function $0(F,r){let n=!1;F._state==="closed"&&(n=!0);let t=j3(r);r.readerType==="default"?n0(F,t,n):M1(F,t,n)}c($0,"ReadableByteStreamControllerCommitPullIntoDescriptor");function j3(F){let{bytesFilled:r,elementSize:n}=F;return new F.viewConstructor(F.buffer,F.byteOffset,r/n)}c(j3,"ReadableByteStreamControllerConvertPullIntoDescriptor");function R2(F,r,n,t){F._queue.push({buffer:r,byteOffset:n,byteLength:t}),F._queueTotalSize+=t}c(R2,"ReadableByteStreamControllerEnqueueChunkToQueue");function O3(F,r,n,t){let w;try{w=K3(r,n,n+t)}catch(_){throw wD(F,_),_}R2(F,w,0,t)}c(O3,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function o3(F,r){r.bytesFilled>0&&O3(F,r.buffer,r.byteOffset,r.bytesFilled),Ju(F)}c(o3,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function d3(F,r){let n=Math.min(F._queueTotalSize,r.byteLength-r.bytesFilled),t=r.bytesFilled+n,w=n,_=!1,b=t%r.elementSize,G=t-b;G>=r.minimumFill&&(w=G-r.bytesFilled,_=!0);let T=F._queue;for(;w>0;){let N=T.peek(),Z=Math.min(w,N.byteLength),z=r.byteOffset+r.bytesFilled;W3(r.buffer,z,N.buffer,N.byteOffset,Z),N.byteLength===Z?T.shift():(N.byteOffset+=Z,N.byteLength-=Z),F._queueTotalSize-=Z,p3(F,Z,r),w-=Z}return _}c(d3,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function p3(F,r,n){n.bytesFilled+=r}c(p3,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function a3(F){F._queueTotalSize===0&&F._closeRequested?(b2(F),D2(F._controlledReadableByteStream)):hu(F)}c(a3,"ReadableByteStreamControllerHandleQueueDrain");function A0(F){F._byobRequest!==null&&(F._byobRequest._associatedReadableByteStreamController=void 0,F._byobRequest._view=null,F._byobRequest=null)}c(A0,"ReadableByteStreamControllerInvalidateBYOBRequest");function w0(F){for(;F._pendingPullIntos.length>0;){if(F._queueTotalSize===0)return;let r=F._pendingPullIntos.peek();d3(F,r)&&(Ju(F),$0(F._controlledReadableByteStream,r))}}c(w0,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function b1(F){let r=F._controlledReadableByteStream._reader;for(;r._readRequests.length>0;){if(F._queueTotalSize===0)return;let n=r._readRequests.shift();e3(F,n)}}c(b1,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function S1(F,r,n,t){let w=F._controlledReadableByteStream,_=r.constructor,b=m1(_),{byteOffset:G,byteLength:T}=r,N=n*b,Z;try{Z=kD(r.buffer)}catch(O){t._errorSteps(O);return}let z={buffer:Z,bufferByteLength:Z.byteLength,byteOffset:G,byteLength:T,bytesFilled:0,minimumFill:N,elementSize:b,viewConstructor:_,readerType:"byob"};if(F._pendingPullIntos.length>0){F._pendingPullIntos.push(z),iF(w,t);return}if(w._state==="closed"){let O=new _(z.buffer,z.byteOffset,0);t._closeSteps(O);return}if(F._queueTotalSize>0){if(d3(F,z)){let O=j3(z);a3(F),t._chunkSteps(O);return}if(F._closeRequested){let O=TypeError("Insufficient bytes to fill elements in the given buffer");wD(F,O),t._errorSteps(O);return}}F._pendingPullIntos.push(z),iF(w,t),hu(F)}c(S1,"ReadableByteStreamControllerPullInto");function l1(F,r){r.readerType==="none"&&Ju(F);let n=F._controlledReadableByteStream;if(R0(n))for(;CF(n)>0;){let t=Ju(F);$0(n,t)}}c(l1,"ReadableByteStreamControllerRespondInClosedState");function U1(F,r,n){if(p3(F,r,n),n.readerType==="none"){o3(F,n),w0(F);return}if(n.bytesFilled<n.minimumFill)return;Ju(F);let t=n.bytesFilled%n.elementSize;if(t>0){let w=n.byteOffset+n.bytesFilled;O3(F,n.buffer,w-t,t)}n.bytesFilled-=t,$0(F._controlledReadableByteStream,n),w0(F)}c(U1,"ReadableByteStreamControllerRespondInReadableState");function x3(F,r){let n=F._pendingPullIntos.peek();A0(F),F._controlledReadableByteStream._state==="closed"?l1(F,n):U1(F,r,n),hu(F)}c(x3,"ReadableByteStreamControllerRespondInternal");function Ju(F){return F._pendingPullIntos.shift()}c(Ju,"ReadableByteStreamControllerShiftPendingPullInto");function G1(F){let r=F._controlledReadableByteStream;return r._state!=="readable"||F._closeRequested||!F._started?!1:!!(L3(r)&&w2(r)>0||R0(r)&&CF(r)>0||DF(F)>0)}c(G1,"ReadableByteStreamControllerShouldCallPull");function b2(F){F._pullAlgorithm=void 0,F._cancelAlgorithm=void 0}c(b2,"ReadableByteStreamControllerClearAlgorithms");function ju(F){let r=F._controlledReadableByteStream;if(!(F._closeRequested||r._state!=="readable")){if(F._queueTotalSize>0){F._closeRequested=!0;return}if(F._pendingPullIntos.length>0){let n=F._pendingPullIntos.peek();if(n.bytesFilled%n.elementSize!==0){let t=TypeError("Insufficient bytes to fill elements in the given buffer");throw wD(F,t),t}}b2(F),D2(r)}}c(ju,"ReadableByteStreamControllerClose");function S2(F,r){let n=F._controlledReadableByteStream;if(F._closeRequested||n._state!=="readable")return;let{buffer:t,byteOffset:w,byteLength:_}=r;if(Cu(t))throw TypeError("chunk's buffer is detached and so cannot be enqueued");let b=kD(t);if(F._pendingPullIntos.length>0){let G=F._pendingPullIntos.peek();if(Cu(G.buffer))throw TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");A0(F),G.buffer=kD(G.buffer),G.readerType==="none"&&o3(F,G)}if(L3(n))if(b1(F),w2(n)===0)R2(F,b,w,_);else{F._pendingPullIntos.length>0&&Ju(F);let G=new Uint8Array(b,w,_);n0(n,G,!1)}else R0(n)?(R2(F,b,w,_),w0(F)):R2(F,b,w,_);hu(F)}c(S2,"ReadableByteStreamControllerEnqueue");function wD(F,r){let n=F._controlledReadableByteStream;n._state==="readable"&&(v3(F),vD(F),b2(F),yF(n,r))}c(wD,"ReadableByteStreamControllerError");function e3(F,r){let n=F._queue.shift();F._queueTotalSize-=n.byteLength,a3(F);let t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);r._chunkSteps(t)}c(e3,"ReadableByteStreamControllerFillReadRequestFromQueue");function m0(F){if(F._byobRequest===null&&F._pendingPullIntos.length>0){let r=F._pendingPullIntos.peek(),n=new Uint8Array(r.buffer,r.byteOffset+r.bytesFilled,r.byteLength-r.bytesFilled),t=Object.create(yu.prototype);I1(t,F,n),F._byobRequest=t}return F._byobRequest}c(m0,"ReadableByteStreamControllerGetBYOBRequest");function DF(F){let r=F._controlledReadableByteStream._state;return r==="errored"?null:r==="closed"?0:F._strategyHWM-F._queueTotalSize}c(DF,"ReadableByteStreamControllerGetDesiredSize");function l2(F,r){let n=F._pendingPullIntos.peek();if(F._controlledReadableByteStream._state==="closed"){if(r!==0)throw TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(r===0)throw TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(n.bytesFilled+r>n.byteLength)throw RangeError("bytesWritten out of range")}n.buffer=kD(n.buffer),x3(F,r)}c(l2,"ReadableByteStreamControllerRespond");function U2(F,r){let n=F._pendingPullIntos.peek();if(F._controlledReadableByteStream._state==="closed"){if(r.byteLength!==0)throw TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(r.byteLength===0)throw TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(n.byteOffset+n.bytesFilled!==r.byteOffset)throw RangeError("The region specified by view does not match byobRequest");if(n.bufferByteLength!==r.buffer.byteLength)throw RangeError("The buffer of view has different capacity than byobRequest");if(n.bytesFilled+r.byteLength>n.byteLength)throw RangeError("The region specified by view is larger than byobRequest");let t=r.byteLength;n.buffer=kD(r.buffer),x3(F,t)}c(U2,"ReadableByteStreamControllerRespondWithNewView");function uF(F,r,n,t,w,_,b){r._controlledReadableByteStream=F,r._pullAgain=!1,r._pulling=!1,r._byobRequest=null,r._queue=r._queueTotalSize=void 0,vD(r),r._closeRequested=!1,r._started=!1,r._strategyHWM=_,r._pullAlgorithm=t,r._cancelAlgorithm=w,r._autoAllocateChunkSize=b,r._pendingPullIntos=new BD,F._readableStreamController=r;let G=n();S(R(G),()=>(r._started=!0,hu(r),null),(T)=>(wD(r,T),null))}c(uF,"SetUpReadableByteStreamController");function T1(F,r,n){let t=Object.create(jD.prototype),w,_,b;r.start!==void 0?w=c(()=>r.start(t),"startAlgorithm"):w=c(()=>{},"startAlgorithm"),r.pull!==void 0?_=c(()=>r.pull(t),"pullAlgorithm"):_=c(()=>R(void 0),"pullAlgorithm"),r.cancel!==void 0?b=c((T)=>r.cancel(T),"cancelAlgorithm"):b=c(()=>R(void 0),"cancelAlgorithm");let G=r.autoAllocateChunkSize;if(G===0)throw TypeError("autoAllocateChunkSize must be greater than 0");uF(F,t,w,_,b,n,G)}c(T1,"SetUpReadableByteStreamControllerFromUnderlyingSource");function I1(F,r,n){F._associatedReadableByteStreamController=r,F._view=n}c(I1,"SetUpReadableStreamBYOBRequest");function _0(F){return TypeError(`ReadableStreamBYOBRequest.prototype.${F} can only be used on a ReadableStreamBYOBRequest`)}c(_0,"byobRequestBrandCheckException");function Ou(F){return TypeError(`ReadableByteStreamController.prototype.${F} can only be used on a ReadableByteStreamController`)}c(Ou,"byteStreamControllerBrandCheckException");function y1(F,r){lD(F,r);let n=F?.mode;return{mode:n===void 0?void 0:J1(n,`${r} has member 'mode' that`)}}c(y1,"convertReaderOptions");function J1(F,r){if(F=`${F}`,F!=="byob")throw TypeError(`${r} '${F}' is not a valid enumeration value for ReadableStreamReaderMode`);return F}c(J1,"convertReadableStreamReaderMode");function N1(F,r){var n;lD(F,r);let t=(n=F?.min)!==null&&n!==void 0?n:1;return{min:f0(t,`${r} has member 'min' that`)}}c(N1,"convertByobReadOptions");function FF(F){return new ru(F)}c(FF,"AcquireReadableStreamBYOBReader");function iF(F,r){F._reader._readIntoRequests.push(r)}c(iF,"ReadableStreamAddReadIntoRequest");function M1(F,r,n){let t=F._reader._readIntoRequests.shift();n?t._closeSteps(r):t._chunkSteps(r)}c(M1,"ReadableStreamFulfillReadIntoRequest");function CF(F){return F._reader._readIntoRequests.length}c(CF,"ReadableStreamGetNumReadIntoRequests");function R0(F){let r=F._reader;return!(r===void 0||!fu(r))}c(R0,"ReadableStreamHasBYOBReader");let Q1=class{constructor(r){if(ZD(r,1,"ReadableStreamBYOBReader"),c0(r,"First parameter"),pD(r))throw TypeError("This stream has already been locked for exclusive reading by another reader");if(!Eu(r._readableStreamController))throw TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");I3(this,r),this._readIntoRequests=new BD}get closed(){return fu(this)?this._closedPromise:m(G2("closed"))}cancel(r=void 0){return fu(this)?this._ownerReadableStream===void 0?m(A2("cancel")):i0(this,r):m(G2("cancel"))}read(r,n={}){if(!fu(this))return m(G2("read"));if(!ArrayBuffer.isView(r))return m(TypeError("view must be an array buffer view"));if(r.byteLength===0)return m(TypeError("view must have non-zero byteLength"));if(r.buffer.byteLength===0)return m(TypeError("view's buffer must have non-zero byteLength"));if(Cu(r.buffer))return m(TypeError("view's buffer has been detached"));let t;try{t=N1(n,"options")}catch(T){return m(T)}let w=t.min;if(w===0)return m(TypeError("options.min must be greater than 0"));if(w1(r)){if(w>r.byteLength)return m(RangeError("options.min must be less than or equal to view's byteLength"))}else if(w>r.length)return m(RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return m(A2("read from"));let _,b,G=$((T,N)=>{_=T,b=N});return EF(this,r,w,{_chunkSteps:c((T)=>_({value:T,done:!1}),"_chunkSteps"),_closeSteps:c((T)=>_({value:T,done:!0}),"_closeSteps"),_errorSteps:c((T)=>b(T),"_errorSteps")}),G}releaseLock(){if(!fu(this))throw G2("releaseLock");this._ownerReadableStream!==void 0&&L1(this)}};c(Q1,"ReadableStreamBYOBReader");let ru=Q1;Object.defineProperties(ru.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),E(ru.prototype.cancel,"cancel"),E(ru.prototype.read,"read"),E(ru.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ru.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function fu(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_readIntoRequests")?!1:F instanceof ru}c(fu,"IsReadableStreamBYOBReader");function EF(F,r,n,t){let w=F._ownerReadableStream;w._disturbed=!0,w._state==="errored"?t._errorSteps(w._storedError):S1(w._readableStreamController,r,n,t)}c(EF,"ReadableStreamBYOBReaderRead");function L1(F){YD(F);let r=TypeError("Reader was released");hF(F,r)}c(L1,"ReadableStreamBYOBReaderRelease");function hF(F,r){let n=F._readIntoRequests;F._readIntoRequests=new BD,n.forEach((t)=>{t._errorSteps(r)})}c(hF,"ReadableStreamBYOBReaderErrorReadIntoRequests");function G2(F){return TypeError(`ReadableStreamBYOBReader.prototype.${F} can only be used on a ReadableStreamBYOBReader`)}c(G2,"byobReaderBrandCheckException");function ou(F,r){let{highWaterMark:n}=F;if(n===void 0)return r;if(c1(n)||n<0)throw RangeError("Invalid highWaterMark");return n}c(ou,"ExtractHighWaterMark");function T2(F){let{size:r}=F;return r||(()=>1)}c(T2,"ExtractSizeAlgorithm");function I2(F,r){lD(F,r);let n=F?.highWaterMark,t=F?.size;return{highWaterMark:n===void 0?void 0:r0(n),size:t===void 0?void 0:X1(t,`${r} has member 'size' that`)}}c(I2,"convertQueuingStrategy");function X1(F,r){return AD(F,r),(n)=>r0(F(n))}c(X1,"convertQueuingStrategySize");function Y1(F,r){lD(F,r);let n=F?.abort,t=F?.close,w=F?.start,_=F?.type,b=F?.write;return{abort:n===void 0?void 0:Z1(n,F,`${r} has member 'abort' that`),close:t===void 0?void 0:z1(t,F,`${r} has member 'close' that`),start:w===void 0?void 0:V1(w,F,`${r} has member 'start' that`),write:b===void 0?void 0:H1(b,F,`${r} has member 'write' that`),type:_}}c(Y1,"convertUnderlyingSink");function Z1(F,r,n){return AD(F,n),(t)=>W(F,r,[t])}c(Z1,"convertUnderlyingSinkAbortCallback");function z1(F,r,n){return AD(F,n),()=>W(F,r,[])}c(z1,"convertUnderlyingSinkCloseCallback");function V1(F,r,n){return AD(F,n),(t)=>Q(F,r,[t])}c(V1,"convertUnderlyingSinkStartCallback");function H1(F,r,n){return AD(F,n),(t,w)=>W(F,r,[t,w])}c(H1,"convertUnderlyingSinkWriteCallback");function rF(F,r){if(!Nu(F))throw TypeError(`${r} is not a WritableStream.`)}c(rF,"assertWritableStream");function W1(F){if(typeof F!="object"||F===null)return!1;try{return typeof F.aborted=="boolean"}catch{return!1}}c(W1,"isAbortSignal");let B7=typeof AbortController=="function";function K1(){if(B7)return new AbortController}c(K1,"createAbortController");let P1=class{constructor(r={},n={}){r===void 0?r=null:N3(r,"First parameter");let t=I2(n,"Second parameter"),w=Y1(r,"First parameter");if(cF(this),w.type!==void 0)throw RangeError("Invalid type is specified");let _=T2(t),b=ou(t,1);C6(this,w,b,_)}get locked(){if(!Nu(this))throw Q2("locked");return Mu(this)}abort(r=void 0){return Nu(this)?Mu(this)?m(TypeError("Cannot abort a stream that already has a writer")):y2(this,r):m(Q2("abort"))}close(){return Nu(this)?Mu(this)?m(TypeError("Cannot close a stream that already has a writer")):UD(this)?m(TypeError("Cannot close an already-closing stream")):nF(this):m(Q2("close"))}getWriter(){if(!Nu(this))throw Q2("getWriter");return fF(this)}};c(P1,"WritableStream");let cu=P1;Object.defineProperties(cu.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),E(cu.prototype.abort,"abort"),E(cu.prototype.close,"close"),E(cu.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(cu.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function fF(F){return new OD(F)}c(fF,"AcquireWritableStreamDefaultWriter");function q1(F,r,n,t,w=1,_=()=>1){let b=Object.create(cu.prototype);cF(b);let G=Object.create(du.prototype);return AF(b,G,F,r,n,t,w,_),b}c(q1,"CreateWritableStream");function cF(F){F._state="writable",F._storedError=void 0,F._writer=void 0,F._writableStreamController=void 0,F._writeRequests=new BD,F._inFlightWriteRequest=void 0,F._closeRequest=void 0,F._inFlightCloseRequest=void 0,F._pendingAbortRequest=void 0,F._backpressure=!1}c(cF,"InitializeWritableStream");function Nu(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_writableStreamController")?!1:F instanceof cu}c(Nu,"IsWritableStream");function Mu(F){return F._writer!==void 0}c(Mu,"IsWritableStreamLocked");function y2(F,r){var n;if(F._state==="closed"||F._state==="errored")return R(void 0);F._writableStreamController._abortReason=r,(n=F._writableStreamController._abortController)===null||n===void 0||n.abort(r);let t=F._state;if(t==="closed"||t==="errored")return R(void 0);if(F._pendingAbortRequest!==void 0)return F._pendingAbortRequest._promise;let w=!1;t==="erroring"&&(w=!0,r=void 0);let _=$((b,G)=>{F._pendingAbortRequest={_promise:void 0,_resolve:b,_reject:G,_reason:r,_wasAlreadyErroring:w}});return F._pendingAbortRequest._promise=_,w||S0(F,r),_}c(y2,"WritableStreamAbort");function nF(F){let r=F._state;if(r==="closed"||r==="errored")return m(TypeError(`The stream (in ${r} state) is not in the writable state and cannot be closed`));let n=$((w,_)=>{let b={_resolve:w,_reject:_};F._closeRequest=b}),t=F._writer;return t!==void 0&&F._backpressure&&r==="writable"&&N0(t),E6(F._writableStreamController),n}c(nF,"WritableStreamClose");function g1(F){return $((r,n)=>{let t={_resolve:r,_reject:n};F._writeRequests.push(t)})}c(g1,"WritableStreamAddWriteRequest");function b0(F,r){if(F._state==="writable"){S0(F,r);return}l0(F)}c(b0,"WritableStreamDealWithRejection");function S0(F,r){let n=F._writableStreamController;F._state="erroring",F._storedError=r;let t=F._writer;t!==void 0&&sF(t,r),!o1(F)&&n._started&&l0(F)}c(S0,"WritableStreamStartErroring");function l0(F){F._state="errored",F._writableStreamController[p8]();let r=F._storedError;if(F._writeRequests.forEach((w)=>{w._reject(r)}),F._writeRequests=new BD,F._pendingAbortRequest===void 0){J2(F);return}let n=F._pendingAbortRequest;if(F._pendingAbortRequest=void 0,n._wasAlreadyErroring){n._reject(r),J2(F);return}let t=F._writableStreamController[d8](n._reason);S(t,()=>(n._resolve(),J2(F),null),(w)=>(n._reject(w),J2(F),null))}c(l0,"WritableStreamFinishErroring");function k1(F){F._inFlightWriteRequest._resolve(void 0),F._inFlightWriteRequest=void 0}c(k1,"WritableStreamFinishInFlightWrite");function v1(F,r){F._inFlightWriteRequest._reject(r),F._inFlightWriteRequest=void 0,b0(F,r)}c(v1,"WritableStreamFinishInFlightWriteWithError");function j1(F){F._inFlightCloseRequest._resolve(void 0),F._inFlightCloseRequest=void 0,F._state==="erroring"&&(F._storedError=void 0,F._pendingAbortRequest!==void 0&&(F._pendingAbortRequest._resolve(),F._pendingAbortRequest=void 0)),F._state="closed";let r=F._writer;r!==void 0&&RF(r)}c(j1,"WritableStreamFinishInFlightClose");function O1(F,r){F._inFlightCloseRequest._reject(r),F._inFlightCloseRequest=void 0,F._pendingAbortRequest!==void 0&&(F._pendingAbortRequest._reject(r),F._pendingAbortRequest=void 0),b0(F,r)}c(O1,"WritableStreamFinishInFlightCloseWithError");function UD(F){return!(F._closeRequest===void 0&&F._inFlightCloseRequest===void 0)}c(UD,"WritableStreamCloseQueuedOrInFlight");function o1(F){return!(F._inFlightWriteRequest===void 0&&F._inFlightCloseRequest===void 0)}c(o1,"WritableStreamHasOperationMarkedInFlight");function d1(F){F._inFlightCloseRequest=F._closeRequest,F._closeRequest=void 0}c(d1,"WritableStreamMarkCloseRequestInFlight");function p1(F){F._inFlightWriteRequest=F._writeRequests.shift()}c(p1,"WritableStreamMarkFirstWriteRequestInFlight");function J2(F){F._closeRequest!==void 0&&(F._closeRequest._reject(F._storedError),F._closeRequest=void 0);let r=F._writer;r!==void 0&&y0(r,F._storedError)}c(J2,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function U0(F,r){let n=F._writer;n!==void 0&&r!==F._backpressure&&(r?s6(n):N0(n)),F._backpressure=r}c(U0,"WritableStreamUpdateBackpressure");let a1=class{constructor(r){if(ZD(r,1,"WritableStreamDefaultWriter"),rF(r,"First parameter"),Mu(r))throw TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=r,r._writer=this;let n=r._state;if(n==="writable")!UD(r)&&r._backpressure?X2(this):bF(this),L2(this);else if(n==="erroring")J0(this,r._storedError),L2(this);else if(n==="closed")bF(this),n6(this);else{let t=r._storedError;J0(this,t),_F(this,t)}}get closed(){return nu(this)?this._closedPromise:m(Bu("closed"))}get desiredSize(){if(!nu(this))throw Bu("desiredSize");if(this._ownerWritableStream===void 0)throw au("desiredSize");return u6(this)}get ready(){return nu(this)?this._readyPromise:m(Bu("ready"))}abort(r=void 0){return nu(this)?this._ownerWritableStream===void 0?m(au("abort")):x1(this,r):m(Bu("abort"))}close(){if(!nu(this))return m(Bu("close"));let r=this._ownerWritableStream;return r===void 0?m(au("close")):UD(r)?m(TypeError("Cannot close an already-closing stream")):BF(this)}releaseLock(){if(!nu(this))throw Bu("releaseLock");this._ownerWritableStream!==void 0&&tF(this)}write(r=void 0){return nu(this)?this._ownerWritableStream===void 0?m(au("write to")):$F(this,r):m(Bu("write"))}};c(a1,"WritableStreamDefaultWriter");let OD=a1;Object.defineProperties(OD.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),E(OD.prototype.abort,"abort"),E(OD.prototype.close,"close"),E(OD.prototype.releaseLock,"releaseLock"),E(OD.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(OD.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function nu(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_ownerWritableStream")?!1:F instanceof OD}c(nu,"IsWritableStreamDefaultWriter");function x1(F,r){let n=F._ownerWritableStream;return y2(n,r)}c(x1,"WritableStreamDefaultWriterAbort");function BF(F){let r=F._ownerWritableStream;return nF(r)}c(BF,"WritableStreamDefaultWriterClose");function e1(F){let r=F._ownerWritableStream,n=r._state;return UD(r)||n==="closed"?R(void 0):n==="errored"?m(r._storedError):BF(F)}c(e1,"WritableStreamDefaultWriterCloseWithErrorPropagation");function D6(F,r){F._closedPromiseState==="pending"?y0(F,r):B6(F,r)}c(D6,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function sF(F,r){F._readyPromiseState==="pending"?SF(F,r):t6(F,r)}c(sF,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function u6(F){let r=F._ownerWritableStream,n=r._state;return n==="errored"||n==="erroring"?null:n==="closed"?0:wF(r._writableStreamController)}c(u6,"WritableStreamDefaultWriterGetDesiredSize");function tF(F){let r=F._ownerWritableStream,n=TypeError("Writer was released and can no longer be used to monitor the stream's closedness");sF(F,n),D6(F,n),r._writer=void 0,F._ownerWritableStream=void 0}c(tF,"WritableStreamDefaultWriterRelease");function $F(F,r){let n=F._ownerWritableStream,t=n._writableStreamController,w=h6(t,r);if(n!==F._ownerWritableStream)return m(au("write to"));let _=n._state;if(_==="errored")return m(n._storedError);if(UD(n)||_==="closed")return m(TypeError("The stream is closing or closed and cannot be written to"));if(_==="erroring")return m(n._storedError);let b=g1(n);return r6(t,r,w),b}c($F,"WritableStreamDefaultWriterWrite");let F6={},i6=class{constructor(){throw TypeError("Illegal constructor")}get abortReason(){if(!G0(this))throw I0("abortReason");return this._abortReason}get signal(){if(!G0(this))throw I0("signal");if(this._abortController===void 0)throw TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(r=void 0){if(!G0(this))throw I0("error");this._controlledWritableStream._state==="writable"&&mF(this,r)}[d8](r){let n=this._abortAlgorithm(r);return N2(this),n}[p8](){vD(this)}};c(i6,"WritableStreamDefaultController");let du=i6;Object.defineProperties(du.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(du.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function G0(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_controlledWritableStream")?!1:F instanceof du}c(G0,"IsWritableStreamDefaultController");function AF(F,r,n,t,w,_,b,G){r._controlledWritableStream=F,F._writableStreamController=r,r._queue=void 0,r._queueTotalSize=void 0,vD(r),r._abortReason=void 0,r._abortController=K1(),r._started=!1,r._strategySizeAlgorithm=G,r._strategyHWM=b,r._writeAlgorithm=t,r._closeAlgorithm=w,r._abortAlgorithm=_;let T=T0(r);U0(F,T);let N=n(),Z=R(N);S(Z,()=>(r._started=!0,M2(r),null),(z)=>(r._started=!0,b0(F,z),null))}c(AF,"SetUpWritableStreamDefaultController");function C6(F,r,n,t){let w=Object.create(du.prototype),_,b,G,T;r.start!==void 0?_=c(()=>r.start(w),"startAlgorithm"):_=c(()=>{},"startAlgorithm"),r.write!==void 0?b=c((N)=>r.write(N,w),"writeAlgorithm"):b=c(()=>R(void 0),"writeAlgorithm"),r.close!==void 0?G=c(()=>r.close(),"closeAlgorithm"):G=c(()=>R(void 0),"closeAlgorithm"),r.abort!==void 0?T=c((N)=>r.abort(N),"abortAlgorithm"):T=c(()=>R(void 0),"abortAlgorithm"),AF(F,w,_,b,G,T,n,t)}c(C6,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function N2(F){F._writeAlgorithm=void 0,F._closeAlgorithm=void 0,F._abortAlgorithm=void 0,F._strategySizeAlgorithm=void 0}c(N2,"WritableStreamDefaultControllerClearAlgorithms");function E6(F){s0(F,F6,0),M2(F)}c(E6,"WritableStreamDefaultControllerClose");function h6(F,r){try{return F._strategySizeAlgorithm(r)}catch(n){return pu(F,n),1}}c(h6,"WritableStreamDefaultControllerGetChunkSize");function wF(F){return F._strategyHWM-F._queueTotalSize}c(wF,"WritableStreamDefaultControllerGetDesiredSize");function r6(F,r,n){try{s0(F,r,n)}catch(w){pu(F,w);return}let t=F._controlledWritableStream;if(!UD(t)&&t._state==="writable"){let w=T0(F);U0(t,w)}M2(F)}c(r6,"WritableStreamDefaultControllerWrite");function M2(F){let r=F._controlledWritableStream;if(!F._started||r._inFlightWriteRequest!==void 0)return;if(r._state==="erroring"){l0(r);return}if(F._queue.length===0)return;let n=A1(F);n===F6?f6(F):c6(F,n)}c(M2,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function pu(F,r){F._controlledWritableStream._state==="writable"&&mF(F,r)}c(pu,"WritableStreamDefaultControllerErrorIfNeeded");function f6(F){let r=F._controlledWritableStream;d1(r),B0(F);let n=F._closeAlgorithm();N2(F),S(n,()=>(j1(r),null),(t)=>(O1(r,t),null))}c(f6,"WritableStreamDefaultControllerProcessClose");function c6(F,r){let n=F._controlledWritableStream;p1(n);let t=F._writeAlgorithm(r);S(t,()=>{k1(n);let w=n._state;if(B0(F),!UD(n)&&w==="writable"){let _=T0(F);U0(n,_)}return M2(F),null},(w)=>(n._state==="writable"&&N2(F),v1(n,w),null))}c(c6,"WritableStreamDefaultControllerProcessWrite");function T0(F){return wF(F)<=0}c(T0,"WritableStreamDefaultControllerGetBackpressure");function mF(F,r){let n=F._controlledWritableStream;N2(F),S0(n,r)}c(mF,"WritableStreamDefaultControllerError");function Q2(F){return TypeError(`WritableStream.prototype.${F} can only be used on a WritableStream`)}c(Q2,"streamBrandCheckException$2");function I0(F){return TypeError(`WritableStreamDefaultController.prototype.${F} can only be used on a WritableStreamDefaultController`)}c(I0,"defaultControllerBrandCheckException$2");function Bu(F){return TypeError(`WritableStreamDefaultWriter.prototype.${F} can only be used on a WritableStreamDefaultWriter`)}c(Bu,"defaultWriterBrandCheckException");function au(F){return TypeError("Cannot "+F+" a stream using a released writer")}c(au,"defaultWriterLockException");function L2(F){F._closedPromise=$((r,n)=>{F._closedPromise_resolve=r,F._closedPromise_reject=n,F._closedPromiseState="pending"})}c(L2,"defaultWriterClosedPromiseInitialize");function _F(F,r){L2(F),y0(F,r)}c(_F,"defaultWriterClosedPromiseInitializeAsRejected");function n6(F){L2(F),RF(F)}c(n6,"defaultWriterClosedPromiseInitializeAsResolved");function y0(F,r){F._closedPromise_reject!==void 0&&(L(F._closedPromise),F._closedPromise_reject(r),F._closedPromise_resolve=void 0,F._closedPromise_reject=void 0,F._closedPromiseState="rejected")}c(y0,"defaultWriterClosedPromiseReject");function B6(F,r){_F(F,r)}c(B6,"defaultWriterClosedPromiseResetToRejected");function RF(F){F._closedPromise_resolve!==void 0&&(F._closedPromise_resolve(void 0),F._closedPromise_resolve=void 0,F._closedPromise_reject=void 0,F._closedPromiseState="resolved")}c(RF,"defaultWriterClosedPromiseResolve");function X2(F){F._readyPromise=$((r,n)=>{F._readyPromise_resolve=r,F._readyPromise_reject=n}),F._readyPromiseState="pending"}c(X2,"defaultWriterReadyPromiseInitialize");function J0(F,r){X2(F),SF(F,r)}c(J0,"defaultWriterReadyPromiseInitializeAsRejected");function bF(F){X2(F),N0(F)}c(bF,"defaultWriterReadyPromiseInitializeAsResolved");function SF(F,r){F._readyPromise_reject!==void 0&&(L(F._readyPromise),F._readyPromise_reject(r),F._readyPromise_resolve=void 0,F._readyPromise_reject=void 0,F._readyPromiseState="rejected")}c(SF,"defaultWriterReadyPromiseReject");function s6(F){X2(F)}c(s6,"defaultWriterReadyPromiseReset");function t6(F,r){J0(F,r)}c(t6,"defaultWriterReadyPromiseResetToRejected");function N0(F){F._readyPromise_resolve!==void 0&&(F._readyPromise_resolve(void 0),F._readyPromise_resolve=void 0,F._readyPromise_reject=void 0,F._readyPromiseState="fulfilled")}c(N0,"defaultWriterReadyPromiseResolve");function $6(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof B8<"u")return B8}c($6,"getGlobals");let s7=$6();function A6(F){if(!(typeof F=="function"||typeof F=="object")||F.name!=="DOMException")return!1;try{return new F,!0}catch{return!1}}c(A6,"isDOMExceptionConstructor");function w6(){let F=s7?.DOMException;return A6(F)?F:void 0}c(w6,"getFromGlobal");function m6(){let F=c(function(r,n){this.message=r||"",this.name=n||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return E(F,"DOMException"),F.prototype=Object.create(Error.prototype),Object.defineProperty(F.prototype,"constructor",{value:F,writable:!0,configurable:!0}),F}c(m6,"createPolyfill");let t7=w6()||m6();function lF(F,r,n,t,w,_){let b=Iu(F),G=fF(r);F._disturbed=!0;let T=!1,N=R(void 0);return $((Z,z)=>{let O;if(_!==void 0){if(O=c(()=>{let I=_.reason!==void 0?_.reason:new t7("Aborted","AbortError"),H=[];t||H.push(()=>r._state==="writable"?y2(r,I):R(void 0)),w||H.push(()=>F._state==="readable"?bD(F,I):R(void 0)),fD(()=>Promise.all(H.map((j)=>j())),!0,I)},"abortAlgorithm"),_.aborted){O();return}_.addEventListener("abort",O)}function sD(){return $((I,H)=>{function j(cD){cD?I():l(aD(),j,H)}c(j,"next"),j(!1)})}c(sD,"pipeLoop");function aD(){return T?R(!0):l(G._readyPromise,()=>$((I,H)=>{ku(b,{_chunkSteps:c((j)=>{N=l($F(G,j),void 0,C),I(!1)},"_chunkSteps"),_closeSteps:c(()=>I(!0),"_closeSteps"),_errorSteps:H})}))}if(c(aD,"pipeStep"),SD(F,b._closedPromise,(I)=>(t?tD(!0,I):fD(()=>y2(r,I),!0,I),null)),SD(r,G._closedPromise,(I)=>(w?tD(!0,I):fD(()=>bD(F,I),!0,I),null)),FD(F,b._closedPromise,()=>(n?tD():fD(()=>e1(G)),null)),UD(r)||r._state==="closed"){let I=TypeError("the destination writable stream closed before all data could be piped to it");w?tD(!0,I):fD(()=>bD(F,I),!0,I)}L(sD());function GD(){let I=N;return l(N,()=>I!==N?GD():void 0)}c(GD,"waitForWritesToFinish");function SD(I,H,j){I._state==="errored"?j(I._storedError):J(H,j)}c(SD,"isOrBecomesErrored");function FD(I,H,j){I._state==="closed"?j():y(H,j)}c(FD,"isOrBecomesClosed");function fD(I,H,j){if(T)return;T=!0,r._state==="writable"&&!UD(r)?y(GD(),cD):cD();function cD(){return S(I(),()=>xD(H,j),(Au)=>xD(!0,Au)),null}c(cD,"doTheRest")}c(fD,"shutdownWithAction");function tD(I,H){T||(T=!0,r._state==="writable"&&!UD(r)?y(GD(),()=>xD(I,H)):xD(I,H))}c(tD,"shutdown");function xD(I,H){return tF(G),YD(b),_!==void 0&&_.removeEventListener("abort",O),I?z(H):Z(void 0),null}c(xD,"finalize")})}c(lF,"ReadableStreamPipeTo");let _6=class{constructor(){throw TypeError("Illegal constructor")}get desiredSize(){if(!Y2(this))throw z2("desiredSize");return M0(this)}close(){if(!Y2(this))throw z2("close");if(!Lu(this))throw TypeError("The stream is not in a state that permits close");su(this)}enqueue(r=void 0){if(!Y2(this))throw z2("enqueue");if(!Lu(this))throw TypeError("The stream is not in a state that permits enqueue");return Qu(this,r)}error(r=void 0){if(!Y2(this))throw z2("error");RD(this,r)}[U3](r){vD(this);let n=this._cancelAlgorithm(r);return Z2(this),n}[G3](r){let n=this._controlledReadableStream;if(this._queue.length>0){let t=B0(this);this._closeRequested&&this._queue.length===0?(Z2(this),D2(n)):xu(this),r._chunkSteps(t)}else Q3(n,r),xu(this)}[T3](){}};c(_6,"ReadableStreamDefaultController");let oD=_6;Object.defineProperties(oD.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),E(oD.prototype.close,"close"),E(oD.prototype.enqueue,"enqueue"),E(oD.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(oD.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function Y2(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_controlledReadableStream")?!1:F instanceof oD}c(Y2,"IsReadableStreamDefaultController");function xu(F){if(!UF(F))return;if(F._pulling){F._pullAgain=!0;return}F._pulling=!0;let r=F._pullAlgorithm();S(r,()=>(F._pulling=!1,F._pullAgain&&(F._pullAgain=!1,xu(F)),null),(n)=>(RD(F,n),null))}c(xu,"ReadableStreamDefaultControllerCallPullIfNeeded");function UF(F){let r=F._controlledReadableStream;return!Lu(F)||!F._started?!1:!!(pD(r)&&w2(r)>0||M0(F)>0)}c(UF,"ReadableStreamDefaultControllerShouldCallPull");function Z2(F){F._pullAlgorithm=void 0,F._cancelAlgorithm=void 0,F._strategySizeAlgorithm=void 0}c(Z2,"ReadableStreamDefaultControllerClearAlgorithms");function su(F){if(!Lu(F))return;let r=F._controlledReadableStream;F._closeRequested=!0,F._queue.length===0&&(Z2(F),D2(r))}c(su,"ReadableStreamDefaultControllerClose");function Qu(F,r){if(!Lu(F))return;let n=F._controlledReadableStream;if(pD(n)&&w2(n)>0)n0(n,r,!1);else{let t;try{t=F._strategySizeAlgorithm(r)}catch(w){throw RD(F,w),w}try{s0(F,r,t)}catch(w){throw RD(F,w),w}}xu(F)}c(Qu,"ReadableStreamDefaultControllerEnqueue");function RD(F,r){let n=F._controlledReadableStream;n._state==="readable"&&(vD(F),Z2(F),yF(n,r))}c(RD,"ReadableStreamDefaultControllerError");function M0(F){let r=F._controlledReadableStream._state;return r==="errored"?null:r==="closed"?0:F._strategyHWM-F._queueTotalSize}c(M0,"ReadableStreamDefaultControllerGetDesiredSize");function R6(F){return!UF(F)}c(R6,"ReadableStreamDefaultControllerHasBackpressure");function Lu(F){let r=F._controlledReadableStream._state;return!F._closeRequested&&r==="readable"}c(Lu,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function GF(F,r,n,t,w,_,b){r._controlledReadableStream=F,r._queue=void 0,r._queueTotalSize=void 0,vD(r),r._started=!1,r._closeRequested=!1,r._pullAgain=!1,r._pulling=!1,r._strategySizeAlgorithm=b,r._strategyHWM=_,r._pullAlgorithm=t,r._cancelAlgorithm=w,F._readableStreamController=r;let G=n();S(R(G),()=>(r._started=!0,xu(r),null),(T)=>(RD(r,T),null))}c(GF,"SetUpReadableStreamDefaultController");function b6(F,r,n,t){let w=Object.create(oD.prototype),_,b,G;r.start!==void 0?_=c(()=>r.start(w),"startAlgorithm"):_=c(()=>{},"startAlgorithm"),r.pull!==void 0?b=c(()=>r.pull(w),"pullAlgorithm"):b=c(()=>R(void 0),"pullAlgorithm"),r.cancel!==void 0?G=c((T)=>r.cancel(T),"cancelAlgorithm"):G=c(()=>R(void 0),"cancelAlgorithm"),GF(F,w,_,b,G,n,t)}c(b6,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function z2(F){return TypeError(`ReadableStreamDefaultController.prototype.${F} can only be used on a ReadableStreamDefaultController`)}c(z2,"defaultControllerBrandCheckException$1");function S6(F,r){return Eu(F._readableStreamController)?U6(F):l6(F)}c(S6,"ReadableStreamTee");function l6(F,r){let n=Iu(F),t=!1,w=!1,_=!1,b=!1,G,T,N,Z,z,O=$((FD)=>{z=FD});function sD(){return t?(w=!0,R(void 0)):(t=!0,ku(n,{_chunkSteps:c((FD)=>{v(()=>{w=!1;let fD=FD,tD=FD;_||Qu(N._readableStreamController,fD),b||Qu(Z._readableStreamController,tD),t=!1,w&&sD()})},"_chunkSteps"),_closeSteps:c(()=>{t=!1,_||su(N._readableStreamController),b||su(Z._readableStreamController),(!_||!b)&&z(void 0)},"_closeSteps"),_errorSteps:c(()=>{t=!1},"_errorSteps")}),R(void 0))}c(sD,"pullAlgorithm");function aD(FD){if(_=!0,G=FD,b){let fD=vu([G,T]),tD=bD(F,fD);z(tD)}return O}c(aD,"cancel1Algorithm");function GD(FD){if(b=!0,T=FD,_){let fD=vu([G,T]),tD=bD(F,fD);z(tD)}return O}c(GD,"cancel2Algorithm");function SD(){}return c(SD,"startAlgorithm"),N=eu(SD,sD,aD),Z=eu(SD,sD,GD),J(n._closedPromise,(FD)=>(RD(N._readableStreamController,FD),RD(Z._readableStreamController,FD),(!_||!b)&&z(void 0),null)),[N,Z]}c(l6,"ReadableStreamDefaultTee");function U6(F){let r=Iu(F),n=!1,t=!1,w=!1,_=!1,b=!1,G,T,N,Z,z,O=$((I)=>{z=I});function sD(I){J(I._closedPromise,(H)=>(I!==r||(wD(N._readableStreamController,H),wD(Z._readableStreamController,H),(!_||!b)&&z(void 0)),null))}c(sD,"forwardReaderError");function aD(){fu(r)&&(YD(r),r=Iu(F),sD(r)),ku(r,{_chunkSteps:c((I)=>{v(()=>{t=!1,w=!1;let H=I,j=I;if(!_&&!b)try{j=g3(I)}catch(cD){wD(N._readableStreamController,cD),wD(Z._readableStreamController,cD),z(bD(F,cD));return}_||S2(N._readableStreamController,H),b||S2(Z._readableStreamController,j),n=!1,t?SD():w&&FD()})},"_chunkSteps"),_closeSteps:c(()=>{n=!1,_||ju(N._readableStreamController),b||ju(Z._readableStreamController),N._readableStreamController._pendingPullIntos.length>0&&l2(N._readableStreamController,0),Z._readableStreamController._pendingPullIntos.length>0&&l2(Z._readableStreamController,0),(!_||!b)&&z(void 0)},"_closeSteps"),_errorSteps:c(()=>{n=!1},"_errorSteps")})}c(aD,"pullWithDefaultReader");function GD(I,H){gD(r)&&(YD(r),r=FF(F),sD(r));let j=H?Z:N,cD=H?N:Z;EF(r,I,1,{_chunkSteps:c((Au)=>{v(()=>{t=!1,w=!1;let u2=H?b:_;if(H?_:b)u2||U2(j._readableStreamController,Au);else{let F2;try{F2=g3(Au)}catch(HF){wD(j._readableStreamController,HF),wD(cD._readableStreamController,HF),z(bD(F,HF));return}u2||U2(j._readableStreamController,Au),S2(cD._readableStreamController,F2)}n=!1,t?SD():w&&FD()})},"_chunkSteps"),_closeSteps:c((Au)=>{n=!1;let u2=H?b:_,F2=H?_:b;u2||ju(j._readableStreamController),F2||ju(cD._readableStreamController),Au!==void 0&&(u2||U2(j._readableStreamController,Au),!F2&&cD._readableStreamController._pendingPullIntos.length>0&&l2(cD._readableStreamController,0)),(!u2||!F2)&&z(void 0)},"_closeSteps"),_errorSteps:c(()=>{n=!1},"_errorSteps")})}c(GD,"pullWithBYOBReader");function SD(){if(n)return t=!0,R(void 0);n=!0;let I=m0(N._readableStreamController);return I===null?aD():GD(I._view,!1),R(void 0)}c(SD,"pull1Algorithm");function FD(){if(n)return w=!0,R(void 0);n=!0;let I=m0(Z._readableStreamController);return I===null?aD():GD(I._view,!0),R(void 0)}c(FD,"pull2Algorithm");function fD(I){if(_=!0,G=I,b){let H=vu([G,T]),j=bD(F,H);z(j)}return O}c(fD,"cancel1Algorithm");function tD(I){if(b=!0,T=I,_){let H=vu([G,T]),j=bD(F,H);z(j)}return O}c(tD,"cancel2Algorithm");function xD(){}return c(xD,"startAlgorithm"),N=IF(xD,SD,fD),Z=IF(xD,FD,tD),sD(r),[N,Z]}c(U6,"ReadableByteStreamTee");function G6(F){return h(F)&&typeof F.getReader<"u"}c(G6,"isReadableStreamLike");function T6(F){return G6(F)?y6(F.getReader()):I6(F)}c(T6,"ReadableStreamFrom");function I6(F){let r,n=q3(F,"async"),t=C;function w(){let b;try{b=B1(n)}catch(T){return m(T)}let G=R(b);return M(G,(T)=>{if(!h(T))throw TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(s1(T))su(r._readableStreamController);else{let N=t1(T);Qu(r._readableStreamController,N)}})}c(w,"pullAlgorithm");function _(b){let G=n.iterator,T;try{T=_2(G,"return")}catch(z){return m(z)}if(T===void 0)return R(void 0);let N;try{N=Q(T,G,[b])}catch(z){return m(z)}let Z=R(N);return M(Z,(z)=>{if(!h(z))throw TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return c(_,"cancelAlgorithm"),r=eu(t,w,_,0),r}c(I6,"ReadableStreamFromIterable");function y6(F){let r,n=C;function t(){let _;try{_=F.read()}catch(b){return m(b)}return M(_,(b)=>{if(!h(b))throw TypeError("The promise returned by the reader.read() method must fulfill with an object");if(b.done)su(r._readableStreamController);else{let G=b.value;Qu(r._readableStreamController,G)}})}c(t,"pullAlgorithm");function w(_){try{return R(F.cancel(_))}catch(b){return m(b)}}return c(w,"cancelAlgorithm"),r=eu(n,t,w,0),r}c(y6,"ReadableStreamFromDefaultReader");function J6(F,r){lD(F,r);let n=F,t=n?.autoAllocateChunkSize,w=n?.cancel,_=n?.pull,b=n?.start,G=n?.type;return{autoAllocateChunkSize:t===void 0?void 0:f0(t,`${r} has member 'autoAllocateChunkSize' that`),cancel:w===void 0?void 0:N6(w,n,`${r} has member 'cancel' that`),pull:_===void 0?void 0:M6(_,n,`${r} has member 'pull' that`),start:b===void 0?void 0:Q6(b,n,`${r} has member 'start' that`),type:G===void 0?void 0:L6(G,`${r} has member 'type' that`)}}c(J6,"convertUnderlyingDefaultOrByteSource");function N6(F,r,n){return AD(F,n),(t)=>W(F,r,[t])}c(N6,"convertUnderlyingSourceCancelCallback");function M6(F,r,n){return AD(F,n),(t)=>W(F,r,[t])}c(M6,"convertUnderlyingSourcePullCallback");function Q6(F,r,n){return AD(F,n),(t)=>Q(F,r,[t])}c(Q6,"convertUnderlyingSourceStartCallback");function L6(F,r){if(F=`${F}`,F!=="bytes")throw TypeError(`${r} '${F}' is not a valid enumeration value for ReadableStreamType`);return F}c(L6,"convertReadableStreamType");function X6(F,r){return lD(F,r),{preventCancel:!!F?.preventCancel}}c(X6,"convertIteratorOptions");function TF(F,r){lD(F,r);let n=F?.preventAbort,t=F?.preventCancel,w=F?.preventClose,_=F?.signal;return _!==void 0&&Y6(_,`${r} has member 'signal' that`),{preventAbort:!!n,preventCancel:!!t,preventClose:!!w,signal:_}}c(TF,"convertPipeOptions");function Y6(F,r){if(!W1(F))throw TypeError(`${r} is not an AbortSignal.`)}c(Y6,"assertAbortSignal");function Z6(F,r){lD(F,r);let n=F?.readable;h0(n,"readable","ReadableWritablePair"),c0(n,`${r} has member 'readable' that`);let t=F?.writable;return h0(t,"writable","ReadableWritablePair"),rF(t,`${r} has member 'writable' that`),{readable:n,writable:t}}c(Z6,"convertReadableWritablePair");let z6=class{constructor(r={},n={}){r===void 0?r=null:N3(r,"First parameter");let t=I2(n,"Second parameter"),w=J6(r,"First parameter");if(Q0(this),w.type==="bytes"){if(t.size!==void 0)throw RangeError("The strategy for a byte stream cannot have a size function");let _=ou(t,0);T1(this,w,_)}else{let _=T2(t),b=ou(t,1);b6(this,w,b,_)}}get locked(){if(!dD(this))throw tu("locked");return pD(this)}cancel(r=void 0){return dD(this)?pD(this)?m(TypeError("Cannot cancel a stream that already has a reader")):bD(this,r):m(tu("cancel"))}getReader(r=void 0){if(!dD(this))throw tu("getReader");return y1(r,"First parameter").mode===void 0?Iu(this):FF(this)}pipeThrough(r,n={}){if(!dD(this))throw tu("pipeThrough");ZD(r,1,"pipeThrough");let t=Z6(r,"First parameter"),w=TF(n,"Second parameter");if(pD(this))throw TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Mu(t.writable))throw TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let _=lF(this,t.writable,w.preventClose,w.preventAbort,w.preventCancel,w.signal);return L(_),t.readable}pipeTo(r,n={}){if(!dD(this))return m(tu("pipeTo"));if(r===void 0)return m("Parameter 1 is required in 'pipeTo'.");if(!Nu(r))return m(TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let t;try{t=TF(n,"Second parameter")}catch(w){return m(w)}return pD(this)?m(TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Mu(r)?m(TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):lF(this,r,t.preventClose,t.preventAbort,t.preventCancel,t.signal)}tee(){if(!dD(this))throw tu("tee");let r=S6(this);return vu(r)}values(r=void 0){if(!dD(this))throw tu("values");let n=X6(r,"First parameter");return f1(this,n.preventCancel)}[P3](r){return this.values(r)}static from(r){return T6(r)}};c(z6,"ReadableStream");let hD=z6;Object.defineProperties(hD,{from:{enumerable:!0}}),Object.defineProperties(hD.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),E(hD.from,"from"),E(hD.prototype.cancel,"cancel"),E(hD.prototype.getReader,"getReader"),E(hD.prototype.pipeThrough,"pipeThrough"),E(hD.prototype.pipeTo,"pipeTo"),E(hD.prototype.tee,"tee"),E(hD.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(hD.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(hD.prototype,P3,{value:hD.prototype.values,writable:!0,configurable:!0});function eu(F,r,n,t=1,w=()=>1){let _=Object.create(hD.prototype);Q0(_);let b=Object.create(oD.prototype);return GF(_,b,F,r,n,t,w),_}c(eu,"CreateReadableStream");function IF(F,r,n){let t=Object.create(hD.prototype);Q0(t);let w=Object.create(jD.prototype);return uF(t,w,F,r,n,0,void 0),t}c(IF,"CreateReadableByteStream");function Q0(F){F._state="readable",F._reader=void 0,F._storedError=void 0,F._disturbed=!1}c(Q0,"InitializeReadableStream");function dD(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_readableStreamController")?!1:F instanceof hD}c(dD,"IsReadableStream");function pD(F){return F._reader!==void 0}c(pD,"IsReadableStreamLocked");function bD(F,r){if(F._disturbed=!0,F._state==="closed")return R(void 0);if(F._state==="errored")return m(F._storedError);D2(F);let n=F._reader;if(n!==void 0&&fu(n)){let w=n._readIntoRequests;n._readIntoRequests=new BD,w.forEach((_)=>{_._closeSteps(void 0)})}let t=F._readableStreamController[U3](r);return M(t,C)}c(bD,"ReadableStreamCancel");function D2(F){F._state="closed";let r=F._reader;if(r!==void 0&&(J3(r),gD(r))){let n=r._readRequests;r._readRequests=new BD,n.forEach((t)=>{t._closeSteps()})}}c(D2,"ReadableStreamClose");function yF(F,r){F._state="errored",F._storedError=r;let n=F._reader;n!==void 0&&(E0(n,r),gD(n)?X3(n,r):hF(n,r))}c(yF,"ReadableStreamError");function tu(F){return TypeError(`ReadableStream.prototype.${F} can only be used on a ReadableStream`)}c(tu,"streamBrandCheckException$1");function JF(F,r){lD(F,r);let n=F?.highWaterMark;return h0(n,"highWaterMark","QueuingStrategyInit"),{highWaterMark:r0(n)}}c(JF,"convertQueuingStrategyInit");let V6=c((F)=>F.byteLength,"byteLengthSizeFunction");E(V6,"size");let H6=class{constructor(r){ZD(r,1,"ByteLengthQueuingStrategy"),r=JF(r,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!MF(this))throw NF("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!MF(this))throw NF("size");return V6}};c(H6,"ByteLengthQueuingStrategy");let L0=H6;Object.defineProperties(L0.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(L0.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function NF(F){return TypeError(`ByteLengthQueuingStrategy.prototype.${F} can only be used on a ByteLengthQueuingStrategy`)}c(NF,"byteLengthBrandCheckException");function MF(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_byteLengthQueuingStrategyHighWaterMark")?!1:F instanceof L0}c(MF,"IsByteLengthQueuingStrategy");let W6=c(()=>1,"countSizeFunction");E(W6,"size");let K6=class{constructor(r){ZD(r,1,"CountQueuingStrategy"),r=JF(r,"First parameter"),this._countQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!LF(this))throw QF("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!LF(this))throw QF("size");return W6}};c(K6,"CountQueuingStrategy");let X0=K6;Object.defineProperties(X0.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(X0.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function QF(F){return TypeError(`CountQueuingStrategy.prototype.${F} can only be used on a CountQueuingStrategy`)}c(QF,"countBrandCheckException");function LF(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_countQueuingStrategyHighWaterMark")?!1:F instanceof X0}c(LF,"IsCountQueuingStrategy");function P6(F,r){lD(F,r);let n=F?.cancel,t=F?.flush,w=F?.readableType,_=F?.start,b=F?.transform,G=F?.writableType;return{cancel:n===void 0?void 0:v6(n,F,`${r} has member 'cancel' that`),flush:t===void 0?void 0:q6(t,F,`${r} has member 'flush' that`),readableType:w,start:_===void 0?void 0:g6(_,F,`${r} has member 'start' that`),transform:b===void 0?void 0:k6(b,F,`${r} has member 'transform' that`),writableType:G}}c(P6,"convertTransformer");function q6(F,r,n){return AD(F,n),(t)=>W(F,r,[t])}c(q6,"convertTransformerFlushCallback");function g6(F,r,n){return AD(F,n),(t)=>Q(F,r,[t])}c(g6,"convertTransformerStartCallback");function k6(F,r,n){return AD(F,n),(t,w)=>W(F,r,[t,w])}c(k6,"convertTransformerTransformCallback");function v6(F,r,n){return AD(F,n),(t)=>W(F,r,[t])}c(v6,"convertTransformerCancelCallback");let j6=class{constructor(r={},n={},t={}){r===void 0&&(r=null);let w=I2(n,"Second parameter"),_=I2(t,"Third parameter"),b=P6(r,"First parameter");if(b.readableType!==void 0)throw RangeError("Invalid readableType specified");if(b.writableType!==void 0)throw RangeError("Invalid writableType specified");let G=ou(_,0),T=T2(_),N=ou(w,1),Z=T2(w),z,O=$((sD)=>{z=sD});O6(this,O,N,Z,G,T),p6(this,b),b.start!==void 0?z(b.start(this._transformStreamController)):z(void 0)}get readable(){if(!XF(this))throw VF("readable");return this._readable}get writable(){if(!XF(this))throw VF("writable");return this._writable}};c(j6,"TransformStream");let Y0=j6;Object.defineProperties(Y0.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Y0.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function O6(F,r,n,t,w,_){function b(){return r}c(b,"startAlgorithm");function G(O){return e6(F,O)}c(G,"writeAlgorithm");function T(O){return Di(F,O)}c(T,"abortAlgorithm");function N(){return ui(F)}c(N,"closeAlgorithm"),F._writable=q1(b,G,N,T,n,t);function Z(){return Fi(F)}c(Z,"pullAlgorithm");function z(O){return ii(F,O)}c(z,"cancelAlgorithm"),F._readable=eu(b,Z,z,w,_),F._backpressure=void 0,F._backpressureChangePromise=void 0,F._backpressureChangePromise_resolve=void 0,V2(F,!0),F._transformStreamController=void 0}c(O6,"InitializeTransformStream");function XF(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_transformStreamController")?!1:F instanceof Y0}c(XF,"IsTransformStream");function YF(F,r){RD(F._readable._readableStreamController,r),Z0(F,r)}c(YF,"TransformStreamError");function Z0(F,r){W2(F._transformStreamController),pu(F._writable._writableStreamController,r),z0(F)}c(Z0,"TransformStreamErrorWritableAndUnblockWrite");function z0(F){F._backpressure&&V2(F,!1)}c(z0,"TransformStreamUnblockWrite");function V2(F,r){F._backpressureChangePromise!==void 0&&F._backpressureChangePromise_resolve(),F._backpressureChangePromise=$((n)=>{F._backpressureChangePromise_resolve=n}),F._backpressure=r}c(V2,"TransformStreamSetBackpressure");let o6=class{constructor(){throw TypeError("Illegal constructor")}get desiredSize(){if(!H2(this))throw K2("desiredSize");let r=this._controlledTransformStream._readable._readableStreamController;return M0(r)}enqueue(r=void 0){if(!H2(this))throw K2("enqueue");ZF(this,r)}error(r=void 0){if(!H2(this))throw K2("error");a6(this,r)}terminate(){if(!H2(this))throw K2("terminate");x6(this)}};c(o6,"TransformStreamDefaultController");let $u=o6;Object.defineProperties($u.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),E($u.prototype.enqueue,"enqueue"),E($u.prototype.error,"error"),E($u.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($u.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function H2(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_controlledTransformStream")?!1:F instanceof $u}c(H2,"IsTransformStreamDefaultController");function d6(F,r,n,t,w){r._controlledTransformStream=F,F._transformStreamController=r,r._transformAlgorithm=n,r._flushAlgorithm=t,r._cancelAlgorithm=w,r._finishPromise=void 0,r._finishPromise_resolve=void 0,r._finishPromise_reject=void 0}c(d6,"SetUpTransformStreamDefaultController");function p6(F,r){let n=Object.create($u.prototype),t,w,_;r.transform!==void 0?t=c((b)=>r.transform(b,n),"transformAlgorithm"):t=c((b)=>{try{return ZF(n,b),R(void 0)}catch(G){return m(G)}},"transformAlgorithm"),r.flush!==void 0?w=c(()=>r.flush(n),"flushAlgorithm"):w=c(()=>R(void 0),"flushAlgorithm"),r.cancel!==void 0?_=c((b)=>r.cancel(b),"cancelAlgorithm"):_=c(()=>R(void 0),"cancelAlgorithm"),d6(F,n,t,w,_)}c(p6,"SetUpTransformStreamDefaultControllerFromTransformer");function W2(F){F._transformAlgorithm=void 0,F._flushAlgorithm=void 0,F._cancelAlgorithm=void 0}c(W2,"TransformStreamDefaultControllerClearAlgorithms");function ZF(F,r){let n=F._controlledTransformStream,t=n._readable._readableStreamController;if(!Lu(t))throw TypeError("Readable side is not in a state that permits enqueue");try{Qu(t,r)}catch(w){throw Z0(n,w),n._readable._storedError}R6(t)!==n._backpressure&&V2(n,!0)}c(ZF,"TransformStreamDefaultControllerEnqueue");function a6(F,r){YF(F._controlledTransformStream,r)}c(a6,"TransformStreamDefaultControllerError");function zF(F,r){let n=F._transformAlgorithm(r);return M(n,void 0,(t)=>{throw YF(F._controlledTransformStream,t),t})}c(zF,"TransformStreamDefaultControllerPerformTransform");function x6(F){let r=F._controlledTransformStream,n=r._readable._readableStreamController;su(n);let t=TypeError("TransformStream terminated");Z0(r,t)}c(x6,"TransformStreamDefaultControllerTerminate");function e6(F,r){let n=F._transformStreamController;if(F._backpressure){let t=F._backpressureChangePromise;return M(t,()=>{let w=F._writable;if(w._state==="erroring")throw w._storedError;return zF(n,r)})}return zF(n,r)}c(e6,"TransformStreamDefaultSinkWriteAlgorithm");function Di(F,r){let n=F._transformStreamController;if(n._finishPromise!==void 0)return n._finishPromise;let t=F._readable;n._finishPromise=$((_,b)=>{n._finishPromise_resolve=_,n._finishPromise_reject=b});let w=n._cancelAlgorithm(r);return W2(n),S(w,()=>(t._state==="errored"?Xu(n,t._storedError):(RD(t._readableStreamController,r),V0(n)),null),(_)=>(RD(t._readableStreamController,_),Xu(n,_),null)),n._finishPromise}c(Di,"TransformStreamDefaultSinkAbortAlgorithm");function ui(F){let r=F._transformStreamController;if(r._finishPromise!==void 0)return r._finishPromise;let n=F._readable;r._finishPromise=$((w,_)=>{r._finishPromise_resolve=w,r._finishPromise_reject=_});let t=r._flushAlgorithm();return W2(r),S(t,()=>(n._state==="errored"?Xu(r,n._storedError):(su(n._readableStreamController),V0(r)),null),(w)=>(RD(n._readableStreamController,w),Xu(r,w),null)),r._finishPromise}c(ui,"TransformStreamDefaultSinkCloseAlgorithm");function Fi(F){return V2(F,!1),F._backpressureChangePromise}c(Fi,"TransformStreamDefaultSourcePullAlgorithm");function ii(F,r){let n=F._transformStreamController;if(n._finishPromise!==void 0)return n._finishPromise;let t=F._writable;n._finishPromise=$((_,b)=>{n._finishPromise_resolve=_,n._finishPromise_reject=b});let w=n._cancelAlgorithm(r);return W2(n),S(w,()=>(t._state==="errored"?Xu(n,t._storedError):(pu(t._writableStreamController,r),z0(F),V0(n)),null),(_)=>(pu(t._writableStreamController,_),z0(F),Xu(n,_),null)),n._finishPromise}c(ii,"TransformStreamDefaultSourceCancelAlgorithm");function K2(F){return TypeError(`TransformStreamDefaultController.prototype.${F} can only be used on a TransformStreamDefaultController`)}c(K2,"defaultControllerBrandCheckException");function V0(F){F._finishPromise_resolve!==void 0&&(F._finishPromise_resolve(),F._finishPromise_resolve=void 0,F._finishPromise_reject=void 0)}c(V0,"defaultControllerFinishPromiseResolve");function Xu(F,r){F._finishPromise_reject!==void 0&&(L(F._finishPromise),F._finishPromise_reject(r),F._finishPromise_resolve=void 0,F._finishPromise_reject=void 0)}c(Xu,"defaultControllerFinishPromiseReject");function VF(F){return TypeError(`TransformStream.prototype.${F} can only be used on a TransformStream`)}c(VF,"streamBrandCheckException"),i.ByteLengthQueuingStrategy=L0,i.CountQueuingStrategy=X0,i.ReadableByteStreamController=jD,i.ReadableStream=hD,i.ReadableStreamBYOBReader=ru,i.ReadableStreamBYOBRequest=yu,i.ReadableStreamDefaultController=oD,i.ReadableStreamDefaultReader=iu,i.TransformStream=Y0,i.TransformStreamDefaultController=$u,i.WritableStream=cu,i.WritableStreamDefaultController=du,i.WritableStreamDefaultWriter=OD})}(i3,i3.exports)),i3.exports}function RC(){if(_C)return wC;_C=1;let D=65536;if(!globalThis.ReadableStream)try{let u=VD("node:process"),{emitWarning:i}=u;try{u.emitWarning=()=>{},Object.assign(globalThis,VD("node:stream/web")),u.emitWarning=i}catch(C){throw u.emitWarning=i,C}}catch{Object.assign(globalThis,MC())}try{let{Blob:u}=VD("buffer");u&&!u.prototype.stream&&(u.prototype.stream=c(function(i){let C=0,h=this;return new ReadableStream({type:"bytes",async pull(f){let E=await h.slice(C,Math.min(h.size,C+D)).arrayBuffer();C+=E.byteLength,f.enqueue(new Uint8Array(E)),C===h.size&&f.close()}})},"name"))}catch{}return wC}async function*C3(D,u=!0){for(let i of D)if("stream"in i)yield*i.stream();else if(ArrayBuffer.isView(i))if(u){let C=i.byteOffset,h=i.byteOffset+i.byteLength;for(;C!==h;){let f=Math.min(h-C,bC),E=i.buffer.slice(C,C+f);C+=E.byteLength,yield new Uint8Array(E)}}else yield i;else{let C=0,h=i;for(;C!==h.size;){let f=await h.slice(C,Math.min(h.size,C+bC)).arrayBuffer();C+=f.byteLength,yield new Uint8Array(f)}}}function LC(D,u=Pu){var i=`${SC()}${SC()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),C=[],h=`--${i}\r
|
|
73
|
+
Content-Disposition: form-data; name="`;return D.forEach((f,E)=>typeof f=="string"?C.push(h+m8(E)+`"\r
|
|
74
|
+
\r
|
|
75
|
+
${f.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
76
|
+
`)}\r
|
|
77
|
+
`):C.push(h+m8(E)+`"; filename="${m8(f.name,1)}"\r
|
|
78
|
+
Content-Type: ${f.type||"application/octet-stream"}\r
|
|
79
|
+
\r
|
|
80
|
+
`,f,`\r
|
|
81
|
+
`)),C.push(`--${i}--`),new u(C,{type:"multipart/form-data; boundary="+i})}async function E3(D){if(D[$D].disturbed)throw TypeError(`body used already for: ${D.url}`);if(D[$D].disturbed=!0,D[$D].error)throw D[$D].error;let{body:u}=D;if(u===null)return rD.alloc(0);if(!(u instanceof qD))return rD.alloc(0);let i=[],C=0;try{for await(let h of u){if(D.size>0&&C+h.length>D.size){let f=new QD(`content size at ${D.url} over limit: ${D.size}`,"max-size");throw u.destroy(f),f}C+=h.length,i.push(h)}}catch(h){throw h instanceof w3?h:new QD(`Invalid response body while trying to fetch ${D.url}: ${h.message}`,"system",h)}if(u.readableEnded===!0||u._readableState.ended===!0)try{return i.every((h)=>typeof h=="string")?rD.from(i.join("")):rD.concat(i,C)}catch(h){throw new QD(`Could not create Buffer from response body for ${D.url}: ${h.message}`,"system",h)}else throw new QD(`Premature close of server response while trying to fetch ${D.url}`)}function WC(D=[]){return new uu(D.reduce((u,i,C,h)=>(C%2===0&&u.push(h.slice(C,C+2)),u),[]).filter(([u,i])=>{try{return h3(u),R8(u,String(i)),!0}catch{return!1}}))}function b8(D,u=!1){return D==null||(D=new URL(D),/^(about|blob|data):$/.test(D.protocol))?"no-referrer":(D.username="",D.password="",D.hash="",u&&(D.pathname="",D.search=""),D)}function qC(D){if(!PC.has(D))throw TypeError(`Invalid referrerPolicy: ${D}`);return D}function gC(D){if(/^(http|ws)s:$/.test(D.protocol))return!0;let u=D.host.replace(/(^\[)|(]$)/g,""),i=bh(u);return i===4&&/^127\./.test(u)||i===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(u)?!0:D.host==="localhost"||D.host.endsWith(".localhost")?!1:D.protocol==="file:"}function Wu(D){return/^about:(blank|srcdoc)$/.test(D)||D.protocol==="data:"||/^(blob|filesystem):$/.test(D.protocol)?!0:gC(D)}function kC(D,{referrerURLCallback:u,referrerOriginCallback:i}={}){if(D.referrer==="no-referrer"||D.referrerPolicy==="")return null;let C=D.referrerPolicy;if(D.referrer==="about:client")return"no-referrer";let h=D.referrer,f=b8(h),E=b8(h,!0);f.toString().length>4096&&(f=E),u&&(f=u(f)),i&&(E=i(E));let B=new URL(D.url);switch(C){case"no-referrer":return"no-referrer";case"origin":return E;case"unsafe-url":return f;case"strict-origin":return Wu(f)&&!Wu(B)?"no-referrer":E.toString();case"strict-origin-when-cross-origin":return f.origin===B.origin?f:Wu(f)&&!Wu(B)?"no-referrer":E;case"same-origin":return f.origin===B.origin?f:"no-referrer";case"origin-when-cross-origin":return f.origin===B.origin?f:E;case"no-referrer-when-downgrade":return Wu(f)&&!Wu(B)?"no-referrer":f;default:throw TypeError(`Invalid referrerPolicy: ${C}`)}}function vC(D){let u=(D.get("referrer-policy")||"").split(/[,\s]+/),i="";for(let C of u)C&&PC.has(C)&&(i=C);return i}function dC(){if(UC)return _8;if(UC=1,!globalThis.DOMException)try{let{MessageChannel:D}=VD("worker_threads"),u=new D().port1,i=new ArrayBuffer;u.postMessage(i,[i,i])}catch(D){D.constructor.name==="DOMException"&&(globalThis.DOMException=D.constructor)}return _8=globalThis.DOMException,_8}async function M8(D,u){return new Promise((i,C)=>{let h=new x2(D,u),{parsedURL:f,options:E}=Kh(h);if(!Oh.has(f.protocol))throw TypeError(`node-fetch cannot load ${D}. URL scheme "${f.protocol.replace(/:$/,"")}" is not supported.`);if(f.protocol==="data:"){let S=NC(h.url),y=new KD(S,{headers:{"Content-Type":S.typeFull}});i(y);return}let B=(f.protocol==="https:"?mh:a2).request,{signal:s}=h,A=null,$=c(()=>{let S=new oC("The operation was aborted.");C(S),h.body&&h.body instanceof qD.Readable&&h.body.destroy(S),!(!A||!A.body)&&A.body.emit("error",S)},"abort");if(s&&s.aborted){$();return}let R=c(()=>{$(),l()},"abortAndFinalize"),m=B(f.toString(),E);s&&s.addEventListener("abort",R);let l=c(()=>{m.abort(),s&&s.removeEventListener("abort",R)},"finalize");m.on("error",(S)=>{C(new QD(`request to ${h.url} failed, reason: ${S.message}`,"system",S)),l()}),DE(m,(S)=>{A&&A.body&&A.body.destroy(S)}),process.version<"v14"&&m.on("socket",(S)=>{let y;S.prependListener("end",()=>{y=S._eventsCount}),S.prependListener("close",(J)=>{if(A&&y<S._eventsCount&&!J){let M=Error("Premature close");M.code="ERR_STREAM_PREMATURE_CLOSE",A.body.emit("error",M)}})}),m.on("response",(S)=>{m.setTimeout(0);let y=WC(S.rawHeaders);if(J8(S.statusCode)){let Q=y.get("Location"),W=null;try{W=Q===null?null:new URL(Q,h.url)}catch{if(h.redirect!=="manual"){C(new QD(`uri requested responds with an invalid redirect URL: ${Q}`,"invalid-redirect")),l();return}}switch(h.redirect){case"error":C(new QD(`uri requested responds with a redirect, redirect mode is set to error: ${h.url}`,"no-redirect")),l();return;case"manual":break;case"follow":{if(W===null)break;if(h.counter>=h.follow){C(new QD(`maximum redirect reached at: ${h.url}`,"max-redirect")),l();return}let a={headers:new uu(h.headers),follow:h.follow,counter:h.counter+1,agent:h.agent,compress:h.compress,method:h.method,body:y8(h),signal:h.signal,size:h.size,referrer:h.referrer,referrerPolicy:h.referrerPolicy};if(!Mh(h.url,W)||!Qh(h.url,W))for(let BD of["authorization","www-authenticate","cookie","cookie2"])a.headers.delete(BD);if(S.statusCode!==303&&h.body&&u.body instanceof qD.Readable){C(new QD("Cannot follow redirect with body being a readable stream","unsupported-redirect")),l();return}(S.statusCode===303||(S.statusCode===301||S.statusCode===302)&&h.method==="POST")&&(a.method="GET",a.body=void 0,a.headers.delete("content-length"));let Fu=vC(y);Fu&&(a.referrerPolicy=Fu),i(M8(new x2(W,a))),l();return}default:return C(TypeError(`Redirect option '${h.redirect}' is not a valid value of RequestRedirect`))}}s&&S.once("end",()=>{s.removeEventListener("abort",R)});let J=r2(S,new f3,(Q)=>{Q&&C(Q)});process.version<"v12.10"&&S.on("aborted",R);let M={url:h.url,status:S.statusCode,statusText:S.statusMessage,headers:y,size:h.size,counter:h.counter,highWaterMark:h.highWaterMark},L=y.get("Content-Encoding");if(!h.compress||h.method==="HEAD"||L===null||S.statusCode===204||S.statusCode===304){A=new KD(J,M),i(A);return}let v={flush:h2.Z_SYNC_FLUSH,finishFlush:h2.Z_SYNC_FLUSH};if(L==="gzip"||L==="x-gzip"){J=r2(J,h2.createGunzip(v),(Q)=>{Q&&C(Q)}),A=new KD(J,M),i(A);return}if(L==="deflate"||L==="x-deflate"){let Q=r2(S,new f3,(W)=>{W&&C(W)});Q.once("data",(W)=>{(W[0]&15)===8?J=r2(J,h2.createInflate(),(a)=>{a&&C(a)}):J=r2(J,h2.createInflateRaw(),(a)=>{a&&C(a)}),A=new KD(J,M),i(A)}),Q.once("end",()=>{A||(A=new KD(J,M),i(A))});return}if(L==="br"){J=r2(J,h2.createBrotliDecompress(),(Q)=>{Q&&C(Q)}),A=new KD(J,M),i(A);return}A=new KD(J,M),i(A)}),Zh(m,h).catch(C)})}function DE(D,u){let i=rD.from(`0\r
|
|
82
|
+
\r
|
|
83
|
+
`),C=!1,h=!1,f;D.on("response",(E)=>{let{headers:B}=E;C=B["transfer-encoding"]==="chunked"&&!B["content-length"]}),D.on("socket",(E)=>{let B=c(()=>{if(C&&!h){let A=Error("Premature close");A.code="ERR_STREAM_PREMATURE_CLOSE",u(A)}},"onSocketClose"),s=c((A)=>{h=rD.compare(A.slice(-5),i)===0,!h&&f&&(h=rD.compare(f.slice(-3),i.slice(0,3))===0&&rD.compare(A.slice(-2),i.slice(3))===0),f=A},"onData");E.prependListener("close",B),E.on("data",s),D.on("close",()=>{E.removeListener("close",B),E.removeListener("data",s)})})}function p(D){let u=uE.get(D);return console.assert(u!=null,"'this' is expected an Event object, but got",D),u}function l8(D){if(D.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",D.passiveListener);return}D.event.cancelable&&(D.canceled=!0,typeof D.event.preventDefault=="function"&&D.event.preventDefault())}function Ku(D,u){uE.set(this,{eventTarget:D,event:u,eventPhase:2,currentTarget:D,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:u.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let i=Object.keys(u);for(let C=0;C<i.length;++C){let h=i[C];h in this||Object.defineProperty(this,h,Q8(h))}}function Q8(D){return{get(){return p(this).event[D]},set(u){p(this).event[D]=u},configurable:!0,enumerable:!0}}function FE(D){return{value(){let u=p(this).event;return u[D].apply(u,arguments)},configurable:!0,enumerable:!0}}function iE(D,u){let i=Object.keys(u);if(i.length===0)return D;function C(h,f){D.call(this,h,f)}c(C,"CustomEvent"),C.prototype=Object.create(D.prototype,{constructor:{value:C,configurable:!0,writable:!0}});for(let h=0;h<i.length;++h){let f=i[h];if(!(f in D.prototype)){let E=typeof Object.getOwnPropertyDescriptor(u,f).value=="function";Object.defineProperty(C.prototype,f,E?FE(f):Q8(f))}}return C}function L8(D){if(D==null||D===Object.prototype)return Ku;let u=S8.get(D);return u==null&&(u=iE(L8(Object.getPrototypeOf(D)),D),S8.set(D,u)),u}function CE(D,u){return new(L8(Object.getPrototypeOf(u)))(D,u)}function EE(D){return p(D).immediateStopped}function hE(D,u){p(D).eventPhase=u}function rE(D,u){p(D).currentTarget=u}function U8(D,u){p(D).passiveListener=u}function p2(D){return D!==null&&typeof D=="object"}function n2(D){let u=fE.get(D);if(u==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return u}function cE(D){return{get(){let u=n2(this).get(D);for(;u!=null;){if(u.listenerType===r3)return u.listener;u=u.next}return null},set(u){typeof u!="function"&&!p2(u)&&(u=null);let i=n2(this),C=null,h=i.get(D);for(;h!=null;)h.listenerType===r3?C!==null?C.next=h.next:h.next!==null?i.set(D,h.next):i.delete(D):C=h,h=h.next;if(u!==null){let f={listener:u,listenerType:r3,passive:!1,once:!1,next:null};C===null?i.set(D,f):C.next=f}},configurable:!0,enumerable:!0}}function X8(D,u){Object.defineProperty(D,`on${u}`,cE(u))}function G8(D){function u(){PD.call(this)}c(u,"CustomEventTarget"),u.prototype=Object.create(PD.prototype,{constructor:{value:u,configurable:!0,writable:!0}});for(let i=0;i<D.length;++i)X8(u.prototype,D[i]);return u}function PD(){if(this instanceof PD){fE.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return G8(arguments[0]);if(arguments.length>0){let D=Array(arguments.length);for(let u=0;u<arguments.length;++u)D[u]=arguments[u];return G8(D)}throw TypeError("Cannot call a class as a function")}function BE(){let D=Object.create(t3.prototype);return PD.call(D),$3.set(D,!1),D}function sE(D){$3.get(D)===!1&&($3.set(D,!0),D.dispatchEvent({type:"abort"}))}function T8(D){let u=tE.get(D);if(u==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${D===null?"null":typeof D}`);return u}function I8(){!globalThis.process?.versions?.node&&!globalThis.process?.env?.DISABLE_NODE_FETCH_NATIVE_WARN&&console.warn("[node-fetch-native] Node.js compatible build of `node-fetch-native` is being used in a non-Node.js environment. Please make sure you are using proper export conditions or report this issue to https://github.com/unjs/node-fetch-native. You can set `process.env.DISABLE_NODE_FETCH_NATIVE_WARN` to disable this warning.")}var wh,IC=(D)=>{throw TypeError(D)},c=(D,u)=>wh(D,"name",{value:u,configurable:!0}),yC=(D,u,i)=>u.has(D)||IC("Cannot "+i),e=(D,u,i)=>(yC(D,u,"read from private field"),i?i.call(D):u.get(D)),Du=(D,u,i)=>u.has(D)?IC("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(D):u.set(D,i),MD=(D,u,i,C)=>(yC(D,u,"write to private field"),C?C.call(D,i):u.set(D,i),i),bu,D3,E2,t8,j2,u3,F3,$8,JD,A8,f2,c2,w8,wC,i3,Gh,mC,_C,bC=65536,QC,Pu,Th,C2,o2,Ih,yh,SC,Jh,lC,m8,Hu,Vu,XC,w3,YC,QD,B3,ZC,s3,Nh,Mh,Qh,Lh,$D,zC=class{constructor(u,{size:i=0}={}){let C=null;u===null?u=null:ZC(u)?u=rD.from(u.toString()):s3(u)||rD.isBuffer(u)||(c3.isAnyArrayBuffer(u)?u=rD.from(u):ArrayBuffer.isView(u)?u=rD.from(u.buffer,u.byteOffset,u.byteLength):u instanceof qD||(u instanceof Vu?(u=LC(u),C=u.type.split("=")[1]):u=rD.from(String(u))));let h=u;rD.isBuffer(u)?h=qD.Readable.from(u):s3(u)&&(h=qD.Readable.from(u.stream())),this[$D]={body:u,stream:h,boundary:C,disturbed:!1,error:null},this.size=i,u instanceof qD&&u.on("error",(f)=>{let E=f instanceof w3?f:new QD(`Invalid response body while trying to fetch ${this.url}: ${f.message}`,"system",f);this[$D].error=E})}get body(){return this[$D].stream}get bodyUsed(){return this[$D].disturbed}async arrayBuffer(){let{buffer:u,byteOffset:i,byteLength:C}=await E3(this);return u.slice(i,i+C)}async formData(){let u=this.headers.get("content-type");if(u.startsWith("application/x-www-form-urlencoded")){let C=new Vu,h=new URLSearchParams(await this.text());for(let[f,E]of h)C.append(f,E);return C}let{toFormData:i}=await Promise.resolve().then(() => (AC(),$C));return i(this.body,u)}async blob(){let u=this.headers&&this.headers.get("content-type")||this[$D].body&&this[$D].body.type||"",i=await this.arrayBuffer();return new Pu([i],{type:u})}async json(){let u=await this.text();return JSON.parse(u)}async text(){let u=await E3(this);return new TextDecoder().decode(u)}buffer(){return E3(this)}},d2,y8,Xh,VC,Yh,Zh,h3,R8,HC,uu,zh,J8,ND,KC,KD,Vh,PC,Hh="strict-origin-when-cross-origin",CD,O2,Wh,jC,x2,Kh,OC,oC,_8,UC,Ph,qh,N8,gh,kh,vh,jh,pC,aC,xC,eC,Oh,uE,S8,fE,GC=1,TC=2,r3=3,nE,t3,$3,A3,tE,oh,dh,$E;var e0=zD(()=>{p0();wh=Object.defineProperty;c(NC,"dataUriToBuffer");wC={},i3={exports:{}},Gh=i3.exports;c(MC,"requirePonyfill_es2018");c(RC,"requireStreams"),RC();/*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */c(C3,"toIterator");QC=(j2=class{constructor(D=[],u={}){if(Du(this,bu,[]),Du(this,D3,""),Du(this,E2,0),Du(this,t8,"transparent"),typeof D!="object"||D===null)throw TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof D[Symbol.iterator]!="function")throw TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof u!="object"&&typeof u!="function")throw TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");u===null&&(u={});let i=new TextEncoder;for(let h of D){let f;ArrayBuffer.isView(h)?f=new Uint8Array(h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength)):h instanceof ArrayBuffer?f=new Uint8Array(h.slice(0)):h instanceof j2?f=h:f=i.encode(`${h}`),MD(this,E2,e(this,E2)+(ArrayBuffer.isView(f)?f.byteLength:f.size)),e(this,bu).push(f)}MD(this,t8,`${u.endings===void 0?"transparent":u.endings}`);let C=u.type===void 0?"":String(u.type);MD(this,D3,/^[\x20-\x7E]*$/.test(C)?C:"")}get size(){return e(this,E2)}get type(){return e(this,D3)}async text(){let D=new TextDecoder,u="";for await(let i of C3(e(this,bu),!1))u+=D.decode(i,{stream:!0});return u+=D.decode(),u}async arrayBuffer(){let D=new Uint8Array(this.size),u=0;for await(let i of C3(e(this,bu),!1))D.set(i,u),u+=i.length;return D.buffer}stream(){let D=C3(e(this,bu),!0);return new globalThis.ReadableStream({type:"bytes",async pull(u){let i=await D.next();i.done?u.close():u.enqueue(i.value)},async cancel(){await D.return()}})}slice(D=0,u=this.size,i=""){let{size:C}=this,h=D<0?Math.max(C+D,0):Math.min(D,C),f=u<0?Math.max(C+u,0):Math.min(u,C),E=Math.max(f-h,0),B=e(this,bu),s=[],A=0;for(let R of B){if(A>=E)break;let m=ArrayBuffer.isView(R)?R.byteLength:R.size;if(h&&m<=h)h-=m,f-=m;else{let l;ArrayBuffer.isView(R)?(l=R.subarray(h,Math.min(m,f)),A+=l.byteLength):(l=R.slice(h,Math.min(m,f)),A+=l.size),f-=m,s.push(l),h=0}}let $=new j2([],{type:String(i).toLowerCase()});return MD($,E2,E),MD($,bu,s),$}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](D){return D&&typeof D=="object"&&typeof D.constructor=="function"&&(typeof D.stream=="function"||typeof D.arrayBuffer=="function")&&/^(Blob|File)$/.test(D[Symbol.toStringTag])}},bu=new WeakMap,D3=new WeakMap,E2=new WeakMap,t8=new WeakMap,c(j2,"Blob"),j2);Object.defineProperties(QC.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Pu=QC,Th=($8=class extends Pu{constructor(D,u,i={}){if(arguments.length<2)throw TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(D,i);Du(this,u3,0),Du(this,F3,""),i===null&&(i={});let C=i.lastModified===void 0?Date.now():Number(i.lastModified);Number.isNaN(C)||MD(this,u3,C),MD(this,F3,String(u))}get name(){return e(this,F3)}get lastModified(){return e(this,u3)}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](D){return!!D&&D instanceof Pu&&/^(File)$/.test(D[Symbol.toStringTag])}},u3=new WeakMap,F3=new WeakMap,c($8,"File"),$8),C2=Th;/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */({toStringTag:o2,iterator:Ih,hasInstance:yh}=Symbol),SC=Math.random,Jh="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),lC=c((D,u,i)=>(D+="",/^(Blob|File)$/.test(u&&u[o2])?[(i=i!==void 0?i+"":u[o2]=="File"?u.name:"blob",D),u.name!==i||u[o2]=="blob"?new C2([u],i,u):u]:[D,u+""]),"f"),m8=c((D,u)=>(u?D:D.replace(/\r?\n|\r/g,`\r
|
|
84
|
+
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e$1"),Hu=c((D,u,i)=>{if(u.length<i)throw TypeError(`Failed to execute '${D}' on 'FormData': ${i} arguments required, but only ${u.length} present.`)},"x"),Vu=(A8=class{constructor(...D){if(Du(this,JD,[]),D.length)throw TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[o2](){return"FormData"}[Ih](){return this.entries()}static[yh](D){return D&&typeof D=="object"&&D[o2]==="FormData"&&!Jh.some((u)=>typeof D[u]!="function")}append(...D){Hu("append",arguments,2),e(this,JD).push(lC(...D))}delete(D){Hu("delete",arguments,1),D+="",MD(this,JD,e(this,JD).filter(([u])=>u!==D))}get(D){Hu("get",arguments,1),D+="";for(var u=e(this,JD),i=u.length,C=0;C<i;C++)if(u[C][0]===D)return u[C][1];return null}getAll(D,u){return Hu("getAll",arguments,1),u=[],D+="",e(this,JD).forEach((i)=>i[0]===D&&u.push(i[1])),u}has(D){return Hu("has",arguments,1),D+="",e(this,JD).some((u)=>u[0]===D)}forEach(D,u){Hu("forEach",arguments,1);for(var[i,C]of this)D.call(u,C,i,this)}set(...D){Hu("set",arguments,2);var u=[],i=!0;D=lC(...D),e(this,JD).forEach((C)=>{C[0]===D[0]?i&&(i=!u.push(D)):u.push(C)}),i&&u.push(D),MD(this,JD,u)}*entries(){yield*e(this,JD)}*keys(){for(var[D]of this)yield D}*values(){for(var[,D]of this)yield D}},JD=new WeakMap,c(A8,"FormData"),A8);c(LC,"formDataToBlob");XC=class extends Error{constructor(u,i){super(u),Error.captureStackTrace(this,this.constructor),this.type=i}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};c(XC,"FetchBaseError");w3=XC,YC=class extends w3{constructor(u,i,C){super(u,i),C&&(this.code=this.errno=C.code,this.erroredSysCall=C.syscall)}};c(YC,"FetchError");QD=YC,B3=Symbol.toStringTag,ZC=c((D)=>typeof D=="object"&&typeof D.append=="function"&&typeof D.delete=="function"&&typeof D.get=="function"&&typeof D.getAll=="function"&&typeof D.has=="function"&&typeof D.set=="function"&&typeof D.sort=="function"&&D[B3]==="URLSearchParams","isURLSearchParameters"),s3=c((D)=>D&&typeof D=="object"&&typeof D.arrayBuffer=="function"&&typeof D.type=="string"&&typeof D.stream=="function"&&typeof D.constructor=="function"&&/^(Blob|File)$/.test(D[B3]),"isBlob"),Nh=c((D)=>typeof D=="object"&&(D[B3]==="AbortSignal"||D[B3]==="EventTarget"),"isAbortSignal"),Mh=c((D,u)=>{let i=new URL(u).hostname,C=new URL(D).hostname;return i===C||i.endsWith(`.${C}`)},"isDomainOrSubdomain"),Qh=c((D,u)=>{let i=new URL(u).protocol,C=new URL(D).protocol;return i===C},"isSameProtocol"),Lh=_h(qD.pipeline),$D=Symbol("Body internals");c(zC,"Body");d2=zC;d2.prototype.buffer=n3(d2.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer"),Object.defineProperties(d2.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:n3(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});c(E3,"consumeBody");y8=c((D,u)=>{let i,C,{body:h}=D[$D];if(D.bodyUsed)throw Error("cannot clone body after it is used");return h instanceof qD&&typeof h.getBoundary!="function"&&(i=new f3({highWaterMark:u}),C=new f3({highWaterMark:u}),h.pipe(i),h.pipe(C),D[$D].stream=i,h=C),h},"clone"),Xh=n3((D)=>D.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),VC=c((D,u)=>D===null?null:typeof D=="string"?"text/plain;charset=UTF-8":ZC(D)?"application/x-www-form-urlencoded;charset=UTF-8":s3(D)?D.type||null:rD.isBuffer(D)||c3.isAnyArrayBuffer(D)||ArrayBuffer.isView(D)?null:D instanceof Vu?`multipart/form-data; boundary=${u[$D].boundary}`:D&&typeof D.getBoundary=="function"?`multipart/form-data;boundary=${Xh(D)}`:D instanceof qD?null:"text/plain;charset=UTF-8","extractContentType"),Yh=c((D)=>{let{body:u}=D[$D];return u===null?0:s3(u)?u.size:rD.isBuffer(u)?u.length:u&&typeof u.getLengthSync=="function"&&u.hasKnownLength&&u.hasKnownLength()?u.getLengthSync():null},"getTotalBytes"),Zh=c(async(D,{body:u})=>{u===null?D.end():await Lh(u,D)},"writeToStream"),h3=typeof a2.validateHeaderName=="function"?a2.validateHeaderName:(D)=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(D)){let u=TypeError(`Header name must be a valid HTTP token [${D}]`);throw Object.defineProperty(u,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),u}},R8=typeof a2.validateHeaderValue=="function"?a2.validateHeaderValue:(D,u)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(u)){let i=TypeError(`Invalid character in header content ["${D}"]`);throw Object.defineProperty(i,"code",{value:"ERR_INVALID_CHAR"}),i}},HC=class D extends URLSearchParams{constructor(u){let i=[];if(u instanceof D){let C=u.raw();for(let[h,f]of Object.entries(C))i.push(...f.map((E)=>[h,E]))}else if(u!=null)if(typeof u=="object"&&!c3.isBoxedPrimitive(u)){let C=u[Symbol.iterator];if(C==null)i.push(...Object.entries(u));else{if(typeof C!="function")throw TypeError("Header pairs must be iterable");i=[...u].map((h)=>{if(typeof h!="object"||c3.isBoxedPrimitive(h))throw TypeError("Each header pair must be an iterable object");return[...h]}).map((h)=>{if(h.length!==2)throw TypeError("Each header pair must be a name/value tuple");return[...h]})}}else throw TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return i=i.length>0?i.map(([C,h])=>(h3(C),R8(C,String(h)),[String(C).toLowerCase(),String(h)])):void 0,super(i),new Proxy(this,{get(C,h,f){switch(h){case"append":case"set":return(E,B)=>(h3(E),R8(E,String(B)),URLSearchParams.prototype[h].call(C,String(E).toLowerCase(),String(B)));case"delete":case"has":case"getAll":return(E)=>(h3(E),URLSearchParams.prototype[h].call(C,String(E).toLowerCase()));case"keys":return()=>(C.sort(),new Set(URLSearchParams.prototype.keys.call(C)).keys());default:return Reflect.get(C,h,f)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(u){let i=this.getAll(u);if(i.length===0)return null;let C=i.join(", ");return/^content-encoding$/i.test(u)&&(C=C.toLowerCase()),C}forEach(u,i=void 0){for(let C of this.keys())Reflect.apply(u,i,[this.get(C),C,this])}*values(){for(let u of this.keys())yield this.get(u)}*entries(){for(let u of this.keys())yield[u,this.get(u)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((u,i)=>(u[i]=this.getAll(i),u),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((u,i)=>{let C=this.getAll(i);return i==="host"?u[i]=C[0]:u[i]=C.length>1?C:C[0],u},{})}};c(HC,"Headers");uu=HC;Object.defineProperties(uu.prototype,["get","entries","forEach","values"].reduce((D,u)=>(D[u]={enumerable:!0},D),{}));c(WC,"fromRawHeaders");zh=new Set([301,302,303,307,308]),J8=c((D)=>zh.has(D),"isRedirect"),ND=Symbol("Response internals"),KC=class D extends d2{constructor(u=null,i={}){super(u,i);let C=i.status!=null?i.status:200,h=new uu(i.headers);if(u!==null&&!h.has("Content-Type")){let f=VC(u,this);f&&h.append("Content-Type",f)}this[ND]={type:"default",url:i.url,status:C,statusText:i.statusText||"",headers:h,counter:i.counter,highWaterMark:i.highWaterMark}}get type(){return this[ND].type}get url(){return this[ND].url||""}get status(){return this[ND].status}get ok(){return this[ND].status>=200&&this[ND].status<300}get redirected(){return this[ND].counter>0}get statusText(){return this[ND].statusText}get headers(){return this[ND].headers}get highWaterMark(){return this[ND].highWaterMark}clone(){return new D(y8(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(u,i=302){if(!J8(i))throw RangeError('Failed to execute "redirect" on "response": Invalid status code');return new D(null,{headers:{location:new URL(u).toString()},status:i})}static error(){let u=new D(null,{status:0,statusText:""});return u[ND].type="error",u}static json(u=void 0,i={}){let C=JSON.stringify(u);if(C===void 0)throw TypeError("data is not JSON serializable");let h=new uu(i&&i.headers);return h.has("content-type")||h.set("content-type","application/json"),new D(C,{...i,headers:h})}get[Symbol.toStringTag](){return"Response"}};c(KC,"Response");KD=KC;Object.defineProperties(KD.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});Vh=c((D)=>{if(D.search)return D.search;let u=D.href.length-1,i=D.hash||(D.href[u]==="#"?"#":"");return D.href[u-i.length]==="?"?"?":""},"getSearch");c(b8,"stripURLForUseAsAReferrer");PC=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]);c(qC,"validateReferrerPolicy");c(gC,"isOriginPotentiallyTrustworthy");c(Wu,"isUrlPotentiallyTrustworthy");c(kC,"determineRequestsReferrer");c(vC,"parseReferrerPolicyFromHeader");CD=Symbol("Request internals"),O2=c((D)=>typeof D=="object"&&typeof D[CD]=="object","isRequest"),Wh=n3(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),jC=class D extends d2{constructor(u,i={}){let C;if(O2(u)?C=new URL(u.url):(C=new URL(u),u={}),C.username!==""||C.password!=="")throw TypeError(`${C} is an url with embedded credentials.`);let h=i.method||u.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(h)&&(h=h.toUpperCase()),!O2(i)&&"data"in i&&Wh(),(i.body!=null||O2(u)&&u.body!==null)&&(h==="GET"||h==="HEAD"))throw TypeError("Request with GET/HEAD method cannot have body");let f=i.body?i.body:O2(u)&&u.body!==null?y8(u):null;super(f,{size:i.size||u.size||0});let E=new uu(i.headers||u.headers||{});if(f!==null&&!E.has("Content-Type")){let A=VC(f,this);A&&E.set("Content-Type",A)}let B=O2(u)?u.signal:null;if("signal"in i&&(B=i.signal),B!=null&&!Nh(B))throw TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let s=i.referrer==null?u.referrer:i.referrer;if(s==="")s="no-referrer";else if(s){let A=new URL(s);s=/^about:(\/\/)?client$/.test(A)?"client":A}else s=void 0;this[CD]={method:h,redirect:i.redirect||u.redirect||"follow",headers:E,parsedURL:C,signal:B,referrer:s},this.follow=i.follow===void 0?u.follow===void 0?20:u.follow:i.follow,this.compress=i.compress===void 0?u.compress===void 0?!0:u.compress:i.compress,this.counter=i.counter||u.counter||0,this.agent=i.agent||u.agent,this.highWaterMark=i.highWaterMark||u.highWaterMark||16384,this.insecureHTTPParser=i.insecureHTTPParser||u.insecureHTTPParser||!1,this.referrerPolicy=i.referrerPolicy||u.referrerPolicy||""}get method(){return this[CD].method}get url(){return Rh(this[CD].parsedURL)}get headers(){return this[CD].headers}get redirect(){return this[CD].redirect}get signal(){return this[CD].signal}get referrer(){if(this[CD].referrer==="no-referrer")return"";if(this[CD].referrer==="client")return"about:client";if(this[CD].referrer)return this[CD].referrer.toString()}get referrerPolicy(){return this[CD].referrerPolicy}set referrerPolicy(u){this[CD].referrerPolicy=qC(u)}clone(){return new D(this)}get[Symbol.toStringTag](){return"Request"}};c(jC,"Request");x2=jC;Object.defineProperties(x2.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});Kh=c((D)=>{let{parsedURL:u}=D[CD],i=new uu(D[CD].headers);i.has("Accept")||i.set("Accept","*/*");let C=null;if(D.body===null&&/^(post|put)$/i.test(D.method)&&(C="0"),D.body!==null){let B=Yh(D);typeof B=="number"&&!Number.isNaN(B)&&(C=String(B))}C&&i.set("Content-Length",C),D.referrerPolicy===""&&(D.referrerPolicy=Hh),D.referrer&&D.referrer!=="no-referrer"?D[CD].referrer=kC(D):D[CD].referrer="no-referrer",D[CD].referrer instanceof URL&&i.set("Referer",D.referrer),i.has("User-Agent")||i.set("User-Agent","node-fetch"),D.compress&&!i.has("Accept-Encoding")&&i.set("Accept-Encoding","gzip, deflate, br");let{agent:h}=D;typeof h=="function"&&(h=h(u));let f=Vh(u),E={path:u.pathname+f,method:D.method,headers:i[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:D.insecureHTTPParser,agent:h};return{parsedURL:u,options:E}},"getNodeRequestOptions"),OC=class extends w3{constructor(u,i="aborted"){super(u,i)}};c(OC,"AbortError");oC=OC;/*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */c(dC,"requireNodeDomexception");Ph=dC(),qh=s8(Ph),{stat:N8}=Sh,gh=c((D,u)=>pC(JC(D),D,u),"blobFromSync"),kh=c((D,u)=>N8(D).then((i)=>pC(i,D,u)),"blobFrom"),vh=c((D,u)=>N8(D).then((i)=>aC(i,D,u)),"fileFrom"),jh=c((D,u)=>aC(JC(D),D,u),"fileFromSync"),pC=c((D,u,i="")=>new Pu([new eC({path:u,size:D.size,lastModified:D.mtimeMs,start:0})],{type:i}),"fromBlob"),aC=c((D,u,i="")=>new C2([new eC({path:u,size:D.size,lastModified:D.mtimeMs,start:0})],Uh(u),{type:i,lastModified:D.mtimeMs}),"fromFile"),xC=class D{constructor(u){Du(this,f2),Du(this,c2),MD(this,f2,u.path),MD(this,c2,u.start),this.size=u.size,this.lastModified=u.lastModified}slice(u,i){return new D({path:e(this,f2),lastModified:this.lastModified,size:i-u,start:e(this,c2)+u})}async*stream(){let{mtimeMs:u}=await N8(e(this,f2));if(u>this.lastModified)throw new qh("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*lh(e(this,f2),{start:e(this,c2),end:e(this,c2)+this.size-1})}get[Symbol.toStringTag](){return"Blob"}};f2=new WeakMap,c2=new WeakMap,c(xC,"BlobDataItem");eC=xC,Oh=new Set(["data:","http:","https:"]);c(M8,"fetch$1");c(DE,"fixResponseChunkedTransferBadEnding");uE=new WeakMap,S8=new WeakMap;c(p,"pd");c(l8,"setCancelFlag");c(Ku,"Event"),Ku.prototype={get type(){return p(this).event.type},get target(){return p(this).eventTarget},get currentTarget(){return p(this).currentTarget},composedPath(){let D=p(this).currentTarget;return D==null?[]:[D]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return p(this).eventPhase},stopPropagation(){let D=p(this);D.stopped=!0,typeof D.event.stopPropagation=="function"&&D.event.stopPropagation()},stopImmediatePropagation(){let D=p(this);D.stopped=!0,D.immediateStopped=!0,typeof D.event.stopImmediatePropagation=="function"&&D.event.stopImmediatePropagation()},get bubbles(){return!!p(this).event.bubbles},get cancelable(){return!!p(this).event.cancelable},preventDefault(){l8(p(this))},get defaultPrevented(){return p(this).canceled},get composed(){return!!p(this).event.composed},get timeStamp(){return p(this).timeStamp},get srcElement(){return p(this).eventTarget},get cancelBubble(){return p(this).stopped},set cancelBubble(D){if(!D)return;let u=p(this);u.stopped=!0,typeof u.event.cancelBubble=="boolean"&&(u.event.cancelBubble=!0)},get returnValue(){return!p(this).canceled},set returnValue(D){D||l8(p(this))},initEvent(){}},Object.defineProperty(Ku.prototype,"constructor",{value:Ku,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(Ku.prototype,window.Event.prototype),S8.set(window.Event.prototype,Ku));c(Q8,"defineRedirectDescriptor");c(FE,"defineCallDescriptor");c(iE,"defineWrapper");c(L8,"getWrapper");c(CE,"wrapEvent");c(EE,"isStopped");c(hE,"setEventPhase");c(rE,"setCurrentTarget");c(U8,"setPassiveListener");fE=new WeakMap;c(p2,"isObject");c(n2,"getListeners");c(cE,"defineEventAttributeDescriptor");c(X8,"defineEventAttribute");c(G8,"defineCustomEventTarget");c(PD,"EventTarget"),PD.prototype={addEventListener(D,u,i){if(u==null)return;if(typeof u!="function"&&!p2(u))throw TypeError("'listener' should be a function or an object.");let C=n2(this),h=p2(i),f=(h?!!i.capture:!!i)?GC:TC,E={listener:u,listenerType:f,passive:h&&!!i.passive,once:h&&!!i.once,next:null},B=C.get(D);if(B===void 0){C.set(D,E);return}let s=null;for(;B!=null;){if(B.listener===u&&B.listenerType===f)return;s=B,B=B.next}s.next=E},removeEventListener(D,u,i){if(u==null)return;let C=n2(this),h=(p2(i)?!!i.capture:!!i)?GC:TC,f=null,E=C.get(D);for(;E!=null;){if(E.listener===u&&E.listenerType===h){f!==null?f.next=E.next:E.next!==null?C.set(D,E.next):C.delete(D);return}f=E,E=E.next}},dispatchEvent(D){if(D==null||typeof D.type!="string")throw TypeError('"event.type" should be a string.');let u=n2(this),i=D.type,C=u.get(i);if(C==null)return!0;let h=CE(this,D),f=null;for(;C!=null;){if(C.once?f!==null?f.next=C.next:C.next!==null?u.set(i,C.next):u.delete(i):f=C,U8(h,C.passive?C.listener:null),typeof C.listener=="function")try{C.listener.call(this,h)}catch(E){typeof console<"u"&&typeof console.error=="function"&&console.error(E)}else C.listenerType!==r3&&typeof C.listener.handleEvent=="function"&&C.listener.handleEvent(h);if(EE(h))break;C=C.next}return U8(h,null),hE(h,0),rE(h,null),!h.defaultPrevented}},Object.defineProperty(PD.prototype,"constructor",{value:PD,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(PD.prototype,window.EventTarget.prototype);nE=class extends PD{constructor(){throw super(),TypeError("AbortSignal cannot be constructed directly")}get aborted(){let u=$3.get(this);if(typeof u!="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return u}};c(nE,"AbortSignal");t3=nE;X8(t3.prototype,"abort");c(BE,"createAbortSignal");c(sE,"abortSignal");$3=new WeakMap;Object.defineProperties(t3.prototype,{aborted:{enumerable:!0}}),typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(t3.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});A3=(w8=class{constructor(){tE.set(this,BE())}get signal(){return T8(this)}abort(){sE(T8(this))}},c(w8,"AbortController"),w8),tE=new WeakMap;c(T8,"getSignal"),Object.defineProperties(A3.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(A3.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});oh=Object.defineProperty,dh=c((D,u)=>oh(D,"name",{value:u,configurable:!0}),"e"),$E=M8;I8();c(I8,"s"),dh(I8,"checkNodeEnvironment")});var Su,Y8,Nf,Mf,Qf,AE,Lf,Xf,wE;var mE=zD(()=>{e0();e0();p0();Su=!!globalThis.process?.env?.FORCE_NODE_FETCH,Y8=!Su&&globalThis.fetch||$E,Nf=!Su&&globalThis.Blob||Pu,Mf=!Su&&globalThis.File||C2,Qf=!Su&&globalThis.FormData||Vu,AE=!Su&&globalThis.Headers||uu,Lf=!Su&&globalThis.Request||x2,Xf=!Su&&globalThis.Response||KD,wE=!Su&&globalThis.AbortController||A3});function eh(D,u){if(D==="__proto__"||D==="constructor"&&u&&typeof u==="object"&&"prototype"in u){Dr(D);return}return u}function Dr(D){console.warn(`[destr] Dropping "${D}" key to prevent prototype pollution.`)}function _E(D,u={}){if(typeof D!=="string")return D;if(D[0]==='"'&&D[D.length-1]==='"'&&D.indexOf("\\")===-1)return D.slice(1,-1);let i=D.trim();if(i.length<=9)switch(i.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!xh.test(D)){if(u.strict)throw SyntaxError("[destr] Invalid JSON");return D}try{if(ph.test(D)||ah.test(D)){if(u.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(D,eh)}return JSON.parse(D)}catch(C){if(u.strict)throw C;return D}}var ph,ah,xh;var RE=zD(()=>{ph=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,ah=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,xh=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/});function cr(D){return encodeURI(""+D).replace(rr,"|")}function z8(D){return cr(typeof D==="string"?D:JSON.stringify(D)).replace(H8,"%2B").replace(fr,"+").replace(ur,"%23").replace(Fr,"%26").replace(hr,"`").replace(Er,"^").replace(ir,"%2F")}function Z8(D){return z8(D).replace(Cr,"%3D")}function SE(D=""){try{return decodeURIComponent(""+D)}catch{return""+D}}function nr(D){return SE(D.replace(H8," "))}function Br(D){return SE(D.replace(H8," "))}function sr(D=""){let u=Object.create(null);if(D[0]==="?")D=D.slice(1);for(let i of D.split("&")){let C=i.match(/([^=]+)=?(.*)/)||[];if(C.length<2)continue;let h=nr(C[1]);if(h==="__proto__"||h==="constructor")continue;let f=Br(C[2]||"");if(u[h]===void 0)u[h]=f;else if(Array.isArray(u[h]))u[h].push(f);else u[h]=[u[h],f]}return u}function tr(D,u){if(typeof u==="number"||typeof u==="boolean")u=String(u);if(!u)return Z8(D);if(Array.isArray(u))return u.map((i)=>`${Z8(D)}=${z8(i)}`).join("&");return`${Z8(D)}=${z8(u)}`}function $r(D){return Object.keys(D).filter((u)=>D[u]!==void 0).map((u)=>tr(u,D[u])).filter(Boolean).join("&")}function lE(D,u={}){if(typeof u==="boolean")u={acceptRelative:u};if(u.strict)return Ar.test(D);return wr.test(D)||(u.acceptRelative?mr.test(D):!1)}function V8(D="",u){if(!u)return D.endsWith("/");return _r.test(D)}function br(D="",u){if(!u)return(V8(D)?D.slice(0,-1):D)||"/";if(!V8(D,!0))return D||"/";let i=D,C="",h=D.indexOf("#");if(h!==-1)i=D.slice(0,h),C=D.slice(h);let[f,...E]=i.split("?");return((f.endsWith("/")?f.slice(0,-1):f)||"/")+(E.length>0?`?${E.join("?")}`:"")+C}function Sr(D="",u){if(!u)return D.endsWith("/")?D:D+"/";if(V8(D,!0))return D||"/";let i=D,C="",h=D.indexOf("#");if(h!==-1){if(i=D.slice(0,h),C=D.slice(h),!i)return C}let[f,...E]=i.split("?");return f+"/"+(E.length>0?`?${E.join("?")}`:"")+C}function UE(D,u){if(lr(u)||lE(D))return D;let i=br(u);if(D.startsWith(i)){let C=D[i.length];if(!C||C==="/"||C==="?")return D}return Gr(i,D)}function GE(D,u){let i=IE(D),C={...sr(i.search),...u};return i.search=$r(C),Tr(i)}function lr(D){return!D||D==="/"}function Ur(D){return D&&D!=="/"}function Gr(D,...u){let i=D||"";for(let C of u.filter((h)=>Ur(h)))if(i){let h=C.replace(Rr,"");i=Sr(i)+h}else i=C;return i}function IE(D="",u){let i=D.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(i){let[,R,m=""]=i;return{protocol:R.toLowerCase(),pathname:m,href:R+m,auth:"",host:"",search:"",hash:""}}if(!lE(D,{acceptRelative:!0}))return u?IE(u+D):bE(D);let[,C="",h,f=""]=D.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,E="",B=""]=f.match(/([^#/?]*)(.*)?/)||[];if(C==="file:")B=B.replace(/\/(?=[A-Za-z]:)/,"");let{pathname:s,search:A,hash:$}=bE(B);return{protocol:C.toLowerCase(),auth:h?h.slice(0,Math.max(0,h.length-1)):"",host:E,pathname:s,search:A,hash:$,[TE]:!C}}function bE(D=""){let[u="",i="",C=""]=(D.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:u,search:i,hash:C}}function Tr(D){let u=D.pathname||"",i=D.search?(D.search.startsWith("?")?"":"?")+D.search:"",C=D.hash||"",h=D.auth?D.auth+"@":"",f=D.host||"";return(D.protocol||D[TE]?(D.protocol||"")+"//":"")+h+f+u+i+C}var Vf,ur,Fr,ir,Cr,H8,Er,hr,rr,fr,Ar,wr,mr,_r,Rr,TE;var yE=zD(()=>{Vf=String.fromCharCode,ur=/#/g,Fr=/&/g,ir=/\//g,Cr=/=/g,H8=/\+/g,Er=/%5e/gi,hr=/%60/gi,rr=/%7c/gi,fr=/%20/gi;Ar=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,wr=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,mr=/^([/\\]\s*){2,}[^/\\]/,_r=/\/$|\/\?|\/#/,Rr=/^\.?\//;TE=Symbol.for("ufo:protocolRelative")});function W8(D){let u=D.error?.message||D.error?.toString()||"",i=D.request?.method||D.options?.method||"GET",C=D.request?.url||String(D.request)||"/",h=`[${i}] ${JSON.stringify(C)}`,f=D.response?`${D.response.status} ${D.response.statusText}`:"<no response>",E=`${h}: ${f}${u?` ${u}`:""}`,B=new B2(E,D.error?{cause:D.error}:void 0);for(let s of["request","options","response"])Object.defineProperty(B,s,{get(){return D[s]}});for(let[s,A]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(B,s,{get(){return D.response&&D.response[A]}});return B}function JE(D="GET"){return Ir.has(D.toUpperCase())}function yr(D){if(D===void 0)return!1;let u=typeof D;if(u==="string"||u==="number"||u==="boolean"||u===null)return!0;if(u!=="object")return!1;if(Array.isArray(D))return!0;if(D.buffer)return!1;if(D instanceof FormData||D instanceof URLSearchParams)return!1;return D.constructor&&D.constructor.name==="Object"||typeof D.toJSON==="function"}function Mr(D=""){if(!D)return"json";let u=D.split(";").shift()||"";if(Nr.test(u))return"json";if(u==="text/event-stream")return"stream";if(Jr.has(u)||u.startsWith("text/"))return"text";return"blob"}function Qr(D,u,i,C){let h=Lr(u?.headers??D?.headers,i?.headers,C),f;if(i?.query||i?.params||u?.params||u?.query)f={...i?.params,...i?.query,...u?.params,...u?.query};return{...i,...u,query:f,params:f,headers:h}}function Lr(D,u,i){if(!u)return new i(D);let C=new i(u);if(D)for(let[h,f]of Symbol.iterator in D||Array.isArray(D)?D:new i(D))C.set(h,f);return C}async function m3(D,u){if(u)if(Array.isArray(u))for(let i of u)await i(D);else await u(D)}function _3(D={}){let{fetch:u=globalThis.fetch,Headers:i=globalThis.Headers,AbortController:C=globalThis.AbortController}=D;async function h(B){let s=B.error&&B.error.name==="AbortError"&&!B.options.timeout||!1;if(B.options.retry!==!1&&!s){let $;if(typeof B.options.retry==="number")$=B.options.retry;else $=JE(B.options.method)?0:1;let R=B.response&&B.response.status||500;if($>0&&(Array.isArray(B.options.retryStatusCodes)?B.options.retryStatusCodes.includes(R):Xr.has(R))){let m=typeof B.options.retryDelay==="function"?B.options.retryDelay(B):B.options.retryDelay||0;if(m>0)await new Promise((l)=>setTimeout(l,m));return f(B.request,{...B.options,retry:$-1})}}let A=W8(B);if(Error.captureStackTrace)Error.captureStackTrace(A,f);throw A}let f=async function(s,A={}){let $={request:s,options:Qr(s,A,D.defaults,i),response:void 0,error:void 0};if($.options.method)$.options.method=$.options.method.toUpperCase();if($.options.onRequest){if(await m3($,$.options.onRequest),!($.options.headers instanceof i))$.options.headers=new i($.options.headers||{})}if(typeof $.request==="string"){if($.options.baseURL)$.request=UE($.request,$.options.baseURL);if($.options.query)$.request=GE($.request,$.options.query),delete $.options.query;if("query"in $.options)delete $.options.query;if("params"in $.options)delete $.options.params}if($.options.body&&JE($.options.method)){if(yr($.options.body)){let l=$.options.headers.get("content-type");if(typeof $.options.body!=="string")$.options.body=l==="application/x-www-form-urlencoded"?new URLSearchParams($.options.body).toString():JSON.stringify($.options.body);if(!l)$.options.headers.set("content-type","application/json");if(!$.options.headers.has("accept"))$.options.headers.set("accept","application/json")}else if("pipeTo"in $.options.body&&typeof $.options.body.pipeTo==="function"||typeof $.options.body.pipe==="function"){if(!("duplex"in $.options))$.options.duplex="half"}}let R;if(!$.options.signal&&$.options.timeout){let l=new C;R=setTimeout(()=>{let S=Error("[TimeoutError]: The operation was aborted due to timeout");S.name="TimeoutError",S.code=23,l.abort(S)},$.options.timeout),$.options.signal=l.signal}try{$.response=await u($.request,$.options)}catch(l){if($.error=l,$.options.onRequestError)await m3($,$.options.onRequestError);return await h($)}finally{if(R)clearTimeout(R)}if(($.response.body||$.response._bodyInit)&&!Yr.has($.response.status)&&$.options.method!=="HEAD"){let l=($.options.parseResponse?"json":$.options.responseType)||Mr($.response.headers.get("content-type")||"");switch(l){case"json":{let S=await $.response.text(),y=$.options.parseResponse||_E;$.response._data=y(S);break}case"stream":{$.response._data=$.response.body||$.response._bodyInit;break}default:$.response._data=await $.response[l]()}}if($.options.onResponse)await m3($,$.options.onResponse);if(!$.options.ignoreResponseError&&$.response.status>=400&&$.response.status<600){if($.options.onResponseError)await m3($,$.options.onResponseError);return await h($)}return $.response},E=async function(s,A){return(await f(s,A))._data};return E.raw=f,E.native=(...B)=>u(...B),E.create=(B={},s={})=>_3({...D,...s,defaults:{...D.defaults,...s.defaults,...B}}),E}var B2,Ir,Jr,Nr,Xr,Yr;var K8=zD(()=>{RE();yE();B2=class B2 extends Error{constructor(D,u){super(D,u);if(this.name="FetchError",u?.cause&&!this.cause)this.cause=u.cause}};Ir=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));Jr=new Set(["image/svg","application/xml","application/xhtml","application/html"]),Nr=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;Xr=new Set([408,409,425,429,500,502,503,504]),Yr=new Set([101,204,205,304])});var XE={};H0(XE,{ofetch:()=>R3,fetch:()=>ME,createNodeFetch:()=>NE,createFetchError:()=>W8,createFetch:()=>_3,Headers:()=>QE,FetchError:()=>B2,AbortController:()=>LE,$fetch:()=>Vr});import Zr from"node:http";import zr from"node:https";function NE(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||"false"))return Y8;let u={keepAlive:!0},i=new Zr.Agent(u),C=new zr.Agent(u),h={agent(f){return f.protocol==="http:"?i:C}};return function(E,B){return Y8(E,{...h,...B})}}var ME,QE,LE,R3,Vr;var P8=zD(()=>{mE();K8();K8();ME=globalThis.fetch?(...D)=>globalThis.fetch(...D):NE(),QE=globalThis.Headers||AE,LE=globalThis.AbortController||wE,R3=_3({fetch:ME,Headers:QE,AbortController:LE}),Vr=R3});var ZE={};H0(ZE,{getOpenapiCachePath:()=>u0,getOauthPath:()=>Uu,ensureConfigDir:()=>D0,DEFAULT_PROFILE:()=>YE,DEFAULT_ENDPOINT:()=>lu,CONFIG_DIR:()=>e2});import{mkdirSync as Hr}from"node:fs";import{homedir as Wr}from"node:os";import{join as q8}from"node:path";function D0(){return Hr(e2,{recursive:!0,mode:448}),e2}function Uu(D=YE){return q8(e2,"oauth",`${D}.json`)}function u0(){return q8(e2,"openapi.json")}var lu="http://localhost:8000",YE="e2e",e2;var qu=zD(()=>{e2=q8(Wr(),".mitsein")});var bi=S7(Ri(),1),{program:Z5,createCommand:z5,createArgument:V5,createOption:H5,CommanderError:W5,InvalidArgumentError:K5,InvalidOptionArgumentError:P5,Command:Si,Argument:q5,Option:g5,Help:k5}=bi.default;var ED={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},aF={silent:{level:-1},fatal:{level:ED.fatal},error:{level:ED.error},warn:{level:ED.warn},log:{level:ED.log},info:{level:ED.info},success:{level:ED.success},fail:{level:ED.fail},ready:{level:ED.info},start:{level:ED.info},box:{level:ED.info},debug:{level:ED.debug},trace:{level:ED.trace},verbose:{level:ED.verbose}};function oF(D){if(D===null||typeof D!=="object")return!1;let u=Object.getPrototypeOf(D);if(u!==null&&u!==Object.prototype&&Object.getPrototypeOf(u)!==null)return!1;if(Symbol.iterator in D)return!1;if(Symbol.toStringTag in D)return Object.prototype.toString.call(D)==="[object Module]";return!0}function xF(D,u,i=".",C){if(!oF(u))return xF(D,{},i,C);let h=Object.assign({},u);for(let f in D){if(f==="__proto__"||f==="constructor")continue;let E=D[f];if(E===null||E===void 0)continue;if(C&&C(h,f,E,i))continue;if(Array.isArray(E)&&Array.isArray(h[f]))h[f]=[...E,...h[f]];else if(oF(E)&&oF(h[f]))h[f]=xF(E,h[f],(i?`${i}.`:"")+f.toString(),C);else h[f]=E}return h}function A9(D){return(...u)=>u.reduce((i,C)=>xF(i,C,"",D),{})}var w9=A9();function m9(D){return Object.prototype.toString.call(D)==="[object Object]"}function _9(D){if(!m9(D))return!1;if(!D.message&&!D.args)return!1;if(D.stack)return!1;return!0}var dF=!1,li=[];class iD{options;_lastLog;_mockFn;constructor(D={}){let u=D.types||aF;this.options=w9({...D,defaults:{...D.defaults},level:pF(D.level,u),reporters:[...D.reporters||[]]},{types:aF,throttle:1000,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let i in u){let C={type:i,...this.options.defaults,...u[i]};this[i]=this._wrapLogFn(C),this[i].raw=this._wrapLogFn(C,!0)}if(this.options.mockFn)this.mockTypes();this._lastLog={}}get level(){return this.options.level}set level(D){this.options.level=pF(D,this.options.types,this.options.level)}prompt(D,u){if(!this.options.prompt)throw Error("prompt is not supported!");return this.options.prompt(D,u)}create(D){let u=new iD({...this.options,...D});if(this._mockFn)u.mockTypes(this._mockFn);return u}withDefaults(D){return this.create({...this.options,defaults:{...this.options.defaults,...D}})}withTag(D){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+D:D})}addReporter(D){return this.options.reporters.push(D),this}removeReporter(D){if(D){let u=this.options.reporters.indexOf(D);if(u!==-1)return this.options.reporters.splice(u,1)}else this.options.reporters.splice(0);return this}setReporters(D){return this.options.reporters=Array.isArray(D)?D:[D],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let D in this.options.types){if(!console["__"+D])console["__"+D]=console[D];console[D]=this[D].raw}}restoreConsole(){for(let D in this.options.types)if(console["__"+D])console[D]=console["__"+D],delete console["__"+D]}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(D,u){if(!D)return;if(!D.__write)D.__write=D.write;D.write=(i)=>{this[u].raw(String(i).trim())}}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(D){if(!D)return;if(D.__write)D.write=D.__write,delete D.__write}pauseLogs(){dF=!0}resumeLogs(){dF=!1;let D=li.splice(0);for(let u of D)u[0]._logFn(u[1],u[2])}mockTypes(D){let u=D||this.options.mockFn;if(this._mockFn=u,typeof u!=="function")return;for(let i in this.options.types)this[i]=u(i,this.options.types[i])||this[i],this[i].raw=this[i]}_wrapLogFn(D,u){return(...i)=>{if(dF){li.push([this,D,i,u]);return}return this._logFn(D,i,u)}}_logFn(D,u,i){if((D.level||0)>this.level)return!1;let C={date:new Date,args:[],...D,level:pF(D.level,this.options.types)};if(!i&&u.length===1&&_9(u[0]))Object.assign(C,u[0]);else C.args=[...u];if(C.message)C.args.unshift(C.message),delete C.message;if(C.additional){if(!Array.isArray(C.additional))C.additional=C.additional.split(`
|
|
85
|
+
`);C.args.push(`
|
|
86
|
+
`+C.additional.join(`
|
|
87
|
+
`)),delete C.additional}C.type=typeof C.type==="string"?C.type.toLowerCase():"log",C.tag=typeof C.tag==="string"?C.tag:"";let h=(E=!1)=>{let B=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&B>0){let s=[...this._lastLog.object.args];if(B>1)s.push(`(repeated ${B} times)`);this._log({...this._lastLog.object,args:s}),this._lastLog.count=1}if(E)this._lastLog.object=C,this._log(C)};clearTimeout(this._lastLog.timeout);let f=this._lastLog.time&&C.date?C.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=C.date,f<this.options.throttle)try{let E=JSON.stringify([C.type,C.tag,C.args]),B=this._lastLog.serialized===E;if(this._lastLog.serialized=E,B){if(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin){this._lastLog.timeout=setTimeout(h,this.options.throttle);return}}}catch{}h(!0)}_log(D){for(let u of this.options.reporters)u.log(D,{options:this.options})}}function pF(D,u={},i=3){if(D===void 0)return i;if(typeof D==="number")return D;if(u[D]&&u[D].level!==void 0)return u[D].level;return i}iD.prototype.add=iD.prototype.addReporter;iD.prototype.remove=iD.prototype.removeReporter;iD.prototype.clear=iD.prototype.removeReporter;iD.prototype.withScope=iD.prototype.withTag;iD.prototype.mock=iD.prototype.mockTypes;iD.prototype.pause=iD.prototype.pauseLogs;iD.prototype.resume=iD.prototype.resumeLogs;function Ui(D={}){return new iD(D)}import{formatWithOptions as Gi}from"node:util";import{sep as R9}from"node:path";function D8(D,u){let i=process.cwd()+R9;return D.split(`
|
|
88
|
+
`).splice(u.split(`
|
|
89
|
+
`).length).map((h)=>h.trim().replace("file://","").replace(i,""))}function b9(D,u){return(u.__write||u.write).call(u,D)}var eF=(D)=>D?`[${D}]`:"";class P0{formatStack(D,u,i){let C=" ".repeat((i?.errorLevel||0)+1);return C+D8(D,u).join(`
|
|
90
|
+
${C}`)}formatError(D,u){let i=D.message??Gi(u,D),C=D.stack?this.formatStack(D.stack,i,u):"",h=u?.errorLevel||0,f=h>0?`${" ".repeat(h)}[cause]: `:"",E=D.cause?`
|
|
79
91
|
|
|
80
|
-
`+this.formatError(
|
|
81
|
-
`+
|
|
82
|
-
`+[
|
|
83
|
-
`)].filter(Boolean).map((
|
|
92
|
+
`+this.formatError(D.cause,{...u,errorLevel:h+1}):"";return f+i+`
|
|
93
|
+
`+C+E}formatArgs(D,u){let i=D.map((C)=>{if(C&&typeof C.stack==="string")return this.formatError(C,u);return C});return Gi(u,...i)}formatDate(D,u){return u.date?D.toLocaleTimeString():""}filterAndJoin(D){return D.filter(Boolean).join(" ")}formatLogObj(D,u){let i=this.formatArgs(D.args,u);if(D.type==="box")return`
|
|
94
|
+
`+[eF(D.tag),D.title&&D.title,...i.split(`
|
|
95
|
+
`)].filter(Boolean).map((C)=>" > "+C).join(`
|
|
84
96
|
`)+`
|
|
85
|
-
`;return this.filterAndJoin([
|
|
86
|
-
`,
|
|
87
|
-
`),
|
|
88
|
-
`)}var Ru=Object.create(null),fu=(u)=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(u?Ru:globalThis),k=new Proxy(Ru,{get(u,D){return fu()[D]??Ru[D]},has(u,D){let t=fu();return D in t||D in Ru},set(u,D,t){let r=fu(!0);return r[D]=t,!0},deleteProperty(u,D){if(!D)return!1;let t=fu(!0);return delete t[D],!0},ownKeys(){let u=fu(!0);return Object.keys(u)}}),lr=typeof process<"u"&&process.env&&"development"||"",$r=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function Ar(){if(globalThis.process?.env)for(let u of $r){let D=u[1]||u[0];if(globalThis.process?.env[D])return{name:u[0].toLowerCase(),...u[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var wt=Ar();wt.name;function d(u){return u?u!=="false":!1}var wr=globalThis.process?.platform||"",tD=d(k.CI)||wt.ci!==!1,_t=d(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),_r=d(k.DEBUG),iD=lr==="test"||d(k.TEST);d(k.MINIMAL);var mr=/^win/i.test(wr);!d(k.NO_COLOR)&&(d(k.FORCE_COLOR)||(_t||mr)&&k.TERM);var br=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(br?.split(".")[0]);var Rr=globalThis.process||Object.create(null),lt={versions:{}};new Proxy(Rr,{get(u,D){if(D==="env")return k;if(D in u)return u[D];if(D in lt)return lt[D]}});var Sr=globalThis.process?.release?.name==="node",Tr=!!globalThis.Bun||!!globalThis.process?.versions?.bun,yr=!!globalThis.Deno,Ur=!!globalThis.fastly,Ir=!!globalThis.Netlify,Gr=!!globalThis.EdgeRuntime,Nr=globalThis.navigator?.userAgent==="Cloudflare-Workers",Jr=[[Ir,"netlify"],[Gr,"edge-light"],[Nr,"workerd"],[Ur,"fastly"],[yr,"deno"],[Tr,"bun"],[Sr,"node"]];function Mr(){let u=Jr.find((D)=>D[0]);if(u)return{name:u[1]}}var gr=Mr();gr?.name;function Lr({onlyFirst:u=!1}={}){let t=["[\\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(t,u?void 0:"g")}var Pr=Lr();function Qr(u){if(typeof u!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Pr,"")}function Wr(u){return u===161||u===164||u===167||u===168||u===170||u===173||u===174||u>=176&&u<=180||u>=182&&u<=186||u>=188&&u<=191||u===198||u===208||u===215||u===216||u>=222&&u<=225||u===230||u>=232&&u<=234||u===236||u===237||u===240||u===242||u===243||u>=247&&u<=250||u===252||u===254||u===257||u===273||u===275||u===283||u===294||u===295||u===299||u>=305&&u<=307||u===312||u>=319&&u<=322||u===324||u>=328&&u<=331||u===333||u===338||u===339||u===358||u===359||u===363||u===462||u===464||u===466||u===468||u===470||u===472||u===474||u===476||u===593||u===609||u===708||u===711||u>=713&&u<=715||u===717||u===720||u>=728&&u<=731||u===733||u===735||u>=768&&u<=879||u>=913&&u<=929||u>=931&&u<=937||u>=945&&u<=961||u>=963&&u<=969||u===1025||u>=1040&&u<=1103||u===1105||u===8208||u>=8211&&u<=8214||u===8216||u===8217||u===8220||u===8221||u>=8224&&u<=8226||u>=8228&&u<=8231||u===8240||u===8242||u===8243||u===8245||u===8251||u===8254||u===8308||u===8319||u>=8321&&u<=8324||u===8364||u===8451||u===8453||u===8457||u===8467||u===8470||u===8481||u===8482||u===8486||u===8491||u===8531||u===8532||u>=8539&&u<=8542||u>=8544&&u<=8555||u>=8560&&u<=8569||u===8585||u>=8592&&u<=8601||u===8632||u===8633||u===8658||u===8660||u===8679||u===8704||u===8706||u===8707||u===8711||u===8712||u===8715||u===8719||u===8721||u===8725||u===8730||u>=8733&&u<=8736||u===8739||u===8741||u>=8743&&u<=8748||u===8750||u>=8756&&u<=8759||u===8764||u===8765||u===8776||u===8780||u===8786||u===8800||u===8801||u>=8804&&u<=8807||u===8810||u===8811||u===8814||u===8815||u===8834||u===8835||u===8838||u===8839||u===8853||u===8857||u===8869||u===8895||u===8978||u>=9312&&u<=9449||u>=9451&&u<=9547||u>=9552&&u<=9587||u>=9600&&u<=9615||u>=9618&&u<=9621||u===9632||u===9633||u>=9635&&u<=9641||u===9650||u===9651||u===9654||u===9655||u===9660||u===9661||u===9664||u===9665||u>=9670&&u<=9672||u===9675||u>=9678&&u<=9681||u>=9698&&u<=9701||u===9711||u===9733||u===9734||u===9737||u===9742||u===9743||u===9756||u===9758||u===9792||u===9794||u===9824||u===9825||u>=9827&&u<=9829||u>=9831&&u<=9834||u===9836||u===9837||u===9839||u===9886||u===9887||u===9919||u>=9926&&u<=9933||u>=9935&&u<=9939||u>=9941&&u<=9953||u===9955||u===9960||u===9961||u>=9963&&u<=9969||u===9972||u>=9974&&u<=9977||u===9979||u===9980||u===9982||u===9983||u===10045||u>=10102&&u<=10111||u>=11094&&u<=11097||u>=12872&&u<=12879||u>=57344&&u<=63743||u>=65024&&u<=65039||u===65533||u>=127232&&u<=127242||u>=127248&&u<=127277||u>=127280&&u<=127337||u>=127344&&u<=127373||u===127375||u===127376||u>=127387&&u<=127404||u>=917760&&u<=917999||u>=983040&&u<=1048573||u>=1048576&&u<=1114109}function zr(u){return u===12288||u>=65281&&u<=65376||u>=65504&&u<=65510}function Yr(u){return u>=4352&&u<=4447||u===8986||u===8987||u===9001||u===9002||u>=9193&&u<=9196||u===9200||u===9203||u===9725||u===9726||u===9748||u===9749||u>=9776&&u<=9783||u>=9800&&u<=9811||u===9855||u>=9866&&u<=9871||u===9875||u===9889||u===9898||u===9899||u===9917||u===9918||u===9924||u===9925||u===9934||u===9940||u===9962||u===9970||u===9971||u===9973||u===9978||u===9981||u===9989||u===9994||u===9995||u===10024||u===10060||u===10062||u>=10067&&u<=10069||u===10071||u>=10133&&u<=10135||u===10160||u===10175||u===11035||u===11036||u===11088||u===11093||u>=11904&&u<=11929||u>=11931&&u<=12019||u>=12032&&u<=12245||u>=12272&&u<=12287||u>=12289&&u<=12350||u>=12353&&u<=12438||u>=12441&&u<=12543||u>=12549&&u<=12591||u>=12593&&u<=12686||u>=12688&&u<=12773||u>=12783&&u<=12830||u>=12832&&u<=12871||u>=12880&&u<=42124||u>=42128&&u<=42182||u>=43360&&u<=43388||u>=44032&&u<=55203||u>=63744&&u<=64255||u>=65040&&u<=65049||u>=65072&&u<=65106||u>=65108&&u<=65126||u>=65128&&u<=65131||u>=94176&&u<=94180||u===94192||u===94193||u>=94208&&u<=100343||u>=100352&&u<=101589||u>=101631&&u<=101640||u>=110576&&u<=110579||u>=110581&&u<=110587||u===110589||u===110590||u>=110592&&u<=110882||u===110898||u>=110928&&u<=110930||u===110933||u>=110948&&u<=110951||u>=110960&&u<=111355||u>=119552&&u<=119638||u>=119648&&u<=119670||u===126980||u===127183||u===127374||u>=127377&&u<=127386||u>=127488&&u<=127490||u>=127504&&u<=127547||u>=127552&&u<=127560||u===127568||u===127569||u>=127584&&u<=127589||u>=127744&&u<=127776||u>=127789&&u<=127797||u>=127799&&u<=127868||u>=127870&&u<=127891||u>=127904&&u<=127946||u>=127951&&u<=127955||u>=127968&&u<=127984||u===127988||u>=127992&&u<=128062||u===128064||u>=128066&&u<=128252||u>=128255&&u<=128317||u>=128331&&u<=128334||u>=128336&&u<=128359||u===128378||u===128405||u===128406||u===128420||u>=128507&&u<=128591||u>=128640&&u<=128709||u===128716||u>=128720&&u<=128722||u>=128725&&u<=128727||u>=128732&&u<=128735||u===128747||u===128748||u>=128756&&u<=128764||u>=128992&&u<=129003||u===129008||u>=129292&&u<=129338||u>=129340&&u<=129349||u>=129351&&u<=129535||u>=129648&&u<=129660||u>=129664&&u<=129673||u>=129679&&u<=129734||u>=129742&&u<=129756||u>=129759&&u<=129769||u>=129776&&u<=129784||u>=131072&&u<=196605||u>=196608&&u<=262141}function qr(u){if(!Number.isSafeInteger(u))throw TypeError(`Expected a code point, got \`${typeof u}\`.`)}function Zr(u,{ambiguousAsWide:D=!1}={}){if(qr(u),zr(u)||Yr(u)||D&&Wr(u))return 2;return 1}var ar=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},Xr=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:(u)=>u.split("")},Hr=/^\p{Default_Ignorable_Code_Point}$/u;function Vr(u,D={}){if(typeof u!=="string"||u.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:r=!1}=D;if(!r)u=Qr(u);if(u.length===0)return 0;let n=0,F={ambiguousAsWide:!t};for(let{segment:i}of Xr.segment(u)){let e=i.codePointAt(0);if(e<=31||e>=127&&e<=159)continue;if(e>=8203&&e<=8207||e===65279)continue;if(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071)continue;if(e>=55296&&e<=57343)continue;if(e>=65024&&e<=65039)continue;if(Hr.test(i))continue;if(ar().test(i)){n+=2;continue}n+=Zr(e,F)}return n}function kr(){let{env:u}=ot,{TERM:D,TERM_PROGRAM:t}=u;if(ot.platform!=="win32")return D!=="linux";return Boolean(u.WT_SESSION)||Boolean(u.TERMINUS_SUBLIME)||u.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||D==="xterm-256color"||D==="alacritty"||D==="rxvt-unicode"||D==="rxvt-unicode-256color"||u.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Kr={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},vr={0:"red",1:"yellow"},jr=kr(),Z=(u,D)=>jr?u:D,$t={error:Z("\u2716","\xD7"),fatal:Z("\u2716","\xD7"),ready:Z("\u2714","\u221A"),warn:Z("\u26A0","\u203C"),info:Z("\u2139","i"),success:Z("\u2714","\u221A"),debug:Z("\u2699","D"),trace:Z("\u2192","\u2192"),fail:Z("\u2716","\xD7"),start:Z("\u25D0","o"),log:""};function At(u){if(typeof Intl!=="object"||!Intl.Segmenter)return H(u).length;return Vr(u)}class mt extends ou{formatStack(u,D,t){let r=" ".repeat((t?.errorLevel||0)+1);return`
|
|
89
|
-
${
|
|
90
|
-
${
|
|
91
|
-
`);if(
|
|
92
|
-
`+
|
|
93
|
-
`):"")),{title:
|
|
94
|
-
`+
|
|
95
|
-
`):""),
|
|
96
|
-
`+
|
|
97
|
-
`:f}}function bu(u){return u.replace(/`([^`]+)`/gm,(D,t)=>g.cyan(t)).replace(/\s+_([^_]+)_\s+/gm,(D,t)=>` ${g.underline(t)} `)}function Or(u="white"){return g[u]||g.white}function dr(u="bgWhite"){return g[`bg${u[0].toUpperCase()}${u.slice(1)}`]||g.bgWhite}function pr(u={}){let D=xr();if(process.env.CONSOLA_LEVEL)D=Number.parseInt(process.env.CONSOLA_LEVEL)??D;return PD({level:D,defaults:{level:D},stdout:process.stdout,stderr:process.stderr,prompt:(...r)=>Promise.resolve().then(() => (Bt(),ct)).then((n)=>n.prompt(...r)),reporters:u.reporters||[u.fancy??!(tD||iD)?new mt:new ou],...u})}function xr(){if(_r)return J.debug;if(iD)return J.warn;return J.info}var R=pr();var un=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Dn=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,tn=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function rn(u,D){if(u==="__proto__"||u==="constructor"&&D&&typeof D==="object"&&"prototype"in D){nn(u);return}return D}function nn(u){console.warn(`[destr] Dropping "${u}" key to prevent prototype pollution.`)}function bt(u,D={}){if(typeof u!=="string")return u;if(u[0]==='"'&&u[u.length-1]==='"'&&u.indexOf("\\")===-1)return u.slice(1,-1);let t=u.trim();if(t.length<=9)switch(t.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!tn.test(u)){if(D.strict)throw SyntaxError("[destr] Invalid JSON");return u}try{if(un.test(u)||Dn.test(u)){if(D.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(u,rn)}return JSON.parse(u)}catch(r){if(D.strict)throw r;return u}}var E3=String.fromCharCode;var Fn=/#/g,en=/&/g,sn=/\//g,Cn=/=/g;var eD=/\+/g,fn=/%5e/gi,En=/%60/gi;var hn=/%7c/gi;var cn=/%20/gi;function Bn(u){return encodeURI(""+u).replace(hn,"|")}function nD(u){return Bn(typeof u==="string"?u:JSON.stringify(u)).replace(eD,"%2B").replace(cn,"+").replace(Fn,"%23").replace(en,"%26").replace(En,"`").replace(fn,"^").replace(sn,"%2F")}function rD(u){return nD(u).replace(Cn,"%3D")}function St(u=""){try{return decodeURIComponent(""+u)}catch{return""+u}}function on(u){return St(u.replace(eD," "))}function ln(u){return St(u.replace(eD," "))}function $n(u=""){let D=Object.create(null);if(u[0]==="?")u=u.slice(1);for(let t of u.split("&")){let r=t.match(/([^=]+)=?(.*)/)||[];if(r.length<2)continue;let n=on(r[1]);if(n==="__proto__"||n==="constructor")continue;let F=ln(r[2]||"");if(D[n]===void 0)D[n]=F;else if(Array.isArray(D[n]))D[n].push(F);else D[n]=[D[n],F]}return D}function An(u,D){if(typeof D==="number"||typeof D==="boolean")D=String(D);if(!D)return rD(u);if(Array.isArray(D))return D.map((t)=>`${rD(u)}=${nD(t)}`).join("&");return`${rD(u)}=${nD(D)}`}function wn(u){return Object.keys(u).filter((D)=>u[D]!==void 0).map((D)=>An(D,u[D])).filter(Boolean).join("&")}var _n=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,mn=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,bn=/^([/\\]\s*){2,}[^/\\]/;var Rn=/\/$|\/\?|\/#/,Sn=/^\.?\//;function Tt(u,D={}){if(typeof D==="boolean")D={acceptRelative:D};if(D.strict)return _n.test(u);return mn.test(u)||(D.acceptRelative?bn.test(u):!1)}function FD(u="",D){if(!D)return u.endsWith("/");return Rn.test(u)}function Tn(u="",D){if(!D)return(FD(u)?u.slice(0,-1):u)||"/";if(!FD(u,!0))return u||"/";let t=u,r="",n=u.indexOf("#");if(n!==-1)t=u.slice(0,n),r=u.slice(n);let[F,...i]=t.split("?");return((F.endsWith("/")?F.slice(0,-1):F)||"/")+(i.length>0?`?${i.join("?")}`:"")+r}function yn(u="",D){if(!D)return u.endsWith("/")?u:u+"/";if(FD(u,!0))return u||"/";let t=u,r="",n=u.indexOf("#");if(n!==-1){if(t=u.slice(0,n),r=u.slice(n),!t)return r}let[F,...i]=t.split("?");return F+"/"+(i.length>0?`?${i.join("?")}`:"")+r}function yt(u,D){if(Un(D)||Tt(u))return u;let t=Tn(D);if(u.startsWith(t)){let r=u[t.length];if(!r||r==="/"||r==="?")return u}return Gn(t,u)}function Ut(u,D){let t=Gt(u),r={...$n(t.search),...D};return t.search=wn(r),Nn(t)}function Un(u){return!u||u==="/"}function In(u){return u&&u!=="/"}function Gn(u,...D){let t=u||"";for(let r of D.filter((n)=>In(n)))if(t){let n=r.replace(Sn,"");t=yn(t)+n}else t=r;return t}var It=Symbol.for("ufo:protocolRelative");function Gt(u="",D){let t=u.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(t){let[,E,c=""]=t;return{protocol:E.toLowerCase(),pathname:c,href:E+c,auth:"",host:"",search:"",hash:""}}if(!Tt(u,{acceptRelative:!0}))return D?Gt(D+u):Rt(u);let[,r="",n,F=""]=u.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,i="",e=""]=F.match(/([^#/?]*)(.*)?/)||[];if(r==="file:")e=e.replace(/\/(?=[A-Za-z]:)/,"");let{pathname:s,search:f,hash:C}=Rt(e);return{protocol:r.toLowerCase(),auth:n?n.slice(0,Math.max(0,n.length-1)):"",host:i,pathname:s,search:f,hash:C,[It]:!r}}function Rt(u=""){let[D="",t="",r=""]=(u.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:D,search:t,hash:r}}function Nn(u){let D=u.pathname||"",t=u.search?(u.search.startsWith("?")?"":"?")+u.search:"",r=u.hash||"",n=u.auth?u.auth+"@":"",F=u.host||"";return(u.protocol||u[It]?(u.protocol||"")+"//":"")+n+F+D+t+r}class Eu extends Error{constructor(u,D){super(u,D);if(this.name="FetchError",D?.cause&&!this.cause)this.cause=D.cause}}function Jt(u){let D=u.error?.message||u.error?.toString()||"",t=u.request?.method||u.options?.method||"GET",r=u.request?.url||String(u.request)||"/",n=`[${t}] ${JSON.stringify(r)}`,F=u.response?`${u.response.status} ${u.response.statusText}`:"<no response>",i=`${n}: ${F}${D?` ${D}`:""}`,e=new Eu(i,u.error?{cause:u.error}:void 0);for(let s of["request","options","response"])Object.defineProperty(e,s,{get(){return u[s]}});for(let[s,f]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(e,s,{get(){return u.response&&u.response[f]}});return e}var Jn=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function Nt(u="GET"){return Jn.has(u.toUpperCase())}function Mn(u){if(u===void 0)return!1;let D=typeof u;if(D==="string"||D==="number"||D==="boolean"||D===null)return!0;if(D!=="object")return!1;if(Array.isArray(u))return!0;if(u.buffer)return!1;if(u instanceof FormData||u instanceof URLSearchParams)return!1;return u.constructor&&u.constructor.name==="Object"||typeof u.toJSON==="function"}var gn=new Set(["image/svg","application/xml","application/xhtml","application/html"]),Ln=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function Pn(u=""){if(!u)return"json";let D=u.split(";").shift()||"";if(Ln.test(D))return"json";if(D==="text/event-stream")return"stream";if(gn.has(D)||D.startsWith("text/"))return"text";return"blob"}function Qn(u,D,t,r){let n=Wn(D?.headers??u?.headers,t?.headers,r),F;if(t?.query||t?.params||D?.params||D?.query)F={...t?.params,...t?.query,...D?.params,...D?.query};return{...t,...D,query:F,params:F,headers:n}}function Wn(u,D,t){if(!D)return new t(u);let r=new t(D);if(u)for(let[n,F]of Symbol.iterator in u||Array.isArray(u)?u:new t(u))r.set(n,F);return r}async function Su(u,D){if(D)if(Array.isArray(D))for(let t of D)await t(u);else await D(u)}var zn=new Set([408,409,425,429,500,502,503,504]),Yn=new Set([101,204,205,304]);function sD(u={}){let{fetch:D=globalThis.fetch,Headers:t=globalThis.Headers,AbortController:r=globalThis.AbortController}=u;async function n(e){let s=e.error&&e.error.name==="AbortError"&&!e.options.timeout||!1;if(e.options.retry!==!1&&!s){let C;if(typeof e.options.retry==="number")C=e.options.retry;else C=Nt(e.options.method)?0:1;let E=e.response&&e.response.status||500;if(C>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(E):zn.has(E))){let c=typeof e.options.retryDelay==="function"?e.options.retryDelay(e):e.options.retryDelay||0;if(c>0)await new Promise((B)=>setTimeout(B,c));return F(e.request,{...e.options,retry:C-1})}}let f=Jt(e);if(Error.captureStackTrace)Error.captureStackTrace(f,F);throw f}let F=async function(s,f={}){let C={request:s,options:Qn(s,f,u.defaults,t),response:void 0,error:void 0};if(C.options.method)C.options.method=C.options.method.toUpperCase();if(C.options.onRequest){if(await Su(C,C.options.onRequest),!(C.options.headers instanceof t))C.options.headers=new t(C.options.headers||{})}if(typeof C.request==="string"){if(C.options.baseURL)C.request=yt(C.request,C.options.baseURL);if(C.options.query)C.request=Ut(C.request,C.options.query),delete C.options.query;if("query"in C.options)delete C.options.query;if("params"in C.options)delete C.options.params}if(C.options.body&&Nt(C.options.method)){if(Mn(C.options.body)){let B=C.options.headers.get("content-type");if(typeof C.options.body!=="string")C.options.body=B==="application/x-www-form-urlencoded"?new URLSearchParams(C.options.body).toString():JSON.stringify(C.options.body);if(!B)C.options.headers.set("content-type","application/json");if(!C.options.headers.has("accept"))C.options.headers.set("accept","application/json")}else if("pipeTo"in C.options.body&&typeof C.options.body.pipeTo==="function"||typeof C.options.body.pipe==="function"){if(!("duplex"in C.options))C.options.duplex="half"}}let E;if(!C.options.signal&&C.options.timeout){let B=new r;E=setTimeout(()=>{let A=Error("[TimeoutError]: The operation was aborted due to timeout");A.name="TimeoutError",A.code=23,B.abort(A)},C.options.timeout),C.options.signal=B.signal}try{C.response=await D(C.request,C.options)}catch(B){if(C.error=B,C.options.onRequestError)await Su(C,C.options.onRequestError);return await n(C)}finally{if(E)clearTimeout(E)}if((C.response.body||C.response._bodyInit)&&!Yn.has(C.response.status)&&C.options.method!=="HEAD"){let B=(C.options.parseResponse?"json":C.options.responseType)||Pn(C.response.headers.get("content-type")||"");switch(B){case"json":{let A=await C.response.text(),S=C.options.parseResponse||bt;C.response._data=S(A);break}case"stream":{C.response._data=C.response.body||C.response._bodyInit;break}default:C.response._data=await C.response[B]()}}if(C.options.onResponse)await Su(C,C.options.onResponse);if(!C.options.ignoreResponseError&&C.response.status>=400&&C.response.status<600){if(C.options.onResponseError)await Su(C,C.options.onResponseError);return await n(C)}return C.response},i=async function(s,f){return(await F(s,f))._data};return i.raw=F,i.native=(...e)=>D(...e),i.create=(e={},s={})=>sD({...u,...s,defaults:{...u.defaults,...s.defaults,...e}}),i}var Tu=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw Error("unable to locate global object")}(),qn=Tu.fetch?(...u)=>Tu.fetch(...u):()=>Promise.reject(Error("[ofetch] global.fetch is not supported!")),Zn=Tu.Headers,an=Tu.AbortController,Mt=sD({fetch:qn,Headers:Zn,AbortController:an});import{existsSync as Lt,readFileSync as kn}from"fs";import{join as gt}from"path";import{mkdirSync as Xn}from"fs";import{homedir as Hn}from"os";import{join as CD}from"path";var p="http://localhost:8000",Vn="e2e",yu=CD(Hn(),".mitsein");function Uu(){return Xn(yu,{recursive:!0,mode:448}),yu}function x(u=Vn){return CD(yu,"oauth",`${u}.json`)}function Iu(){return CD(yu,"openapi.json")}class o extends Error{code;detail;constructor(u,D=1,t){super(u);this.name="CliError",this.code=D,this.detail=t}}class fD extends o{constructor(u="No credentials found. Set MITSEIN_TOKEN, pass --token, or run from a dev environment with scripts/dev-token.sh."){super(u,2);this.name="NoCredentialsError"}}class iu extends o{statusCode;constructor(u,D,t){let r=u>=400&&u<500?1:3;super(D,r,t);this.name="HttpError",this.statusCode=u}}function w(u){return async function(...t){try{await Promise.resolve(u.apply(this,t))}catch(r){if(r instanceof o){if(R.error(`Error: ${r.message}`),r.detail!=null&&r.detail!=="")R.error(String(r.detail));process.exit(r.code)}if(r!==null&&typeof r==="object"&&r.name==="AbortError")process.stderr.write(`
|
|
97
|
+
`;return this.filterAndJoin([eF(D.type),eF(D.tag),i])}log(D,u){let i=this.formatLogObj(D,{columns:u.options.stdout.columns||0,...u.options.formatOptions});return b9(i+`
|
|
98
|
+
`,D.level<2?u.options.stderr||process.stderr:u.options.stdout||process.stdout)}}import iC from"node:process";import*as q0 from"node:tty";var{env:mu={},argv:yi=[],platform:S9=""}=typeof process>"u"?{}:process,l9="NO_COLOR"in mu||yi.includes("--no-color"),U9="FORCE_COLOR"in mu||yi.includes("--color"),G9=S9==="win32",Ji=mu.TERM==="dumb",T9=q0&&q0.isatty&&q0.isatty(1)&&mu.TERM&&!Ji,I9="CI"in mu&&(("GITHUB_ACTIONS"in mu)||("GITLAB_CI"in mu)||("CIRCLECI"in mu)),y9=!l9&&(U9||G9&&!Ji||T9||I9);function Ni(D,u,i,C,h=u.slice(0,Math.max(0,D))+C,f=u.slice(Math.max(0,D+i.length)),E=f.indexOf(i)){return h+(E<0?f:Ni(E,f,i,C))}function J9(D,u,i,C,h){return D<0?i+u+C:i+Ni(D,u,C,h)+C}function N9(D,u,i=D,C=D.length+1){return(h)=>h||!(h===""||h===void 0)?J9((""+h).indexOf(u,C),h,D,u,i):""}function Y(D,u,i){return N9(`\x1B[${D}m`,`\x1B[${u}m`,i)}var Ti={reset:Y(0,0),bold:Y(1,22,"\x1B[22m\x1B[1m"),dim:Y(2,22,"\x1B[22m\x1B[2m"),italic:Y(3,23),underline:Y(4,24),inverse:Y(7,27),hidden:Y(8,28),strikethrough:Y(9,29),black:Y(30,39),red:Y(31,39),green:Y(32,39),yellow:Y(33,39),blue:Y(34,39),magenta:Y(35,39),cyan:Y(36,39),white:Y(37,39),gray:Y(90,39),bgBlack:Y(40,49),bgRed:Y(41,49),bgGreen:Y(42,49),bgYellow:Y(43,49),bgBlue:Y(44,49),bgMagenta:Y(45,49),bgCyan:Y(46,49),bgWhite:Y(47,49),blackBright:Y(90,39),redBright:Y(91,39),greenBright:Y(92,39),yellowBright:Y(93,39),blueBright:Y(94,39),magentaBright:Y(95,39),cyanBright:Y(96,39),whiteBright:Y(97,39),bgBlackBright:Y(100,49),bgRedBright:Y(101,49),bgGreenBright:Y(102,49),bgYellowBright:Y(103,49),bgBlueBright:Y(104,49),bgMagentaBright:Y(105,49),bgCyanBright:Y(106,49),bgWhiteBright:Y(107,49)};function M9(D=y9){return D?Ti:Object.fromEntries(Object.keys(Ti).map((u)=>[u,String]))}var nD=M9();function Q9(D,u="reset"){return nD[D]||nD[u]}var L9=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function wu(D){return D.replace(new RegExp(L9,"g"),"")}var Ii={solid:{tl:"┌",tr:"┐",bl:"└",br:"┘",h:"─",v:"│"},double:{tl:"╔",tr:"╗",bl:"╚",br:"╝",h:"═",v:"║"},doubleSingle:{tl:"╓",tr:"╖",bl:"╙",br:"╜",h:"─",v:"║"},doubleSingleRounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"─",v:"║"},singleThick:{tl:"┏",tr:"┓",bl:"┗",br:"┛",h:"━",v:"┃"},singleDouble:{tl:"╒",tr:"╕",bl:"╘",br:"╛",h:"═",v:"│"},singleDoubleRounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"═",v:"│"},rounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"─",v:"│"}},X9={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function Mi(D,u={}){let i={...u,style:{...X9,...u.style}},C=D.split(`
|
|
99
|
+
`),h=[],f=Q9(i.style.borderColor),E={...typeof i.style.borderStyle==="string"?Ii[i.style.borderStyle]||Ii.solid:i.style.borderStyle};if(f)for(let l in E)E[l]=f(E[l]);let B=i.style.padding%2===0?i.style.padding:i.style.padding+1,s=C.length+B,A=Math.max(...C.map((l)=>wu(l).length),i.title?wu(i.title).length:0)+B,$=A+B,R=i.style.marginLeft>0?" ".repeat(i.style.marginLeft):"";if(i.style.marginTop>0)h.push("".repeat(i.style.marginTop));if(i.title){let l=f?f(i.title):i.title,S=E.h.repeat(Math.floor((A-wu(i.title).length)/2)),y=E.h.repeat(A-wu(i.title).length-wu(S).length+B);h.push(`${R}${E.tl}${S}${l}${y}${E.tr}`)}else h.push(`${R}${E.tl}${E.h.repeat($)}${E.tr}`);let m=i.style.valign==="center"?Math.floor((s-C.length)/2):i.style.valign==="top"?s-C.length-B:s-C.length;for(let l=0;l<s;l++)if(l<m||l>=m+C.length)h.push(`${R}${E.v}${" ".repeat($)}${E.v}`);else{let S=C[l-m],y=" ".repeat(B),J=" ".repeat(A-wu(S).length);h.push(`${R}${E.v}${y}${S}${J}${E.v}`)}if(h.push(`${R}${E.bl}${E.h.repeat($)}${E.br}`),i.style.marginBottom>0)h.push("".repeat(i.style.marginBottom));return h.join(`
|
|
100
|
+
`)}var d0=Object.create(null),k2=(D)=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(D?d0:globalThis),_u=new Proxy(d0,{get(D,u){return k2()[u]??d0[u]},has(D,u){let i=k2();return u in i||u in d0},set(D,u,i){let C=k2(!0);return C[u]=i,!0},deleteProperty(D,u){if(!u)return!1;let i=k2(!0);return delete i[u],!0},ownKeys(){let D=k2(!0);return Object.keys(D)}}),U4=typeof process<"u"&&process.env&&"development"||"",G4=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function T4(){if(globalThis.process?.env)for(let D of G4){let u=D[1]||D[0];if(globalThis.process?.env[u])return{name:D[0].toLowerCase(),...D[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var rC=T4();rC.name;function Zu(D){return D?D!=="false":!1}var I4=globalThis.process?.platform||"",c8=Zu(_u.CI)||rC.ci!==!1,fC=Zu(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),y4=Zu(_u.DEBUG),n8=U4==="test"||Zu(_u.TEST);Zu(_u.MINIMAL);var J4=/^win/i.test(I4);!Zu(_u.NO_COLOR)&&(Zu(_u.FORCE_COLOR)||(fC||J4)&&_u.TERM);var N4=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(N4?.split(".")[0]);var M4=globalThis.process||Object.create(null),CC={versions:{}};new Proxy(M4,{get(D,u){if(u==="env")return _u;if(u in D)return D[u];if(u in CC)return CC[u]}});var Q4=globalThis.process?.release?.name==="node",L4=!!globalThis.Bun||!!globalThis.process?.versions?.bun,X4=!!globalThis.Deno,Y4=!!globalThis.fastly,Z4=!!globalThis.Netlify,z4=!!globalThis.EdgeRuntime,V4=globalThis.navigator?.userAgent==="Cloudflare-Workers",H4=[[Z4,"netlify"],[z4,"edge-light"],[V4,"workerd"],[Y4,"fastly"],[X4,"deno"],[L4,"bun"],[Q4,"node"]];function W4(){let D=H4.find((u)=>u[0]);if(D)return{name:D[1]}}var K4=W4();K4?.name;function P4({onlyFirst:D=!1}={}){let i=["[\\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(i,D?void 0:"g")}var q4=P4();function g4(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(q4,"")}function k4(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function v4(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function j4(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D===94192||D===94193||D>=94208&&D<=100343||D>=100352&&D<=101589||D>=101631&&D<=101640||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128727||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129673||D>=129679&&D<=129734||D>=129742&&D<=129756||D>=129759&&D<=129769||D>=129776&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function O4(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function o4(D,{ambiguousAsWide:u=!1}={}){if(O4(D),v4(D)||j4(D)||u&&k4(D))return 2;return 1}var d4=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},p4=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:(D)=>D.split("")},a4=/^\p{Default_Ignorable_Code_Point}$/u;function x4(D,u={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:i=!0,countAnsiEscapeCodes:C=!1}=u;if(!C)D=g4(D);if(D.length===0)return 0;let h=0,f={ambiguousAsWide:!i};for(let{segment:E}of p4.segment(D)){let B=E.codePointAt(0);if(B<=31||B>=127&&B<=159)continue;if(B>=8203&&B<=8207||B===65279)continue;if(B>=768&&B<=879||B>=6832&&B<=6911||B>=7616&&B<=7679||B>=8400&&B<=8447||B>=65056&&B<=65071)continue;if(B>=55296&&B<=57343)continue;if(B>=65024&&B<=65039)continue;if(a4.test(E))continue;if(d4().test(E)){h+=2;continue}h+=o4(B,f)}return h}function e4(){let{env:D}=iC,{TERM:u,TERM_PROGRAM:i}=D;if(iC.platform!=="win32")return u!=="linux";return Boolean(D.WT_SESSION)||Boolean(D.TERMINUS_SUBLIME)||D.ConEmuTask==="{cmd::Cmder}"||i==="Terminus-Sublime"||i==="vscode"||u==="xterm-256color"||u==="alacritty"||u==="rxvt-unicode"||u==="rxvt-unicode-256color"||D.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Dh={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},uh={0:"red",1:"yellow"},Fh=e4(),HD=(D,u)=>Fh?D:u,EC={error:HD("✖","×"),fatal:HD("✖","×"),ready:HD("✔","√"),warn:HD("⚠","‼"),info:HD("ℹ","i"),success:HD("✔","√"),debug:HD("⚙","D"),trace:HD("→","→"),fail:HD("✖","×"),start:HD("◐","o"),log:""};function hC(D){if(typeof Intl!=="object"||!Intl.Segmenter)return wu(D).length;return x4(D)}class cC extends P0{formatStack(D,u,i){let C=" ".repeat((i?.errorLevel||0)+1);return`
|
|
101
|
+
${C}`+D8(D,u).map((h)=>" "+h.replace(/^at +/,(f)=>nD.gray(f)).replace(/\((.+)\)/,(f,E)=>`(${nD.cyan(E)})`)).join(`
|
|
102
|
+
${C}`)}formatType(D,u,i){let C=Dh[D.type]||uh[D.level]||"gray";if(u)return Ch(C)(nD.black(` ${D.type.toUpperCase()} `));let h=typeof EC[D.type]==="string"?EC[D.type]:D.icon||D.type;return h?ih(C)(h):""}formatLogObj(D,u){let[i,...C]=this.formatArgs(D.args,u).split(`
|
|
103
|
+
`);if(D.type==="box")return Mi(o0(i+(C.length>0?`
|
|
104
|
+
`+C.join(`
|
|
105
|
+
`):"")),{title:D.title?o0(D.title):void 0,style:D.style});let h=this.formatDate(D.date,u),f=h&&nD.gray(h),E=D.badge??D.level<2,B=this.formatType(D,E,u),s=D.tag?nD.gray(D.tag):"",A,$=this.filterAndJoin([B,o0(i)]),R=this.filterAndJoin(u.columns?[s,f]:[s]),m=(u.columns||0)-hC($)-hC(R)-2;if(A=m>0&&(u.columns||0)>=80?$+" ".repeat(m)+R:(R?`${nD.gray(`[${R}]`)} `:"")+$,A+=o0(C.length>0?`
|
|
106
|
+
`+C.join(`
|
|
107
|
+
`):""),D.type==="trace"){let l=Error("Trace: "+D.message);A+=this.formatStack(l.stack||"",l.message)}return E?`
|
|
108
|
+
`+A+`
|
|
109
|
+
`:A}}function o0(D){return D.replace(/`([^`]+)`/gm,(u,i)=>nD.cyan(i)).replace(/\s+_([^_]+)_\s+/gm,(u,i)=>` ${nD.underline(i)} `)}function ih(D="white"){return nD[D]||nD.white}function Ch(D="bgWhite"){return nD[`bg${D[0].toUpperCase()}${D.slice(1)}`]||nD.bgWhite}function Eh(D={}){let u=hh();if(process.env.CONSOLA_LEVEL)u=Number.parseInt(process.env.CONSOLA_LEVEL)??u;return Ui({level:u,defaults:{level:u},stdout:process.stdout,stderr:process.stderr,prompt:(...C)=>Promise.resolve().then(() => (FC(),uC)).then((h)=>h.prompt(...C)),reporters:D.reporters||[D.fancy??!(c8||n8)?new cC:new P0],...D})}function hh(){if(y4)return ED.debug;if(n8)return ED.warn;return ED.info}var k=Eh();P8();qu();import{existsSync as VE,readFileSync as Kr}from"node:fs";import{join as zE}from"node:path";class X extends Error{code;detail;constructor(D,u=1,i){super(D);this.name="CliError",this.code=u,this.detail=i}}class g8 extends X{constructor(D="No credentials found. Set MITSEIN_TOKEN, pass --token, or run from a dev environment with scripts/dev-token.sh."){super(D,2);this.name="NoCredentialsError"}}class s2 extends X{statusCode;constructor(D,u,i){let C=D>=400&&D<500?1:3;super(u,C,i);this.name="HttpError",this.statusCode=D}}function K(D){return async function(...i){try{await Promise.resolve(D.apply(this,i))}catch(C){if(C instanceof X){if(k.error(`Error: ${C.message}`),C.detail!=null&&C.detail!=="")k.error(String(C.detail));process.exit(C.code)}if(C!==null&&typeof C==="object"&&C.name==="AbortError")process.stderr.write(`
|
|
98
110
|
Interrupted.
|
|
99
|
-
`),process.exit(130);throw
|
|
100
|
-
`)}function
|
|
101
|
-
`);return}if(
|
|
111
|
+
`),process.exit(130);throw C}}}function Pr(D){try{return new URL(D).hostname}catch{return""}}function qr(D){let u=Pr(D);return u==="localhost"||u==="127.0.0.1"||u==="::1"||u==="0.0.0.0"}function gr(D){let u=[];if(D)u.push(D);u.push(process.cwd());for(let i of u){let C=i;for(let h=0;h<10;h++){let f=zE(C,"scripts","dev-token.sh");if(VE(f))return f;let E=zE(C,"..");if(E===C)break;C=E}}return null}function kr(D,u){let{execFileSync:i}=VD("node:child_process"),C=[D,"--raw"];if(u)C.push("--real");try{let h=i("bash",C,{timeout:1e4,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return{ok:h.length>0,stdout:h}}catch{return{ok:!1,stdout:""}}}function vr(D,u){if(D)return{token:D,endpoint:u??lu};return null}function jr(){let D=process.env.MITSEIN_TOKEN;if(D)return{token:D,endpoint:process.env.MITSEIN_API_URL??lu};return null}function Or(D,u){let i=Uu(D);if(!VE(i))return null;try{let C=Kr(i,"utf8"),h=JSON.parse(C),f=h.access_token;if(f)return{token:f,endpoint:u??h.endpoint??lu}}catch{}return null}function or(D,u,i,C){let h=D??lu;if(!qr(h))return null;let f=gr(i);if(!f)return null;try{let{ok:E,stdout:B}=C(f,u);if(E)return{token:B,endpoint:h}}catch{}return null}function LD(D={}){let u=D.profile??"e2e",i=D.spawnDevToken??kr,C=vr(D.token,D.endpoint);if(C)return C;let h=jr();if(h)return h;let f=Or(u,D.endpoint);if(f)return f;let E=or(D.endpoint,D.real??!1,D.projectRoot,i);if(E)return E;throw new g8}function dr(D){return D.replace(/\/$/,"")}function Gu(D,u){if(D)process.stderr.write(`[debug] ${u}
|
|
112
|
+
`)}function pr(D){let u="HTTP error",i;if(D!==null&&typeof D==="object"&&!Array.isArray(D)){let C=D;u=typeof C.message==="string"?C.message:u,i=C.detail??C.error}return{message:u,detail:i}}async function F0(D){try{return await D}catch(u){if(u instanceof B2){let i=u.statusCode??u.status??0,{message:C,detail:h}=pr(u.data);throw new s2(i||599,C,h)}throw u}}class DD{timeoutMs;debug;fetchImpl;baseUrl;bearerToken;constructor(D,u={}){this.debug=u.debug??!1,this.timeoutMs=u.timeoutSec===void 0||u.timeoutSec===0?void 0:u.timeoutSec*1000,this.baseUrl=dr(D.endpoint),this.bearerToken=D.token;let i=this.debug;this.fetchImpl=u.fetcher??R3.create({baseURL:this.baseUrl,timeout:this.timeoutMs,headers:{Authorization:`Bearer ${D.token}`,"Content-Type":"application/json"},retry:0,onRequest({request:C}){Gu(i,`${C.method} ${C.url}`)},onResponse({response:C}){Gu(i,`→ ${C.status} (${C.headers.get("content-length")??"?"} bytes)`)}})}static fromOptions(D){let{timeoutSec:u,debug:i,fetcher:C,...h}=D,f=LD(h);return new DD(f,{timeoutSec:u,debug:i,fetcher:C})}async get(D,u){let i=D.startsWith("/")?D:`/${D}`;return F0(this.fetchImpl(i,{method:"GET",query:u??void 0}))}async post(D,u){let i=D.startsWith("/")?D:`/${D}`;if(this.debug&&u!==void 0&&u!==null)Gu(this.debug,`body: ${JSON.stringify(u)}`);return F0(this.fetchImpl(i,{method:"POST",body:u===void 0||u===null?void 0:u}))}async postForm(D,u){let i=D.startsWith("/")?D:`/${D}`,C={};for(let[A,$]of Object.entries(u??{}))if($!==void 0&&$!==null)C[A]=String($);if(this.debug)Gu(this.debug,`POST ${i}`),Gu(this.debug,`form: ${JSON.stringify(C)}`);let h=`${this.baseUrl}${i}`,f=new URLSearchParams(C),E=new AbortController,B=this.timeoutMs,s=B===void 0?null:setTimeout(()=>E.abort(),B);try{let A=await fetch(h,{method:"POST",headers:{Authorization:`Bearer ${this.bearerToken}`,"Content-Type":"application/x-www-form-urlencoded"},body:f,signal:E.signal});if(Gu(this.debug,`→ ${A.status} (${A.headers.get("content-length")??"?"} bytes)`),A.ok){if((A.headers.get("content-type")??"").includes("application/json"))return A.json();return A.text()}let $=`HTTP ${A.status}`,R;try{let m=await A.json();$=typeof m.message==="string"?m.message:$,R=m.detail??m.error}catch{}throw new s2(A.status,$,R)}catch(A){if(A instanceof s2)throw A;if(A instanceof Error&&A.name==="AbortError")throw new s2(599,"Request aborted or timed out");throw A}finally{if(s)clearTimeout(s)}}async patch(D,u){let i=D.startsWith("/")?D:`/${D}`;if(this.debug&&u!==void 0&&u!==null)Gu(this.debug,`body: ${JSON.stringify(u)}`);return F0(this.fetchImpl(i,{method:"PATCH",body:u===void 0||u===null?void 0:u}))}async put(D,u){let i=D.startsWith("/")?D:`/${D}`;if(this.debug&&u!==void 0&&u!==null)Gu(this.debug,`body: ${JSON.stringify(u)}`);return F0(this.fetchImpl(i,{method:"PUT",body:u===void 0||u===null?void 0:u}))}async delete(D){let u=D.startsWith("/")?D:`/${D}`;return F0(this.fetchImpl(u,{method:"DELETE"}))}}var k8=!1;function P(D){k8=D}function WE(){return k8}function KE(){return process.stdout.isTTY===!0}function V(D,u){if(k8){process.stdout.write(`${JSON.stringify(D,ar)}
|
|
113
|
+
`);return}if(u){u(D);return}if(D!==null&&typeof D==="object"&&!Array.isArray(D)){HE(D);return}if(Array.isArray(D)){for(let i of D){if(i!==null&&typeof i==="object"&&!Array.isArray(i))HE(i);else process.stdout.write(`${String(i)}
|
|
102
114
|
`);process.stdout.write(`
|
|
103
|
-
`)}return}process.stdout.write(`${
|
|
104
|
-
`)}function
|
|
105
|
-
`)}function
|
|
106
|
-
`);return}let
|
|
107
|
-
`);else if(
|
|
108
|
-
`)}else if(
|
|
109
|
-
`)}else if(
|
|
110
|
-
`)}else if(
|
|
111
|
-
`);else{let
|
|
112
|
-
`)}}function
|
|
113
|
-
\x1B[1m\x1B[32m
|
|
114
|
-
`);else if(
|
|
115
|
-
\x1B[1m\x1B[31m
|
|
116
|
-
`)}else if(
|
|
117
|
-
\x1B[2mdisconnected after ${
|
|
118
|
-
`)}function
|
|
119
|
-
`),
|
|
120
|
-
`);continue}if(
|
|
121
|
-
`),
|
|
122
|
-
`);let
|
|
123
|
-
`);let
|
|
115
|
+
`)}return}process.stdout.write(`${D===void 0?"":String(D)}
|
|
116
|
+
`)}function ar(D,u){if(typeof u==="bigint")return u.toString();return u}function HE(D){for(let[u,i]of Object.entries(D))process.stdout.write(`${u}: ${String(i)}
|
|
117
|
+
`)}function xr(D){let u=new Date(D*1000),i=String(u.getHours()).padStart(2,"0"),C=String(u.getMinutes()).padStart(2,"0"),h=String(u.getSeconds()).padStart(2,"0");return`${i}:${C}:${h}`}function PE(D,u){return D.length>u?`${D.slice(0,u)}...`:D}function qE(D){let u=D.data;if(typeof u!=="object"||u===null){process.stdout.write(`\x1B[2m${String(u)}\x1B[0m
|
|
118
|
+
`);return}let i=D.event_type,C=typeof u.content==="string"?u.content:"",h=xr(D.timestamp);if(i==="assistant"||i==="text"||i==="message")process.stdout.write(`\x1B[2m[${h}]\x1B[0m \x1B[1massistant:\x1B[0m ${C}
|
|
119
|
+
`);else if(i==="tool_call"){let f=(typeof u.name==="string"?u.name:null)??(typeof u.tool_name==="string"?u.tool_name:null)??"?",E=u.arguments??u.args??"";if(typeof E==="string")E=PE(E,80);else E=JSON.stringify(E);process.stdout.write(`\x1B[2m[${h}]\x1B[0m \x1B[33mtool_call:\x1B[0m ${f}(${String(E)})
|
|
120
|
+
`)}else if(i==="tool_result"){let f=u.output??u.result??u.content??"";if(typeof f==="string")f=PE(f,100);else f=JSON.stringify(f);process.stdout.write(`\x1B[2m[${h}]\x1B[0m \x1B[32mtool_result:\x1B[0m ${String(f)}
|
|
121
|
+
`)}else if(i==="status"){let f=typeof u.status==="string"?u.status:"";process.stdout.write(`\x1B[2m[${h}]\x1B[0m \x1B[34mstatus:\x1B[0m ${f}
|
|
122
|
+
`)}else if(i==="error")process.stdout.write(`\x1B[2m[${h}]\x1B[0m \x1B[1m\x1B[31merror:\x1B[0m ${C}
|
|
123
|
+
`);else{let f=JSON.stringify(u).slice(0,120);process.stdout.write(`\x1B[2m[${h}]\x1B[0m \x1B[2m${i}:\x1B[0m ${f}
|
|
124
|
+
`)}}function gE(D){let u=String(D.status??""),i=Number(D.duration_ms??0)/1000,C=D.events_count;if(u==="succeeded")process.stdout.write(`
|
|
125
|
+
\x1B[1m\x1B[32m✓\x1B[0m run completed in ${i.toFixed(1)}s (${C} events)
|
|
126
|
+
`);else if(u==="failed"){let h=String(D.error??"");process.stdout.write(`
|
|
127
|
+
\x1B[1m\x1B[31m✗\x1B[0m run failed in ${i.toFixed(1)}s: ${h}
|
|
128
|
+
`)}else if(u==="disconnected")process.stdout.write(`
|
|
129
|
+
\x1B[2mdisconnected after ${i.toFixed(1)}s (${C} events)\x1B[0m
|
|
130
|
+
`)}function kE(D,u){return D&&!u&&KE()}function er(D){return D.replace(/\/$/,"")}function D5(D,u=!1){let i=D.trim().split(`
|
|
131
|
+
`),C=[];for(let E of i){if(E.startsWith(":")){if(u)process.stderr.write(`[debug] SSE comment: ${E}
|
|
132
|
+
`);continue}if(E.startsWith("data: "))C.push(E.slice(6));else if(E.startsWith("data:"))C.push(E.slice(5))}if(C.length===0)return null;let h=C.join(`
|
|
133
|
+
`),f=Date.now()/1000;try{let E=JSON.parse(h);return{event_type:typeof E==="object"&&E!==null&&"type"in E&&typeof E.type==="string"?E.type:"message",data:E,raw:h,timestamp:f}}catch{return{event_type:"unknown",data:h,raw:h,timestamp:f}}}async function*vE(D){let u=`${er(D.endpoint)}${D.path.startsWith("/")?D.path:`/${D.path}`}`;if(D.debug)process.stderr.write(`[debug] SSE connecting to ${u}
|
|
134
|
+
`);let i=Date.now(),C=D.timeoutSec===void 0||D.timeoutSec===null||D.timeoutSec===0?null:D.timeoutSec*1000,h=await fetch(u,{headers:{Authorization:`Bearer ${D.token}`,Accept:"text/event-stream"},signal:D.signal});if(!h.ok)throw new X(`SSE connection failed: HTTP ${h.status}`,3);if(D.debug)process.stderr.write(`[debug] SSE connected (${h.status})
|
|
135
|
+
`);let f=h.body;if(!f)throw new X("SSE response has no body",3);let E=f.getReader(),B=new TextDecoder,s="";try{for(;;){let{done:A,value:$}=await E.read();if(A)break;s+=B.decode($,{stream:!0});let R;while((R=s.indexOf(`
|
|
124
136
|
|
|
125
|
-
`))!==-1){let
|
|
126
|
-
`)}else process.stdout.write(`${JSON.stringify({ts:
|
|
127
|
-
`);else
|
|
137
|
+
`))!==-1){let m=s.slice(0,R);s=s.slice(R+2);let l=D5(m,D.debug??!1);if(l!==null){if(yield l,C!==null&&Date.now()-i>C)throw new X("Stream timeout",124)}}}}finally{E.releaseLock()}}function u5(D,u,i){if(i&&!i.has(D.event_type))return;if(u)if(typeof D.data==="object"&&D.data!==null){let C={ts:D.timestamp,...D.data};process.stdout.write(`${JSON.stringify(C)}
|
|
138
|
+
`)}else process.stdout.write(`${JSON.stringify({ts:D.timestamp,type:D.event_type,raw:D.data})}
|
|
139
|
+
`);else qE(D)}async function gu(D){let u=Date.now(),i=[],C="unknown",h=null,f=[],E=[],B=D.stream_output??!1,s=D.json_mode??WE(),A=D.event_filter??null,$=D.debug??!1,R=D.eventStream==null,m=R?new AbortController:null,l=()=>{m?.abort()};if(R)process.once("SIGINT",l);let S=`/api/agent-run/${D.agent_run_id}/stream`,y=D.eventStream??vE({endpoint:D.endpoint,path:S,token:D.token,timeoutSec:D.timeout??void 0,debug:$,signal:m?.signal});try{try{for await(let L of y){if(i.push({type:L.event_type,data:L.data}),D.on_event?.(L),B)u5(L,s,A);if(typeof L.data==="object"&&L.data!==null){let{data:v,event_type:Q}=L;if(Q==="status"){let W=typeof v.status==="string"?v.status:"";if(W==="completed"){C="succeeded";break}if(W==="failed"||W==="error"){C="failed",h=(typeof v.content==="string"?v.content:null)??(typeof v.error==="string"?v.error:null)??null;break}}else if(Q==="error"){C="failed",h=(typeof v.content==="string"?v.content:null)??String(L.data);break}else if(Q==="assistant"||Q==="text"||Q==="message"){let W=typeof v.content==="string"?v.content:"";if(W)f.push(W)}else if(Q==="tool_call"||Q==="tool_result")E.push(v)}}}catch(L){if(L!==null&&typeof L==="object"&&L.name==="AbortError"){if(!s)process.stderr.write(`
|
|
128
140
|
\x1B[2mDisconnected from stream (run continues in background)\x1B[0m
|
|
129
|
-
`);
|
|
130
|
-
`,"utf8")}catch{}return
|
|
131
|
-
`,"utf8"),
|
|
132
|
-
Opening browser for login...`),
|
|
133
|
-
`);if(
|
|
141
|
+
`);C="disconnected"}else throw L}}finally{if(R)process.off("SIGINT",l)}let J=Date.now()-u,M={status:C,agent_run_id:D.agent_run_id,duration_ms:J,events_count:i.length};if(f.length>0)M.assistant_message=f.join("");if(E.length>0)M.tool_calls=E;if(h)M.error=h;if(kE(B,s))gE(M);if(C==="failed")throw new X(`Run failed: ${h??"unknown error"}`,1,M);return M}function q(D){return D.optsWithGlobals()}function t2(D){if(!D)return null;let u=D.split(",").map((i)=>i.trim()).filter((i)=>i.length>0);return u.length>0?new Set(u):null}function uD(D){let u=D.timeout??"30",i=Number.parseFloat(u);if(!Number.isFinite(i))return 30;if(i===0)return;return i}function jE(D){D.command("agent").description("Agent operations").command("invoke <thread_id> <prompt>").description("Send a message, start the agent, optional wait/stream").option("--wait","Block until run completes",!1).option("--stream","Stream run events",!1).option("--cancel-on-interrupt","Cancel run on Ctrl-C (reserved)",!1).option("--filter <types>","Comma-separated SSE event types").option("--model <name>","Model override").option("--timeout <sec>","Wait/stream timeout (0 = no limit)","120").action(K(async function(C,h){let f=q(this),E=this.opts();if(P(Boolean(f.json)),E.wait&&E.stream)throw new X("--wait and --stream are mutually exclusive",2);let B=LD({token:f.token,endpoint:f.endpoint,profile:f.profile??"e2e",real:f.real}),s=new DD(B,{debug:f.debug,timeoutSec:uD(f)}),A=await s.post("/api/message/add",{thread_id:C,content:h}),$={};if(E.model)$.model_name=E.model;let m=(await s.postForm(`/api/thread/${C}/agent/start`,$)).agent_run_id??"";if(!E.wait&&!E.stream){V({message:A,agent_run_id:m,status:"started"});return}let l=E.timeout??"120",S=Number.parseFloat(l),y=Number.isFinite(S)&&S===0?null:Number.isFinite(S)?S:120,J=await gu({endpoint:B.endpoint,token:B.token,agent_run_id:m,timeout:y??void 0,stream_output:Boolean(E.stream),json_mode:Boolean(f.json),debug:f.debug,event_filter:t2(E.filter)});if(E.wait&&!E.stream)V(J)}))}import{readFileSync as dE}from"node:fs";qu();import{existsSync as OE,readFileSync as F5,writeFileSync as i5}from"node:fs";function v8(D){let u=D.replace(/([a-z0-9])([A-Z])/g,"$1-$2");return u=u.replace(/[_\s/]+/g,"-"),u=u.replace(/-+/g,"-"),u=u.replace(/^-+|-+$/g,""),u.toLowerCase()}class oE{_spec;_operations=new Map;_byId=new Map;constructor(D){this._spec=D,this.parse()}parse(){let D=this._spec.paths;if(D===null||typeof D!=="object"||Array.isArray(D))return;for(let[u,i]of Object.entries(D)){if(i===null||typeof i!=="object"||Array.isArray(i))continue;let C=i;if("$ref"in C&&Object.keys(C).length===1)continue;for(let h of["get","post","put","patch","delete"]){let f=C[h];if(f===null||typeof f!=="object"||Array.isArray(f))continue;let E=f,B=typeof E.operationId==="string"?E.operationId:"",s=Array.isArray(E.tags)?E.tags:["untagged"],A=typeof s[0]==="string"?s[0]:"untagged",$=v8(A),R=typeof E.summary==="string"?E.summary:"",m=Array.isArray(E.parameters)?E.parameters:[],l=E.requestBody!==null&&typeof E.requestBody==="object"&&!Array.isArray(E.requestBody)?E.requestBody:null,S=B?v8(B):`${h}-${v8(u)}`,y={operation_id:S,tag:$,method:h,path:u,summary:R,parameters:m,request_body:l},J=this._operations.get($)??[];J.push(y),this._operations.set($,J),this._byId.set(S,y)}}}get tags(){return[...this._operations.keys()].sort()}operationsForTag(D){return this._operations.get(D)??[]}getOperation(D){return this._byId.get(D)}get allOperations(){return[...this._byId.values()]}}function j8(D){let u=F5(D,"utf8");try{return JSON.parse(u)}catch{let i=u.trim();if(i.startsWith("openapi:")||i.startsWith("swagger:"))throw new X(`File ${D} appears to be YAML; install a YAML parser or use JSON.`,2);throw new X(`Failed to parse ${D} as JSON`,2)}}async function C5(D,u){let i=`${D.replace(/\/$/,"")}/openapi.json`,C;try{C=await fetch(i,{signal:AbortSignal.timeout(1e4)})}catch(f){throw new X(`Failed to fetch OpenAPI spec from ${i}: ${f}`,3)}if(!C.ok)throw new X(`Failed to fetch OpenAPI spec from ${i}: HTTP ${C.status}`,3);let h=await C.json();try{D0(),i5(u,`${JSON.stringify(h,null,2)}
|
|
142
|
+
`,"utf8")}catch{}return h}async function O8(D={}){let u=process.env.MITSEIN_OPENAPI_PATH;if(u)return j8(u);let i=u0();if(!D.refresh&&OE(i))try{return j8(i)}catch{}if(D.endpoint)return C5(D.endpoint,i);if(OE(i))return j8(i);throw new X("No OpenAPI spec available. Run `mitsein dev openapi --refresh` or set MITSEIN_OPENAPI_PATH.",2)}async function b3(D={}){let u=await O8(D);return new oE(u)}function E5(D){let u={},i=0;while(i<D.length){let C=D[i];if(C===void 0)break;if(C.startsWith("--")){let h=C.replace(/^-+/,""),f=D[i+1];if(f!==void 0&&!f.startsWith("--"))u[h]=f,i+=2;else u[h]="true",i+=1}else i+=1}return u}function h5(D,u){if(u){let i=dE(0,"utf8");try{return JSON.parse(i)}catch(C){throw new X(`Invalid JSON from stdin: ${C}`,2)}}if(D===void 0)return;if(D.startsWith("@")){let i=D.slice(1);try{let C=dE(i,"utf8");return JSON.parse(C)}catch(C){if(C.code==="ENOENT")throw new X(`File not found: ${i}`,2);throw new X(`Invalid JSON in ${i}: ${C}`,2)}}try{return JSON.parse(D)}catch(i){throw new X(`Invalid JSON body: ${i}`,2)}}async function r5(D,u,i,C){let{path:h,method:f}=u,E=[...h.matchAll(/\{(\w+)\}/g)].map((s)=>s[1]??""),B={...C};for(let s of E)if(s in B){let A=B[s];delete B[s],h=h.replace(`{${s}}`,A??"")}else throw new X(`Missing required path parameter: --${s}`,2);if(f==="get"){let s=Object.keys(B).length>0?{...B}:void 0;return D.get(h,s)}if(f==="post")return D.post(h,i);if(f==="patch")return D.patch(h,i);if(f==="put")return D.put(h,i);if(f==="delete")return D.delete(h);throw new X(`Unsupported HTTP method: ${f}`,2)}function f5(D){let u=D;k.log(` \x1B[1m${u.tag??""}\x1B[0m (${u.operations??0} operations)`)}function c5(D){let u=D,i=u.method??"",C=i==="GET"?"\x1B[32m":i==="POST"?"\x1B[34m":i==="PATCH"?"\x1B[33m":i==="DELETE"?"\x1B[31m":"\x1B[37m",h=(u.operation??"").padEnd(30);k.log(` ${C}${i.padEnd(6)}\x1B[0m ${h} ${u.summary??""}`)}function pE(D){let u=D.command("api").description("Auto-generated API commands from OpenAPI spec");u.command("list-tags").description("List all available API tags").option("--endpoint <url>","API base URL").action(K(async function(){let C=q(this),h=this.opts();P(Boolean(C.json));let f=await b3({endpoint:h.endpoint??C.endpoint});for(let E of f.tags){let B=f.operationsForTag(E);V({tag:E,operations:B.length},f5)}})),u.command("list-ops <tag>").description("List operations for a tag").option("--endpoint <url>","API base URL").action(K(async function(C){let h=q(this),f=this.opts();P(Boolean(h.json));let E=await b3({endpoint:f.endpoint??h.endpoint}),B=E.operationsForTag(C);if(B.length===0)throw new X(`Unknown tag '${C}'. Available: ${E.tags.join(", ")}`,2);for(let s of B)V({operation:s.operation_id,method:s.method.toUpperCase(),path:s.path,summary:s.summary},c5)})),u.command("api-call <tag> <operation>").description(`Execute an API operation (examples: mitsein api api-call threads list-threads --body '{"limit":20}')`).allowUnknownOption(!0).allowExcessArguments(!0).option("--body <json>","JSON body: inline or @file.json").option("--body-stdin","Read JSON body from stdin",!1).option("--endpoint <url>","API base URL").option("--token <token>","Bearer token").option("--timeout <sec>","HTTP timeout (0 = none)","30").option("--debug","Print HTTP details",!1).action(K(async function(C,h){let f=q(this),E=this.opts();P(Boolean(f.json));let B=await b3({endpoint:E.endpoint??f.endpoint}),s=B.getOperation(h);if(s===void 0){let J=B.operationsForTag(C);if(J.length===0){let L=B.tags.length>0?B.tags.join(", "):"(none — run `mitsein dev openapi --refresh`)";throw new X(`Unknown tag '${C}'. Available tags: ${L}`,2)}let M=J.map((L)=>L.operation_id).join(", ");throw new X(`Unknown operation '${h}' in tag '${C}'. Available: ${M}`,2)}if(s.tag!==C)throw new X(`Operation '${h}' belongs to tag '${s.tag}', not '${C}'.`,2);let A=h5(E.body,Boolean(E.bodyStdin)),$=E5(this.args.slice(2)),R=E.timeout??f.timeout??"30",m=Number.parseFloat(R),l=Number.isFinite(m)&&m===0?void 0:Number.isFinite(m)?m:30,S=DD.fromOptions({token:E.token??f.token,endpoint:E.endpoint??f.endpoint,profile:f.profile??"e2e",real:f.real,timeoutSec:l,debug:Boolean(E.debug??f.debug)}),y=await r5(S,s,A,$);V(y)}))}import{existsSync as u7,readFileSync as m5,unlinkSync as _5}from"node:fs";qu();import{createServer as $5}from"node:http";import{parse as A5}from"node:querystring";qu();import{execFileSync as o8}from"node:child_process";import{chmodSync as n5,mkdirSync as B5,writeFileSync as s5}from"node:fs";import{dirname as t5}from"node:path";var aE=19284;function S3(D,u,i){D0();let C=Uu(D);B5(t5(C),{recursive:!0,mode:448});let h={access_token:i.access_token??"",user_email:i.user_email??"",user_id:i.user_id??"",endpoint:u,created_at:Date.now()/1000,expires_in:i.expires_in??86400};s5(C,`${JSON.stringify(h,null,2)}
|
|
143
|
+
`,"utf8"),n5(C,384)}function l3(D){try{if(process.platform==="darwin")o8("open",[D],{stdio:"ignore"});else if(process.platform==="win32")o8("cmd",["/c","start","",D],{stdio:"ignore"});else o8("xdg-open",[D],{stdio:"ignore"})}catch{}}function xE(D){return(D??process.env.MITSEIN_API_URL??lu).replace(/\/$/,"")}function $2(D,u){let i=D[u];if(Array.isArray(i))return i[0];return i}async function eE(D,u,i,C){let h={};if(await new Promise((f,E)=>{let B=!1,s,A=()=>{if(B)return;if(B=!0,s!==void 0)clearTimeout(s);$.close(()=>f())},$=$5((R,m)=>{let l=R.url??"",S="";try{S=new URL(l,"http://127.0.0.1").pathname}catch{S=""}if(S!=="/callback"){m.writeHead(404),m.end(),A();return}let y=l.includes("?")?A5(l.split("?",2)[1]??""):{};if(y.error){m.writeHead(200,{"Content-Type":"text/html"});let J=$2(y,"error_description")??$2(y,"error")??"Unknown error";m.end(`<html><body><h2>Login failed</h2><p>${String(J)}</p></body></html>`),h.error=String(J),A();return}if(y.account)h.account=$2(y,"account")??"";if(y.email)h.email=$2(y,"email")??"";if(y.token)h.token=$2(y,"token")??"";if(y.session_id)h.session_id=$2(y,"session_id")??"";m.writeHead(200,{"Content-Type":"text/html"}),m.end("<html><body><h2>Login successful!</h2><p>You can close this window.</p></body></html>"),h.success=!0,A()});$.once("error",(R)=>{if(!B){if(B=!0,s!==void 0)clearTimeout(s);E(R)}}),s=setTimeout(()=>A(),300000),$.listen(aE,"127.0.0.1",()=>{let R=`${D}/api/auth/cognito/login?provider=${encodeURIComponent(u)}`;if(!C)k.log(`
|
|
144
|
+
Opening browser for login...`),k.log(`If browser does not open, visit: ${R}
|
|
145
|
+
`);if(l3(R),!C)k.log("Waiting for browser login...")})}),h.error!==void 0)throw new X(`Login failed: ${String(h.error)}`,1);if(h.success===!0){let f={access_token:String(h.token??""),user_email:String(h.email??""),user_id:String(h.account??"")};S3(i,D,f),V({status:"logged_in",email:f.user_email,profile:i},()=>{k.success(`Logged in as ${f.user_email}`)});return}throw new X("Login timed out. Try again.",124)}async function w5(D){await new Promise((u)=>setTimeout(u,D))}async function D7(D,u,i){let C=await fetch(`${D}/api/auth/cli/device`,{method:"POST",signal:AbortSignal.timeout(1e4)});if(!C.ok)throw new X(`Failed to create device code: HTTP ${C.status}`,3);let h=await C.json(),{device_code:f,user_code:E,verification_url:B,expires_in:s}=h,A=h.interval??5,$=`${B}?user_code=${encodeURIComponent(E)}`;if(!i)k.log(`
|
|
134
146
|
Mitsein CLI Login
|
|
135
|
-
`),
|
|
136
|
-
Logged in as ${
|
|
137
|
-
Poll error: ${
|
|
138
|
-
`);else process.stdout.write(
|
|
139
|
-
`)}function
|
|
140
|
-
`),process.stdout.write(` ${
|
|
141
|
-
`),process.stdout.write(` Cached at: ${
|
|
142
|
-
`)}function
|
|
143
|
-
`);let
|
|
147
|
+
`),k.log("Open this URL in your browser:"),k.log($),k.log(`Or go to ${B} and enter code:`),k.log(E),k.log(`Waiting for authorization (expires in ${Math.floor(s/60)} min)...`);l3($);let R=Date.now()+s*1000;while(Date.now()<R){await w5(A*1000);try{let l=await(await fetch(`${D}/api/auth/cli/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:f,grant_type:"device_code"}),signal:AbortSignal.timeout(1e4)})).json(),S=l.status;if(S==="authorized"){S3(u,D,l),V({status:"logged_in",email:l.user_email??"",profile:u},()=>{k.success(`
|
|
148
|
+
Logged in as ${l.user_email??""}`)});return}if(S==="expired")throw new X("Device code expired. Run `mitsein auth login` again.",1);if(!i)process.stderr.write(".")}catch(m){if(m instanceof X)throw m;if(!i)k.log(`
|
|
149
|
+
Poll error: ${m}, retrying...`)}}throw new X("Login timed out. Run `mitsein auth login` again.",124)}function F7(D){let u=D.command("auth").description("Authentication management");u.command("login").description("Log in (browser callback on localhost, or --device-code)").option("--device-code","Device code flow",!1).option("--provider <name>","OAuth provider: google or msa","google").option("--endpoint <url>","API base URL").option("--profile <name>","Profile to save credentials","default").action(K(async function(){let C=q(this),h=this.opts();P(Boolean(C.json));let f=xE(h.endpoint??C.endpoint);if(h.deviceCode)await D7(f,h.profile??"default",Boolean(C.json));else await eE(f,h.provider??"google",h.profile??"default",Boolean(C.json))})),u.command("logout").description("Remove saved credentials for a profile").option("--profile <name>","Profile","default").action(K(async function(){let C=q(this),h=this.opts();P(Boolean(C.json));let f=h.profile??"default",E=Uu(f);if(u7(E))_5(E),V({status:"logged_out",profile:f},()=>{k.success(`Logged out from profile '${f}'`)});else V({status:"not_logged_in",profile:f},()=>{k.log(`Not logged in (profile '${f}')`)})})),u.command("whoami").description("Show current identity").option("--profile <name>","Profile","default").option("--endpoint <url>","API base URL (display only)").action(K(async function(){let C=q(this),h=this.opts();P(Boolean(C.json)),h.endpoint;let f=h.profile??"default",E=Uu(f);if(!u7(E))throw new X("Not logged in. Run `mitsein auth login`.",2);let B=JSON.parse(m5(E,"utf8"));V({email:B.user_email??"unknown",user_id:B.user_id??"unknown",profile:f,endpoint:B.endpoint??""},(s)=>{let A=s;k.success(`Logged in as ${A.email}`),k.log(` User ID: ${A.user_id}`),k.log(` Profile: ${A.profile}`),k.log(` Endpoint: ${A.endpoint}`)})}))}qu();function R5(D){let u=typeof D==="object"&&D!==null?D:null;if(Boolean(u&&(u.status==="ok"||u.ok===!0)))process.stdout.write(`✓ Backend is healthy
|
|
150
|
+
`);else process.stdout.write(`✗ Backend is unhealthy
|
|
151
|
+
`)}function b5(D){let u=D;process.stdout.write(`✓ ${u.title??""} v${u.version??""}
|
|
152
|
+
`),process.stdout.write(` ${u.paths??0} paths
|
|
153
|
+
`),process.stdout.write(` Cached at: ${u.cached_at??""}
|
|
154
|
+
`)}function i7(D){let u=D.command("dev").description("Development utilities");u.command("token").description("Print the resolved dev token").action(K(async function(){let C=q(this);if(C.real)process.stderr.write(`⚠️ Using --real: this token accesses real data, not e2e sandbox.
|
|
155
|
+
`);let h=LD({token:C.token,endpoint:C.endpoint,profile:C.profile??"e2e",real:C.real});V(h.token)})),u.command("health").description("Check backend health (GET /health)").action(K(async function(){let C=q(this),h=C.endpoint??(await Promise.resolve().then(() => (qu(),ZE))).DEFAULT_ENDPOINT,{ofetch:f}=await Promise.resolve().then(() => (P8(),XE)),E=uD(C),B=await f("/health",{baseURL:h.replace(/\/$/,""),timeout:E?E*1000:void 0,retry:0});V(B,R5)})),u.command("openapi").description("Fetch and cache OpenAPI spec from backend").option("--refresh","Force re-fetch from backend",!1).action(K(async function(){let C=q(this),h=this.opts();P(Boolean(C.json));let f=await O8({endpoint:C.endpoint,refresh:Boolean(h.refresh)}),E=u0(),B=f.paths,s=B!==null&&typeof B==="object"&&!Array.isArray(B)?Object.keys(B).length:0,A=f.info??{};V({title:String(A.title??""),version:String(A.version??""),paths:s,cached_at:E},b5)}))}function C7(D){let u=D.command("messages").description("Message list and send (no agent)");u.command("list <thread_id>").description("List messages for a thread").option("--offset <n>","Pagination offset","0").option("--limit <n>","Max results","20").action(K(async function(C){let h=q(this),f=this.opts();P(Boolean(h.json));let E=DD.fromOptions({token:h.token,endpoint:h.endpoint,profile:h.profile??"e2e",real:h.real,timeoutSec:uD(h),debug:h.debug}),B=Number.parseInt(String(f.offset??"0"),10),s=Number.parseInt(String(f.limit??"20"),10),A=await E.post("/api/message/list",{thread_id:C,limit:Number.isFinite(s)?s:20,offset:Number.isFinite(B)?B:0});V(A)})),u.command("send <thread_id> <content>").description("Add a user message (does not start the agent)").action(K(async function(C,h){let f=q(this);P(Boolean(f.json));let B=await DD.fromOptions({token:f.token,endpoint:f.endpoint,profile:f.profile??"e2e",real:f.real,timeoutSec:uD(f),debug:f.debug}).post("/api/message/add",{thread_id:C,content:h});V(B)}))}function E7(D){let u=D.command("project").description("Project management");u.command("list").description("List projects").option("--offset <n>","Pagination offset","0").option("--limit <n>","Max results","20").action(K(async function(){let C=q(this),h=this.opts();P(Boolean(C.json));let f=DD.fromOptions({token:C.token,endpoint:C.endpoint,profile:C.profile??"e2e",real:C.real,timeoutSec:uD(C),debug:C.debug}),E=Number.parseInt(String(h.offset??"0"),10),B=Number.parseInt(String(h.limit??"20"),10),s=await f.post("/api/project/list",{offset:Number.isFinite(E)?E:0,limit:Number.isFinite(B)?B:20});V(s)})),u.command("get <project_id>").description("Get project details").action(K(async function(C){let h=q(this);P(Boolean(h.json));let E=await DD.fromOptions({token:h.token,endpoint:h.endpoint,profile:h.profile??"e2e",real:h.real,timeoutSec:uD(h),debug:h.debug}).post("/api/project/get",{project_id:C});V(E)})),u.command("delete <project_id>").description("Delete a project").action(K(async function(C){let h=q(this);P(Boolean(h.json));let E=await DD.fromOptions({token:h.token,endpoint:h.endpoint,profile:h.profile??"e2e",real:h.real,timeoutSec:uD(h),debug:h.debug}).post("/api/project/delete",{project_id:C});V(E)}))}function h7(D){let u=D.command("run").description("Agent run management");u.command("list <thread_id>").description("List agent runs for a thread").action(K(async function(C){let h=q(this);P(Boolean(h.json));let E=await DD.fromOptions({token:h.token,endpoint:h.endpoint,profile:h.profile??"e2e",real:h.real,timeoutSec:uD(h),debug:h.debug}).post(`/api/thread/${C}/agent-runs`);V(E)})),u.command("get <run_id>").description("Get agent run status").action(K(async function(C){let h=q(this);P(Boolean(h.json));let E=await DD.fromOptions({token:h.token,endpoint:h.endpoint,profile:h.profile??"e2e",real:h.real,timeoutSec:uD(h),debug:h.debug}).post(`/api/agent-run/${C}`);V(E)})),u.command("tail <run_id>").description("Stream agent run events (tail -f)").option("--filter <types>","Comma-separated event types").option("--timeout <sec>","Timeout (0 = no limit)","120").action(K(async function(C){let h=q(this),f=this.opts();P(Boolean(h.json));let E=LD({token:h.token,endpoint:h.endpoint,profile:h.profile??"e2e",real:h.real}),B=f.timeout??"120",s=Number.parseFloat(B),A=Number.isFinite(s)&&s===0?null:Number.isFinite(s)?s:120;await gu({endpoint:E.endpoint,token:E.token,agent_run_id:C,timeout:A??void 0,stream_output:!0,json_mode:Boolean(h.json),debug:h.debug,event_filter:t2(f.filter)})})),u.command("wait <run_id>").description("Block until agent run completes").option("--timeout <sec>","Timeout (0 = no limit)","120").action(K(async function(C){let h=q(this),f=this.opts();P(Boolean(h.json));let E=LD({token:h.token,endpoint:h.endpoint,profile:h.profile??"e2e",real:h.real}),B=f.timeout??"120",s=Number.parseFloat(B),A=Number.isFinite(s)&&s===0?null:Number.isFinite(s)?s:120,$=await gu({endpoint:E.endpoint,token:E.token,agent_run_id:C,timeout:A??void 0,stream_output:!1,json_mode:Boolean(h.json),debug:h.debug});V($)})),u.command("cancel <run_id>").description("Cancel a running agent").action(K(async function(C){let h=q(this);P(Boolean(h.json));let E=await DD.fromOptions({token:h.token,endpoint:h.endpoint,profile:h.profile??"e2e",real:h.real,timeoutSec:uD(h),debug:h.debug}).post(`/api/agent-run/${C}/stop`);V(E)}))}function r7(D){let u=D.command("thread").description("Thread management and messaging");u.command("list").description("List threads").option("--offset <n>","Pagination offset","0").option("--limit <n>","Max results","20").action(K(async function(){let C=q(this);P(Boolean(C.json));let h=DD.fromOptions({token:C.token,endpoint:C.endpoint,profile:C.profile??"e2e",real:C.real,timeoutSec:uD(C),debug:C.debug}),f=Number.parseInt(String(this.opts().offset??"0"),10),E=Number.parseInt(String(this.opts().limit??"20"),10),B=await h.post("/api/thread/list",{offset:Number.isFinite(f)?f:0,limit:Number.isFinite(E)?E:20});V(B)})),u.command("get <thread_id>").description("Get thread details").action(K(async function(C){let h=q(this);P(Boolean(h.json));let E=await DD.fromOptions({token:h.token,endpoint:h.endpoint,profile:h.profile??"e2e",real:h.real,timeoutSec:uD(h),debug:h.debug}).post("/api/thread/get",{thread_id:C});V(E)})),u.command("create").description("Create a new thread").option("--title <title>","Thread title","").action(K(async function(){let C=q(this),{title:h}=this.opts();P(Boolean(C.json));let E=await DD.fromOptions({token:C.token,endpoint:C.endpoint,profile:C.profile??"e2e",real:C.real,timeoutSec:uD(C),debug:C.debug}).post("/api/thread/create",{title:h??""});V(E)})),u.command("history <thread_id>").description("Show message history for a thread").option("--limit <n>","Max messages","50").action(K(async function(C){let h=q(this),{limit:f}=this.opts();P(Boolean(h.json));let E=DD.fromOptions({token:h.token,endpoint:h.endpoint,profile:h.profile??"e2e",real:h.real,timeoutSec:uD(h),debug:h.debug}),B=Number.parseInt(String(f??"50"),10),s=await E.post("/api/message/list",{thread_id:C,limit:Number.isFinite(B)?B:50});V(s)})),u.command("send <thread_id> <message>").description("Send a message and start an agent run").option("--wait","Block until run completes",!1).option("--stream","Stream run events",!1).option("--cancel-on-interrupt","Cancel run on Ctrl-C (reserved)",!1).option("--filter <types>","Comma-separated SSE event types").option("--agent <name>","Agent name (reserved)","").option("--model <name>","Model override").option("--timeout <sec>","Wait/stream timeout (0 = no limit)","120").action(K(async function(C,h){let f=q(this),E=this.opts();if(P(Boolean(f.json)),E.wait&&E.stream)throw new X("--wait and --stream are mutually exclusive",2);let B=LD({token:f.token,endpoint:f.endpoint,profile:f.profile??"e2e",real:f.real}),s=new DD(B,{debug:f.debug,timeoutSec:uD(f)}),A=await s.post("/api/message/add",{thread_id:C,content:h}),$={};if(E.model)$.model_name=E.model;let m=(await s.postForm(`/api/thread/${C}/agent/start`,$)).agent_run_id??"";if(!E.wait&&!E.stream){V({message:A,agent_run_id:m,status:"started"});return}let l=E.timeout??"120",S=Number.parseFloat(l),y=Number.isFinite(S)&&S===0?null:Number.isFinite(S)?S:120,J=await gu({endpoint:B.endpoint,token:B.token,agent_run_id:m,timeout:y??void 0,stream_output:Boolean(E.stream),json_mode:Boolean(f.json),debug:f.debug,event_filter:t2(E.filter)});if(E.wait&&!E.stream)V(J)}))}import{readFileSync as S5}from"node:fs";import{dirname as l5,join as U5}from"node:path";import{fileURLToPath as G5}from"node:url";function T5(){let D=l5(G5(import.meta.url)),u=U5(D,"..","..","package.json");try{return JSON.parse(S5(u,"utf8")).version??"0.1.0-dev"}catch{return"0.1.0-dev"}}function f7(){V(T5())}var XD=new Si;XD.name("mitsein").description("Mitsein CLI — internal dev tool for agent verification and workflow automation.").option("--endpoint <url>","API endpoint URL").option("--token <token>","Bearer token").option("--profile <name>","Profile name","e2e").option("--real","Use real account for dev token",!1).option("--json","Output structured JSON",!1).option("--debug","Print HTTP request/response details",!1).option("--timeout <sec>","HTTP timeout in seconds (0 = no timeout)","30").hook("preAction",(D,u)=>{let C=(u??D).optsWithGlobals();P(Boolean(C.json))});XD.command("version").description("Print CLI version").action(()=>{f7()});i7(XD);pE(XD);r7(XD);h7(XD);C7(XD);jE(XD);E7(XD);F7(XD);try{await XD.parseAsync(process.argv,{from:"node"})}catch(D){if(D instanceof X){if(k.error(`Error: ${D.message}`),D.detail!=null&&D.detail!=="")k.error(String(D.detail));process.exit(D.code)}k.error(D),process.exit(1)}
|