@mitsein-ai/cli 0.1.0 → 0.1.1

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 CHANGED
@@ -1,143 +1,155 @@
1
- #!/usr/bin/env bun
2
- // @bun
3
- var Fi=Object.create;var{getPrototypeOf:ei,defineProperty:Mu,getOwnPropertyNames:si}=Object;var Ci=Object.prototype.hasOwnProperty;function fi(u){return this[u]}var Ei,hi,ci=(u,D,t)=>{var r=u!=null&&typeof u==="object";if(r){var n=D?Ei??=new WeakMap:hi??=new WeakMap,F=n.get(u);if(F)return F}t=u!=null?Fi(ei(u)):{};let i=D||!u||!u.__esModule?Mu(t,"default",{value:u,enumerable:!0}):t;for(let e of si(u))if(!Ci.call(i,e))Mu(i,e,{get:fi.bind(u,e),enumerable:!0});if(r)n.set(u,i);return i};var O=(u,D)=>()=>(D||u((D={exports:{}}).exports,D),D.exports);var Bi=(u)=>u;function oi(u,D){this[u]=Bi.bind(null,D)}var li=(u,D)=>{for(var t in D)Mu(u,t,{get:D[t],enumerable:!0,configurable:!0,set:oi.bind(D,t)})};var $i=(u,D)=>()=>(u&&(D=u(u=0)),D);var Fu=import.meta.require;var eu=O((Ai)=>{class gu extends Error{constructor(u,D,t){super(t);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=D,this.exitCode=u,this.nestedError=void 0}}class lD extends gu{constructor(u){super(1,"commander.invalidArgument",u);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Ai.CommanderError=gu;Ai.InvalidArgumentError=lD});var cu=O((Ri)=>{var{InvalidArgumentError:mi}=eu();class $D{constructor(u,D){switch(this.description=D||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,u[0]){case"<":this.required=!0,this._name=u.slice(1,-1);break;case"[":this.required=!1,this._name=u.slice(1,-1);break;default:this.required=!0,this._name=u;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(u,D){if(D===this.defaultValue||!Array.isArray(D))return[u];return D.concat(u)}default(u,D){return this.defaultValue=u,this.defaultValueDescription=D,this}argParser(u){return this.parseArg=u,this}choices(u){return this.argChoices=u.slice(),this.parseArg=(D,t)=>{if(!this.argChoices.includes(D))throw new mi(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(D,t);return D},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function bi(u){let D=u.name()+(u.variadic===!0?"...":"");return u.required?"<"+D+">":"["+D+"]"}Ri.Argument=$D;Ri.humanReadableArgName=bi});var Lu=O((Ui)=>{var{humanReadableArgName:yi}=cu();class AD{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(u){this.helpWidth=this.helpWidth??u.helpWidth??80}visibleCommands(u){let D=u.commands.filter((r)=>!r._hidden),t=u._getHelpCommand();if(t&&!t._hidden)D.push(t);if(this.sortSubcommands)D.sort((r,n)=>{return r.name().localeCompare(n.name())});return D}compareOptions(u,D){let t=(r)=>{return r.short?r.short.replace(/^-/,""):r.long.replace(/^--/,"")};return t(u).localeCompare(t(D))}visibleOptions(u){let D=u.options.filter((r)=>!r.hidden),t=u._getHelpOption();if(t&&!t.hidden){let r=t.short&&u._findOption(t.short),n=t.long&&u._findOption(t.long);if(!r&&!n)D.push(t);else if(t.long&&!n)D.push(u.createOption(t.long,t.description));else if(t.short&&!r)D.push(u.createOption(t.short,t.description))}if(this.sortOptions)D.sort(this.compareOptions);return D}visibleGlobalOptions(u){if(!this.showGlobalOptions)return[];let D=[];for(let t=u.parent;t;t=t.parent){let r=t.options.filter((n)=>!n.hidden);D.push(...r)}if(this.sortOptions)D.sort(this.compareOptions);return D}visibleArguments(u){if(u._argsDescription)u.registeredArguments.forEach((D)=>{D.description=D.description||u._argsDescription[D.name()]||""});if(u.registeredArguments.find((D)=>D.description))return u.registeredArguments;return[]}subcommandTerm(u){let D=u.registeredArguments.map((t)=>yi(t)).join(" ");return u._name+(u._aliases[0]?"|"+u._aliases[0]:"")+(u.options.length?" [options]":"")+(D?" "+D:"")}optionTerm(u){return u.flags}argumentTerm(u){return u.name()}longestSubcommandTermLength(u,D){return D.visibleCommands(u).reduce((t,r)=>{return Math.max(t,this.displayWidth(D.styleSubcommandTerm(D.subcommandTerm(r))))},0)}longestOptionTermLength(u,D){return D.visibleOptions(u).reduce((t,r)=>{return Math.max(t,this.displayWidth(D.styleOptionTerm(D.optionTerm(r))))},0)}longestGlobalOptionTermLength(u,D){return D.visibleGlobalOptions(u).reduce((t,r)=>{return Math.max(t,this.displayWidth(D.styleOptionTerm(D.optionTerm(r))))},0)}longestArgumentTermLength(u,D){return D.visibleArguments(u).reduce((t,r)=>{return Math.max(t,this.displayWidth(D.styleArgumentTerm(D.argumentTerm(r))))},0)}commandUsage(u){let D=u._name;if(u._aliases[0])D=D+"|"+u._aliases[0];let t="";for(let r=u.parent;r;r=r.parent)t=r.name()+" "+t;return t+D+" "+u.usage()}commandDescription(u){return u.description()}subcommandDescription(u){return u.summary()||u.description()}optionDescription(u){let D=[];if(u.argChoices)D.push(`choices: ${u.argChoices.map((t)=>JSON.stringify(t)).join(", ")}`);if(u.defaultValue!==void 0){if(u.required||u.optional||u.isBoolean()&&typeof u.defaultValue==="boolean")D.push(`default: ${u.defaultValueDescription||JSON.stringify(u.defaultValue)}`)}if(u.presetArg!==void 0&&u.optional)D.push(`preset: ${JSON.stringify(u.presetArg)}`);if(u.envVar!==void 0)D.push(`env: ${u.envVar}`);if(D.length>0)return`${u.description} (${D.join(", ")})`;return u.description}argumentDescription(u){let D=[];if(u.argChoices)D.push(`choices: ${u.argChoices.map((t)=>JSON.stringify(t)).join(", ")}`);if(u.defaultValue!==void 0)D.push(`default: ${u.defaultValueDescription||JSON.stringify(u.defaultValue)}`);if(D.length>0){let t=`(${D.join(", ")})`;if(u.description)return`${u.description} ${t}`;return t}return u.description}formatHelp(u,D){let t=D.padWidth(u,D),r=D.helpWidth??80;function n(C,E){return D.formatItem(C,t,E,D)}let F=[`${D.styleTitle("Usage:")} ${D.styleUsage(D.commandUsage(u))}`,""],i=D.commandDescription(u);if(i.length>0)F=F.concat([D.boxWrap(D.styleCommandDescription(i),r),""]);let e=D.visibleArguments(u).map((C)=>{return n(D.styleArgumentTerm(D.argumentTerm(C)),D.styleArgumentDescription(D.argumentDescription(C)))});if(e.length>0)F=F.concat([D.styleTitle("Arguments:"),...e,""]);let s=D.visibleOptions(u).map((C)=>{return n(D.styleOptionTerm(D.optionTerm(C)),D.styleOptionDescription(D.optionDescription(C)))});if(s.length>0)F=F.concat([D.styleTitle("Options:"),...s,""]);if(D.showGlobalOptions){let C=D.visibleGlobalOptions(u).map((E)=>{return n(D.styleOptionTerm(D.optionTerm(E)),D.styleOptionDescription(D.optionDescription(E)))});if(C.length>0)F=F.concat([D.styleTitle("Global Options:"),...C,""])}let f=D.visibleCommands(u).map((C)=>{return n(D.styleSubcommandTerm(D.subcommandTerm(C)),D.styleSubcommandDescription(D.subcommandDescription(C)))});if(f.length>0)F=F.concat([D.styleTitle("Commands:"),...f,""]);return F.join(`
4
- `)}displayWidth(u){return wD(u).length}styleTitle(u){return u}styleUsage(u){return u.split(" ").map((D)=>{if(D==="[options]")return this.styleOptionText(D);if(D==="[command]")return this.styleSubcommandText(D);if(D[0]==="["||D[0]==="<")return this.styleArgumentText(D);return this.styleCommandText(D)}).join(" ")}styleCommandDescription(u){return this.styleDescriptionText(u)}styleOptionDescription(u){return this.styleDescriptionText(u)}styleSubcommandDescription(u){return this.styleDescriptionText(u)}styleArgumentDescription(u){return this.styleDescriptionText(u)}styleDescriptionText(u){return u}styleOptionTerm(u){return this.styleOptionText(u)}styleSubcommandTerm(u){return u.split(" ").map((D)=>{if(D==="[options]")return this.styleOptionText(D);if(D[0]==="["||D[0]==="<")return this.styleArgumentText(D);return this.styleSubcommandText(D)}).join(" ")}styleArgumentTerm(u){return this.styleArgumentText(u)}styleOptionText(u){return u}styleArgumentText(u){return u}styleSubcommandText(u){return u}styleCommandText(u){return u}padWidth(u,D){return Math.max(D.longestOptionTermLength(u,D),D.longestGlobalOptionTermLength(u,D),D.longestSubcommandTermLength(u,D),D.longestArgumentTermLength(u,D))}preformatted(u){return/\n[^\S\r\n]/.test(u)}formatItem(u,D,t,r){let F=" ".repeat(2);if(!t)return F+u;let i=u.padEnd(D+u.length-r.displayWidth(u)),e=2,f=(this.helpWidth??80)-D-e-2,C;if(f<this.minWidthToWrap||r.preformatted(t))C=t;else C=r.boxWrap(t,f).replace(/\n/g,`
5
- `+" ".repeat(D+e));return F+i+" ".repeat(e)+C.replace(/\n/g,`
6
- ${F}`)}boxWrap(u,D){if(D<this.minWidthToWrap)return u;let t=u.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,n=[];return t.forEach((F)=>{let i=F.match(r);if(i===null){n.push("");return}let e=[i.shift()],s=this.displayWidth(e[0]);i.forEach((f)=>{let C=this.displayWidth(f);if(s+C<=D){e.push(f),s+=C;return}n.push(e.join(""));let E=f.trimStart();e=[E],s=this.displayWidth(E)}),n.push(e.join(""))}),n.join(`
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 BE}from"node:module";var uE=Object.create;var{getPrototypeOf:FE,defineProperty:ZF,getOwnPropertyNames:iE}=Object;var CE=Object.prototype.hasOwnProperty;function EE(D){return this[D]}var hE,rE,fE=(D,u,i)=>{var C=D!=null&&typeof D==="object";if(C){var h=u?hE??=new WeakMap:rE??=new WeakMap,f=h.get(D);if(f)return f}i=D!=null?uE(FE(D)):{};let E=u||!D||!D.__esModule?ZF(i,"default",{value:D,enumerable:!0}):i;for(let B of iE(D))if(!CE.call(E,B))ZF(E,B,{get:EE.bind(D,B),enumerable:!0});if(C)h.set(D,E);return E};var Qu=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var cE=(D)=>D;function nE(D,u){this[D]=cE.bind(null,u)}var x6=(D,u)=>{for(var i in u)ZF(D,i,{get:u[i],enumerable:!0,configurable:!0,set:nE.bind(u,i)})};var X0=(D,u)=>()=>(D&&(u=D(D=0)),u);var zD=BE(import.meta.url);var H2=Qu((sE)=>{class zF 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 e6 extends zF{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}sE.CommanderError=zF;sE.InvalidArgumentError=e6});var Y0=Qu((mE)=>{var{InvalidArgumentError:AE}=H2();class Di{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 AE(`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 wE(D){let u=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+u+">":"["+u+"]"}mE.Argument=Di;mE.humanReadableArgName=wE});var VF=Qu((SE)=>{var{humanReadableArgName:bE}=Y0();class ui{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)=>bE(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 Fi(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 Fi(D){let u=/\x1b\[\d*(;\d*)*m/g;return D.replace(u,"")}SE.Help=ui;SE.stripColor=Fi});var HF=Qu((TE)=>{var{InvalidArgumentError:UE}=H2();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=IE(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 UE(`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 ii(this.name().replace(/^no-/,""));return ii(this.name())}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class Ei{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 ii(D){return D.split("-").reduce((u,i)=>{return u+i[0].toUpperCase()+i.slice(1)})}function IE(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(r.test(i))throw Error(`${e}
11
- - too many short flags`);if(n.test(i))throw Error(`${e}
12
- - too many long flags`);throw Error(`${e}
13
- - unrecognised flag format`)}if(D===void 0&&t===void 0)throw Error(`option creation failed due to no flags found in '${u}'.`);return{shortFlag:D,longFlag:t}}Mi.Option=mD;Mi.DualOptions=bD});var RD=O((Wi)=>{function Pi(u,D){if(Math.abs(u.length-D.length)>3)return Math.max(u.length,D.length);let t=[];for(let r=0;r<=u.length;r++)t[r]=[r];for(let r=0;r<=D.length;r++)t[0][r]=r;for(let r=1;r<=D.length;r++)for(let n=1;n<=u.length;n++){let F=1;if(u[n-1]===D[r-1])F=0;else F=1;if(t[n][r]=Math.min(t[n-1][r]+1,t[n][r-1]+1,t[n-1][r-1]+F),n>1&&r>1&&u[n-1]===D[r-2]&&u[n-2]===D[r-1])t[n][r]=Math.min(t[n][r],t[n-2][r-2]+1)}return t[u.length][D.length]}function Qi(u,D){if(!D||D.length===0)return"";D=Array.from(new Set(D));let t=u.startsWith("--");if(t)u=u.slice(2),D=D.map((i)=>i.slice(2));let r=[],n=3,F=0.4;if(D.forEach((i)=>{if(i.length<=1)return;let e=Pi(u,i),s=Math.max(u.length,i.length);if((s-e)/s>F){if(e<n)n=e,r=[i];else if(e===n)r.push(i)}}),r.sort((i,e)=>i.localeCompare(e)),t)r=r.map((i)=>`--${i}`);if(r.length>1)return`
14
- (Did you mean one of ${r.join(", ")}?)`;if(r.length===1)return`
15
- (Did you mean ${r[0]}?)`;return""}Wi.suggestSimilar=Qi});var UD=O((Vi)=>{var Yi=Fu("events").EventEmitter,Qu=Fu("child_process"),a=Fu("path"),Bu=Fu("fs"),b=Fu("process"),{Argument:qi,humanReadableArgName:Zi}=cu(),{CommanderError:Wu}=eu(),{Help:ai,stripColor:Xi}=Lu(),{Option:SD,DualOptions:Hi}=Pu(),{suggestSimilar:TD}=RD();class Yu extends Yi{constructor(u){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=u||"",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:(D)=>b.stdout.write(D),writeErr:(D)=>b.stderr.write(D),outputError:(D,t)=>t(D),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>zu()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>zu()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:(D)=>Xi(D)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(u){return this._outputConfiguration=u._outputConfiguration,this._helpOption=u._helpOption,this._helpCommand=u._helpCommand,this._helpConfiguration=u._helpConfiguration,this._exitCallback=u._exitCallback,this._storeOptionsAsProperties=u._storeOptionsAsProperties,this._combineFlagAndOptionalValue=u._combineFlagAndOptionalValue,this._allowExcessArguments=u._allowExcessArguments,this._enablePositionalOptions=u._enablePositionalOptions,this._showHelpAfterError=u._showHelpAfterError,this._showSuggestionAfterError=u._showSuggestionAfterError,this}_getCommandAndAncestors(){let u=[];for(let D=this;D;D=D.parent)u.push(D);return u}command(u,D,t){let r=D,n=t;if(typeof r==="object"&&r!==null)n=r,r=null;n=n||{};let[,F,i]=u.match(/([^ ]+) *(.*)/),e=this.createCommand(F);if(r)e.description(r),e._executableHandler=!0;if(n.isDefault)this._defaultCommandName=e._name;if(e._hidden=!!(n.noHelp||n.hidden),e._executableFile=n.executableFile||null,i)e.arguments(i);if(this._registerCommand(e),e.parent=this,e.copyInheritedSettings(this),r)return this;return e}createCommand(u){return new Yu(u)}createHelp(){return Object.assign(new ai,this.configureHelp())}configureHelp(u){if(u===void 0)return this._helpConfiguration;return this._helpConfiguration=u,this}configureOutput(u){if(u===void 0)return this._outputConfiguration;return Object.assign(this._outputConfiguration,u),this}showHelpAfterError(u=!0){if(typeof u!=="string")u=!!u;return this._showHelpAfterError=u,this}showSuggestionAfterError(u=!0){return this._showSuggestionAfterError=!!u,this}addCommand(u,D){if(!u._name)throw Error(`Command passed to .addCommand() must have a name
16
- - specify the name in Command constructor or using .name()`);if(D=D||{},D.isDefault)this._defaultCommandName=u._name;if(D.noHelp||D.hidden)u._hidden=!0;return this._registerCommand(u),u.parent=this,u._checkForBrokenPassThrough(),this}createArgument(u,D){return new qi(u,D)}argument(u,D,t,r){let n=this.createArgument(u,D);if(typeof t==="function")n.default(r).argParser(t);else n.default(t);return this.addArgument(n),this}arguments(u){return u.trim().split(/ +/).forEach((D)=>{this.argument(D)}),this}addArgument(u){let D=this.registeredArguments.slice(-1)[0];if(D&&D.variadic)throw Error(`only the last argument can be variadic '${D.name()}'`);if(u.required&&u.defaultValue!==void 0&&u.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${u.name()}'`);return this.registeredArguments.push(u),this}helpCommand(u,D){if(typeof u==="boolean")return this._addImplicitHelpCommand=u,this;u=u??"help [command]";let[,t,r]=u.match(/([^ ]+) *(.*)/),n=D??"display help for command",F=this.createCommand(t);if(F.helpOption(!1),r)F.arguments(r);if(n)F.description(n);return this._addImplicitHelpCommand=!0,this._helpCommand=F,this}addHelpCommand(u,D){if(typeof u!=="object")return this.helpCommand(u,D),this;return this._addImplicitHelpCommand=!0,this._helpCommand=u,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(u,D){let t=["preSubcommand","preAction","postAction"];if(!t.includes(u))throw Error(`Unexpected value for event passed to hook : '${u}'.
17
- Expecting one of '${t.join("', '")}'`);if(this._lifeCycleHooks[u])this._lifeCycleHooks[u].push(D);else this._lifeCycleHooks[u]=[D];return this}exitOverride(u){if(u)this._exitCallback=u;else this._exitCallback=(D)=>{if(D.code!=="commander.executeSubCommandAsync")throw D};return this}_exit(u,D,t){if(this._exitCallback)this._exitCallback(new Wu(u,D,t));b.exit(u)}action(u){let D=(t)=>{let r=this.registeredArguments.length,n=t.slice(0,r);if(this._storeOptionsAsProperties)n[r]=this;else n[r]=this.opts();return n.push(this),u.apply(this,n)};return this._actionHandler=D,this}createOption(u,D){return new SD(u,D)}_callParseArg(u,D,t,r){try{return u.parseArg(D,t)}catch(n){if(n.code==="commander.invalidArgument"){let F=`${r} ${n.message}`;this.error(F,{exitCode:n.exitCode,code:n.code})}throw n}}_registerOption(u){let D=u.short&&this._findOption(u.short)||u.long&&this._findOption(u.long);if(D){let t=u.long&&this._findOption(u.long)?u.long:u.short;throw Error(`Cannot add option '${u.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${t}'
18
- - already used by option '${D.flags}'`)}this.options.push(u)}_registerCommand(u){let D=(r)=>{return[r.name()].concat(r.aliases())},t=D(u).find((r)=>this._findCommand(r));if(t){let r=D(this._findCommand(t)).join("|"),n=D(u).join("|");throw Error(`cannot add command '${n}' as already have command '${r}'`)}this.commands.push(u)}addOption(u){this._registerOption(u);let D=u.name(),t=u.attributeName();if(u.negate){let n=u.long.replace(/^--no-/,"--");if(!this._findOption(n))this.setOptionValueWithSource(t,u.defaultValue===void 0?!0:u.defaultValue,"default")}else if(u.defaultValue!==void 0)this.setOptionValueWithSource(t,u.defaultValue,"default");let r=(n,F,i)=>{if(n==null&&u.presetArg!==void 0)n=u.presetArg;let e=this.getOptionValue(t);if(n!==null&&u.parseArg)n=this._callParseArg(u,n,e,F);else if(n!==null&&u.variadic)n=u._concatValue(n,e);if(n==null)if(u.negate)n=!1;else if(u.isBoolean()||u.optional)n=!0;else n="";this.setOptionValueWithSource(t,n,i)};if(this.on("option:"+D,(n)=>{let F=`error: option '${u.flags}' argument '${n}' is invalid.`;r(n,F,"cli")}),u.envVar)this.on("optionEnv:"+D,(n)=>{let F=`error: option '${u.flags}' value '${n}' from env '${u.envVar}' is invalid.`;r(n,F,"env")});return this}_optionEx(u,D,t,r,n){if(typeof D==="object"&&D instanceof SD)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let F=this.createOption(D,t);if(F.makeOptionMandatory(!!u.mandatory),typeof r==="function")F.default(n).argParser(r);else if(r instanceof RegExp){let i=r;r=(e,s)=>{let f=i.exec(e);return f?f[0]:s},F.default(n).argParser(r)}else F.default(r);return this.addOption(F)}option(u,D,t,r){return this._optionEx({},u,D,t,r)}requiredOption(u,D,t,r){return this._optionEx({mandatory:!0},u,D,t,r)}combineFlagAndOptionalValue(u=!0){return this._combineFlagAndOptionalValue=!!u,this}allowUnknownOption(u=!0){return this._allowUnknownOption=!!u,this}allowExcessArguments(u=!0){return this._allowExcessArguments=!!u,this}enablePositionalOptions(u=!0){return this._enablePositionalOptions=!!u,this}passThroughOptions(u=!0){return this._passThroughOptions=!!u,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(u=!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=!!u,this}getOptionValue(u){if(this._storeOptionsAsProperties)return this[u];return this._optionValues[u]}setOptionValue(u,D){return this.setOptionValueWithSource(u,D,void 0)}setOptionValueWithSource(u,D,t){if(this._storeOptionsAsProperties)this[u]=D;else this._optionValues[u]=D;return this._optionValueSources[u]=t,this}getOptionValueSource(u){return this._optionValueSources[u]}getOptionValueSourceWithGlobals(u){let D;return this._getCommandAndAncestors().forEach((t)=>{if(t.getOptionValueSource(u)!==void 0)D=t.getOptionValueSource(u)}),D}_prepareUserArgs(u,D){if(u!==void 0&&!Array.isArray(u))throw Error("first parameter to parse must be array or undefined");if(D=D||{},u===void 0&&D.from===void 0){if(b.versions?.electron)D.from="electron";let r=b.execArgv??[];if(r.includes("-e")||r.includes("--eval")||r.includes("-p")||r.includes("--print"))D.from="eval"}if(u===void 0)u=b.argv;this.rawArgs=u.slice();let t;switch(D.from){case void 0:case"node":this._scriptPath=u[1],t=u.slice(2);break;case"electron":if(b.defaultApp)this._scriptPath=u[1],t=u.slice(2);else t=u.slice(1);break;case"user":t=u.slice(0);break;case"eval":t=u.slice(1);break;default:throw Error(`unexpected parse option { from: '${D.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",t}parse(u,D){this._prepareForParse();let t=this._prepareUserArgs(u,D);return this._parseCommand([],t),this}async parseAsync(u,D){this._prepareForParse();let t=this._prepareUserArgs(u,D);return await this._parseCommand([],t),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.
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,D,t){if(Bu.existsSync(u))return;let r=D?`searched for local subcommand relative to directory '${D}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${u}' does not exist
20
- - if '${t}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
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}}TE.Option=Ci;TE.DualOptions=Ei});var hi=Qu((QE)=>{function NE(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 ME(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=NE(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""}QE.suggestSimilar=ME});var ni=Qu((WE)=>{var XE=zD("node:events").EventEmitter,WF=zD("node:child_process"),xD=zD("node:path"),Z0=zD("node:fs"),g=zD("node:process"),{Argument:YE,humanReadableArgName:ZE}=Y0(),{CommanderError:KF}=H2(),{Help:zE,stripColor:VE}=VF(),{Option:ri,DualOptions:HE}=HF(),{suggestSimilar:fi}=hi();class qF extends XE{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:()=>PF()??(g.stdout.isTTY&&g.stdout.hasColors?.()),getErrHasColors:()=>PF()??(g.stderr.isTTY&&g.stderr.hasColors?.()),stripColor:(u)=>VE(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 qF(D)}createHelp(){return Object.assign(new zE,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 YE(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 ri(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 ri)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(Z0.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
- - ${r}`;throw Error(n)}_executeSubCommand(u,D){D=D.slice();let t=!1,r=[".js",".ts",".tsx",".mjs",".cjs"];function n(f,C){let E=a.resolve(f,C);if(Bu.existsSync(E))return E;if(r.includes(a.extname(C)))return;let c=r.find((B)=>Bu.existsSync(`${E}${B}`));if(c)return`${E}${c}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let F=u._executableFile||`${this._name}-${u._name}`,i=this._executableDir||"";if(this._scriptPath){let f;try{f=Bu.realpathSync(this._scriptPath)}catch{f=this._scriptPath}i=a.resolve(a.dirname(f),i)}if(i){let f=n(i,F);if(!f&&!u._executableFile&&this._scriptPath){let C=a.basename(this._scriptPath,a.extname(this._scriptPath));if(C!==this._name)f=n(i,`${C}-${u._name}`)}F=f||F}t=r.includes(a.extname(F));let e;if(b.platform!=="win32")if(t)D.unshift(F),D=yD(b.execArgv).concat(D),e=Qu.spawn(b.argv[0],D,{stdio:"inherit"});else e=Qu.spawn(F,D,{stdio:"inherit"});else this._checkForMissingExecutable(F,i,u._name),D.unshift(F),D=yD(b.execArgv).concat(D),e=Qu.spawn(b.execPath,D,{stdio:"inherit"});if(!e.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((C)=>{b.on(C,()=>{if(e.killed===!1&&e.exitCode===null)e.kill(C)})});let s=this._exitCallback;e.on("close",(f)=>{if(f=f??1,!s)b.exit(f);else s(new Wu(f,"commander.executeSubCommandAsync","(close)"))}),e.on("error",(f)=>{if(f.code==="ENOENT")this._checkForMissingExecutable(F,i,u._name);else if(f.code==="EACCES")throw Error(`'${F}' not executable`);if(!s)b.exit(1);else{let C=new Wu(1,"commander.executeSubCommandAsync","(error)");C.nestedError=f,s(C)}}),this.runningCommand=e}_dispatchSubcommand(u,D,t){let r=this._findCommand(u);if(!r)this.help({error:!0});r._prepareForParse();let n;return n=this._chainOrCallSubCommandHook(n,r,"preSubcommand"),n=this._chainOrCall(n,()=>{if(r._executableHandler)this._executeSubCommand(r,D.concat(t));else return r._parseCommand(D,t)}),n}_dispatchHelpCommand(u){if(!u)this.help();let D=this._findCommand(u);if(D&&!D._executableHandler)D.help();return this._dispatchSubcommand(u,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((u,D)=>{if(u.required&&this.args[D]==null)this.missingArgument(u.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 u=(t,r,n)=>{let F=r;if(r!==null&&t.parseArg){let i=`error: command-argument value '${r}' is invalid for argument '${t.name()}'.`;F=this._callParseArg(t,r,n,i)}return F};this._checkNumberOfArguments();let D=[];this.registeredArguments.forEach((t,r)=>{let n=t.defaultValue;if(t.variadic){if(r<this.args.length){if(n=this.args.slice(r),t.parseArg)n=n.reduce((F,i)=>{return u(t,i,F)},t.defaultValue)}else if(n===void 0)n=[]}else if(r<this.args.length){if(n=this.args[r],t.parseArg)n=u(t,n,t.defaultValue)}D[r]=n}),this.processedArgs=D}_chainOrCall(u,D){if(u&&u.then&&typeof u.then==="function")return u.then(()=>D());return D()}_chainOrCallHooks(u,D){let t=u,r=[];if(this._getCommandAndAncestors().reverse().filter((n)=>n._lifeCycleHooks[D]!==void 0).forEach((n)=>{n._lifeCycleHooks[D].forEach((F)=>{r.push({hookedCommand:n,callback:F})})}),D==="postAction")r.reverse();return r.forEach((n)=>{t=this._chainOrCall(t,()=>{return n.callback(n.hookedCommand,this)})}),t}_chainOrCallSubCommandHook(u,D,t){let r=u;if(this._lifeCycleHooks[t]!==void 0)this._lifeCycleHooks[t].forEach((n)=>{r=this._chainOrCall(r,()=>{return n(this,D)})});return r}_parseCommand(u,D){let t=this.parseOptions(D);if(this._parseOptionsEnv(),this._parseOptionsImplied(),u=u.concat(t.operands),D=t.unknown,this.args=u.concat(D),u&&this._findCommand(u[0]))return this._dispatchSubcommand(u[0],u.slice(1),D);if(this._getHelpCommand()&&u[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(u[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(D),this._dispatchSubcommand(this._defaultCommandName,u,D);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(t.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{if(t.unknown.length>0)this.unknownOption(t.unknown[0])},n=`command:${this.name()}`;if(this._actionHandler){r(),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(n,u,D)});return F=this._chainOrCallHooks(F,"postAction"),F}if(this.parent&&this.parent.listenerCount(n))r(),this._processArguments(),this.parent.emit(n,u,D);else if(u.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",u,D);if(this.listenerCount("command:*"))this.emit("command:*",u,D);else if(this.commands.length)this.unknownCommand();else r(),this._processArguments()}else if(this.commands.length)r(),this.help({error:!0});else r(),this._processArguments()}_findCommand(u){if(!u)return;return this.commands.find((D)=>D._name===u||D._aliases.includes(u))}_findOption(u){return this.options.find((D)=>D.is(u))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((u)=>{u.options.forEach((D)=>{if(D.mandatory&&u.getOptionValue(D.attributeName())===void 0)u.missingMandatoryOptionValue(D)})})}_checkForConflictingLocalOptions(){let u=this.options.filter((t)=>{let r=t.attributeName();if(this.getOptionValue(r)===void 0)return!1;return this.getOptionValueSource(r)!=="default"});u.filter((t)=>t.conflictsWith.length>0).forEach((t)=>{let r=u.find((n)=>t.conflictsWith.includes(n.attributeName()));if(r)this._conflictingOption(t,r)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((u)=>{u._checkForConflictingLocalOptions()})}parseOptions(u){let D=[],t=[],r=D,n=u.slice();function F(e){return e.length>1&&e[0]==="-"}let i=null;while(n.length){let e=n.shift();if(e==="--"){if(r===t)r.push(e);r.push(...n);break}if(i&&!F(e)){this.emit(`option:${i.name()}`,e);continue}if(i=null,F(e)){let s=this._findOption(e);if(s){if(s.required){let f=n.shift();if(f===void 0)this.optionMissingArgument(s);this.emit(`option:${s.name()}`,f)}else if(s.optional){let f=null;if(n.length>0&&!F(n[0]))f=n.shift();this.emit(`option:${s.name()}`,f)}else this.emit(`option:${s.name()}`);i=s.variadic?s:null;continue}}if(e.length>2&&e[0]==="-"&&e[1]!=="-"){let s=this._findOption(`-${e[1]}`);if(s){if(s.required||s.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${s.name()}`,e.slice(2));else this.emit(`option:${s.name()}`),n.unshift(`-${e.slice(2)}`);continue}}if(/^--[^=]+=/.test(e)){let s=e.indexOf("="),f=this._findOption(e.slice(0,s));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,e.slice(s+1));continue}}if(F(e))r=t;if((this._enablePositionalOptions||this._passThroughOptions)&&D.length===0&&t.length===0){if(this._findCommand(e)){if(D.push(e),n.length>0)t.push(...n);break}else if(this._getHelpCommand()&&e===this._getHelpCommand().name()){if(D.push(e),n.length>0)D.push(...n);break}else if(this._defaultCommandName){if(t.push(e),n.length>0)t.push(...n);break}}if(this._passThroughOptions){if(r.push(e),n.length>0)r.push(...n);break}r.push(e)}return{operands:D,unknown:t}}opts(){if(this._storeOptionsAsProperties){let u={},D=this.options.length;for(let t=0;t<D;t++){let r=this.options[t].attributeName();u[r]=r===this._versionOptionName?this._version:this[r]}return u}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((u,D)=>Object.assign(u,D.opts()),{})}error(u,D){if(this._outputConfiguration.outputError(`${u}
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=xD.resolve(A,$);if(Z0.existsSync(R))return R;if(C.includes(xD.extname($)))return;let m=C.find((l)=>Z0.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=Z0.realpathSync(this._scriptPath)}catch{A=this._scriptPath}E=xD.resolve(xD.dirname(A),E)}if(E){let A=h(E,f);if(!A&&!D._executableFile&&this._scriptPath){let $=xD.basename(this._scriptPath,xD.extname(this._scriptPath));if($!==this._name)A=h(E,`${$}-${D._name}`)}f=A||f}i=C.includes(xD.extname(f));let B;if(g.platform!=="win32")if(i)u.unshift(f),u=ci(g.execArgv).concat(u),B=WF.spawn(g.argv[0],u,{stdio:"inherit"});else B=WF.spawn(f,u,{stdio:"inherit"});else this._checkForMissingExecutable(f,E,D._name),u.unshift(f),u=ci(g.execArgv).concat(u),B=WF.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 t=D||{},r=t.exitCode||1,n=t.code||"commander.error";this._exit(r,n,u)}_parseOptionsEnv(){this.options.forEach((u)=>{if(u.envVar&&u.envVar in b.env){let D=u.attributeName();if(this.getOptionValue(D)===void 0||["default","config","env"].includes(this.getOptionValueSource(D)))if(u.required||u.optional)this.emit(`optionEnv:${u.name()}`,b.env[u.envVar]);else this.emit(`optionEnv:${u.name()}`)}})}_parseOptionsImplied(){let u=new Hi(this.options),D=(t)=>{return this.getOptionValue(t)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(t))};this.options.filter((t)=>t.implied!==void 0&&D(t.attributeName())&&u.valueFromOption(this.getOptionValue(t.attributeName()),t)).forEach((t)=>{Object.keys(t.implied).filter((r)=>!D(r)).forEach((r)=>{this.setOptionValueWithSource(r,t.implied[r],"implied")})})}missingArgument(u){let D=`error: missing required argument '${u}'`;this.error(D,{code:"commander.missingArgument"})}optionMissingArgument(u){let D=`error: option '${u.flags}' argument missing`;this.error(D,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(u){let D=`error: required option '${u.flags}' not specified`;this.error(D,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(u,D){let t=(F)=>{let i=F.attributeName(),e=this.getOptionValue(i),s=this.options.find((C)=>C.negate&&i===C.attributeName()),f=this.options.find((C)=>!C.negate&&i===C.attributeName());if(s&&(s.presetArg===void 0&&e===!1||s.presetArg!==void 0&&e===s.presetArg))return s;return f||F},r=(F)=>{let i=t(F),e=i.attributeName();if(this.getOptionValueSource(e)==="env")return`environment variable '${i.envVar}'`;return`option '${i.flags}'`},n=`error: ${r(u)} cannot be used with ${r(D)}`;this.error(n,{code:"commander.conflictingOption"})}unknownOption(u){if(this._allowUnknownOption)return;let D="";if(u.startsWith("--")&&this._showSuggestionAfterError){let r=[],n=this;do{let F=n.createHelp().visibleOptions(n).filter((i)=>i.long).map((i)=>i.long);r=r.concat(F),n=n.parent}while(n&&!n._enablePositionalOptions);D=TD(u,r)}let t=`error: unknown option '${u}'${D}`;this.error(t,{code:"commander.unknownOption"})}_excessArguments(u){if(this._allowExcessArguments)return;let D=this.registeredArguments.length,t=D===1?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${D} argument${t} but got ${u.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){let u=this.args[0],D="";if(this._showSuggestionAfterError){let r=[];this.createHelp().visibleCommands(this).forEach((n)=>{if(r.push(n.name()),n.alias())r.push(n.alias())}),D=TD(u,r)}let t=`error: unknown command '${u}'${D}`;this.error(t,{code:"commander.unknownCommand"})}version(u,D,t){if(u===void 0)return this._version;this._version=u,D=D||"-V, --version",t=t||"output the version number";let r=this.createOption(D,t);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${u}
26
- `),this._exit(0,"commander.version",u)}),this}description(u,D){if(u===void 0&&D===void 0)return this._description;if(this._description=u,D)this._argsDescription=D;return this}summary(u){if(u===void 0)return this._summary;return this._summary=u,this}alias(u){if(u===void 0)return this._aliases[0];let D=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)D=this.commands[this.commands.length-1];if(u===D._name)throw Error("Command alias can't be the same as its name");let t=this.parent?._findCommand(u);if(t){let r=[t.name()].concat(t.aliases()).join("|");throw Error(`cannot add alias '${u}' to command '${this.name()}' as already have command '${r}'`)}return D._aliases.push(u),this}aliases(u){if(u===void 0)return this._aliases;return u.forEach((D)=>this.alias(D)),this}usage(u){if(u===void 0){if(this._usage)return this._usage;let D=this.registeredArguments.map((t)=>{return Zi(t)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?D:[]).join(" ")}return this._usage=u,this}name(u){if(u===void 0)return this._name;return this._name=u,this}nameFromFilename(u){return this._name=a.basename(u,a.extname(u)),this}executableDir(u){if(u===void 0)return this._executableDir;return this._executableDir=u,this}helpInformation(u){let D=this.createHelp(),t=this._getOutputContext(u);D.prepareContext({error:t.error,helpWidth:t.helpWidth,outputHasColors:t.hasColors});let r=D.formatHelp(this,D);if(t.hasColors)return r;return this._outputConfiguration.stripColor(r)}_getOutputContext(u){u=u||{};let D=!!u.error,t,r,n;if(D)t=(i)=>this._outputConfiguration.writeErr(i),r=this._outputConfiguration.getErrHasColors(),n=this._outputConfiguration.getErrHelpWidth();else t=(i)=>this._outputConfiguration.writeOut(i),r=this._outputConfiguration.getOutHasColors(),n=this._outputConfiguration.getOutHelpWidth();return{error:D,write:(i)=>{if(!r)i=this._outputConfiguration.stripColor(i);return t(i)},hasColors:r,helpWidth:n}}outputHelp(u){let D;if(typeof u==="function")D=u,u=void 0;let t=this._getOutputContext(u),r={error:t.error,write:t.write,command:this};this._getCommandAndAncestors().reverse().forEach((F)=>F.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let n=this.helpInformation({error:t.error});if(D){if(n=D(n),typeof n!=="string"&&!Buffer.isBuffer(n))throw Error("outputHelp callback must return a string or a Buffer")}if(t.write(n),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",r),this._getCommandAndAncestors().forEach((F)=>F.emit("afterAllHelp",r))}helpOption(u,D){if(typeof u==="boolean"){if(u)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return u=u??"-h, --help",D=D??"display help for command",this._helpOption=this.createOption(u,D),this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(u){return this._helpOption=u,this}help(u){this.outputHelp(u);let D=Number(b.exitCode??0);if(D===0&&u&&typeof u!=="function"&&u.error)D=1;this._exit(D,"commander.help","(outputHelp)")}addHelpText(u,D){let t=["beforeAll","before","after","afterAll"];if(!t.includes(u))throw Error(`Unexpected value for position to addHelpText.
27
- Expecting one of '${t.join("', '")}'`);let r=`${u}Help`;return this.on(r,(n)=>{let F;if(typeof D==="function")F=D({error:n.error,command:n.command});else F=D;if(F)n.write(`${F}
28
- `)}),this}_outputHelpIfRequested(u){let D=this._getHelpOption();if(D&&u.find((r)=>D.is(r)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function yD(u){return u.map((D)=>{if(!D.startsWith("--inspect"))return D;let t,r="127.0.0.1",n="9229",F;if((F=D.match(/^(--inspect(-brk)?)$/))!==null)t=F[1];else if((F=D.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(t=F[1],/^\d+$/.test(F[3]))n=F[3];else r=F[3];else if((F=D.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)t=F[1],r=F[3],n=F[4];if(t&&n!=="0")return`${t}=${r}:${parseInt(n)+1}`;return D})}function zu(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0;return}Vi.Command=Yu;Vi.useColor=zu});var JD=O((Oi)=>{var{Argument:ID}=cu(),{Command:qu}=UD(),{CommanderError:vi,InvalidArgumentError:GD}=eu(),{Help:ji}=Lu(),{Option:ND}=Pu();Oi.program=new qu;Oi.createCommand=(u)=>new qu(u);Oi.createOption=(u,D)=>new ND(u,D);Oi.createArgument=(u,D)=>new ID(u,D);Oi.Command=qu;Oi.Option=ND;Oi.Argument=ID;Oi.Help=ji;Oi.CommanderError=vi;Oi.InvalidArgumentError=GD;Oi.InvalidOptionArgumentError=GD});var ct={};li(ct,{prompt:()=>ht,kCancel:()=>Et});import Q,{stdin as U2,stdout as I2}from"process";import XD from"readline";import{WriteStream as G2}from"tty";function N2(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function J2(){if(HD)return vu;HD=1;let u="\x1B",D=`${u}[`,t="\x07",r={to(i,e){if(!e)return`${D}${i+1}G`;return`${D}${e+1};${i+1}H`},move(i,e){let s="";if(i<0)s+=`${D}${-i}D`;else if(i>0)s+=`${D}${i}C`;if(e<0)s+=`${D}${-e}A`;else if(e>0)s+=`${D}${e}B`;return s},up:(i=1)=>`${D}${i}A`,down:(i=1)=>`${D}${i}B`,forward:(i=1)=>`${D}${i}C`,backward:(i=1)=>`${D}${i}D`,nextLine:(i=1)=>`${D}E`.repeat(i),prevLine:(i=1)=>`${D}F`.repeat(i),left:`${D}G`,hide:`${D}?25l`,show:`${D}?25h`,save:`${u}7`,restore:`${u}8`},n={up:(i=1)=>`${D}S`.repeat(i),down:(i=1)=>`${D}T`.repeat(i)},F={screen:`${D}2J`,up:(i=1)=>`${D}1J`.repeat(i),down:(i=1)=>`${D}J`.repeat(i),line:`${D}2K`,lineEnd:`${D}K`,lineStart:`${D}1K`,lines(i){let e="";for(let s=0;s<i;s++)e+=this.line+(s<i-1?r.up():"");if(i)e+=r.left;return e}};return vu={cursor:r,scroll:n,erase:F,beep:t},vu}function M2(){if(VD)return $u.exports;VD=1;let u=process||{},D=u.argv||[],t=u.env||{},r=!(!!t.NO_COLOR||D.includes("--no-color"))&&(!!t.FORCE_COLOR||D.includes("--color")||u.platform==="win32"||(u.stdout||{}).isTTY&&t.TERM!=="dumb"||!!t.CI),n=(e,s,f=e)=>(C)=>{let E=""+C,c=E.indexOf(s,e.length);return~c?e+F(E,s,f,c)+s:e+E+s},F=(e,s,f,C)=>{let E="",c=0;do E+=e.substring(c,C)+f,c=C+s.length,C=e.indexOf(s,c);while(~C);return E+e.substring(c)},i=(e=r)=>{let s=e?n:()=>String;return{isColorSupported:e,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 $u.exports=i(),$u.exports.createColors=i,$u.exports}function L2({onlyFirst:u=!1}={}){let D=["[\\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(D,u?void 0:"g")}function tt(u){if(typeof u!="string")throw TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(P2,"")}function it(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function su(u,D={}){if(typeof u!="string"||u.length===0||(D={ambiguousIsNarrow:!0,...D},u=tt(u),u.length===0))return 0;u=u.replace(Y2()," ");let t=D.ambiguousIsNarrow?1:2,r=0;for(let n of u){let F=n.codePointAt(0);if(F<=31||F>=127&&F<=159||F>=768&&F<=879)continue;switch(W2.eastAsianWidth(n)){case"F":case"W":r+=2;break;case"A":r+=t;break;default:r+=1}}return r}function a2(){let u=new Map;for(let[D,t]of Object.entries(U)){for(let[r,n]of Object.entries(t))U[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=U[r],u.set(n[0],n[1]);Object.defineProperty(U,D,{value:t,enumerable:!1})}return Object.defineProperty(U,"codes",{value:u,enumerable:!1}),U.color.close="\x1B[39m",U.bgColor.close="\x1B[49m",U.color.ansi=kD(),U.color.ansi256=KD(),U.color.ansi16m=vD(),U.bgColor.ansi=kD(ju),U.bgColor.ansi256=KD(ju),U.bgColor.ansi16m=vD(ju),Object.defineProperties(U,{rgbToAnsi256:{value:(D,t,r)=>D===t&&t===r?D<8?16:D>248?231:Math.round((D-8)/247*24)+232:16+36*Math.round(D/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:(D)=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map((F)=>F+F).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:(D)=>U.rgbToAnsi256(...U.hexToRgb(D)),enumerable:!1},ansi256ToAnsi:{value:(D)=>{if(D<8)return 30+D;if(D<16)return 90+(D-8);let t,r,n;if(D>=232)t=((D-232)*10+8)/255,r=t,n=t;else{D-=16;let e=D%36;t=Math.floor(D/36)/5,r=Math.floor(e/6)/5,n=e%6/5}let F=Math.max(t,r,n)*2;if(F===0)return 30;let i=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return F===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(D,t,r)=>U.ansi256ToAnsi(U.rgbToAnsi256(D,t,r)),enumerable:!1},hexToAnsi:{value:(D)=>U.ansi256ToAnsi(U.hexToAnsi256(D)),enumerable:!1}}),U}function dD(u,D,t){return String(u).normalize().replace(/\r\n/g,`
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 HE(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=fi(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=fi(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 ZE(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=xD.basename(D,xD.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 ci(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 PF(){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}WE.Command=qF;WE.useColor=PF});var $i=Qu((kE)=>{var{Argument:Bi}=Y0(),{Command:gF}=ni(),{CommanderError:qE,InvalidArgumentError:si}=H2(),{Help:gE}=VF(),{Option:ti}=HF();kE.program=new gF;kE.createCommand=(D)=>new gF(D);kE.createOption=(D,u)=>new ti(D,u);kE.createArgument=(D,u)=>new Bi(D,u);kE.Command=gF;kE.Option=ti;kE.Argument=Bi;kE.Help=gE;kE.CommanderError=qE;kE.InvalidArgumentError=si;kE.InvalidOptionArgumentError=si});var pi={};x6(pi,{prompt:()=>di,kCancel:()=>oi});import ID,{stdin as S9,stdout as l9}from"node:process";import Ti from"node:readline";import{WriteStream as G9}from"node:tty";function U9(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function I9(){if(yi)return aF;yi=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 aF={cursor:C,scroll:h,erase:f,beep:i},aF}function T9(){if(Ji)return H0.exports;Ji=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 H0.exports=E(),H0.exports.createColors=E,H0.exports}function J9({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 Wi(D){if(typeof D!="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(N9,"")}function Ki(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function W2(D,u={}){if(typeof D!="string"||D.length===0||(u={ambiguousIsNarrow:!0,...u},D=Wi(D),D.length===0))return 0;D=D.replace(X9()," ");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(Q9.eastAsianWidth(h)){case"F":case"W":C+=2;break;case"A":C+=i;break;default:C+=1}}return C}function z9(){let D=new Map;for(let[u,i]of Object.entries(e)){for(let[C,h]of Object.entries(i))e[C]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},i[C]=e[C],D.set(h[0],h[1]);Object.defineProperty(e,u,{value:i,enumerable:!1})}return Object.defineProperty(e,"codes",{value:D,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=Ni(),e.color.ansi256=Mi(),e.color.ansi16m=Qi(),e.bgColor.ansi=Ni(xF),e.bgColor.ansi256=Mi(xF),e.bgColor.ansi16m=Qi(xF),Object.defineProperties(e,{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)=>e.rgbToAnsi256(...e.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)=>e.ansi256ToAnsi(e.rgbToAnsi256(u,i,C)),enumerable:!1},hexToAnsi:{value:(u)=>e.ansi256ToAnsi(e.hexToAnsi256(u)),enumerable:!1}}),e}function Yi(D,u,i){return String(D).normalize().replace(/\r\n/g,`
29
28
  `).split(`
30
- `).map((r)=>v2(r,D,t)).join(`
31
- `)}function et(u,D){if(typeof u=="string")return wu.aliases.get(u)===D;for(let t of u)if(t!==void 0&&et(t,D))return!0;return!1}function O2(u,D){if(u===D)return;let t=u.split(`
32
- `),r=D.split(`
33
- `),n=[];for(let F=0;F<Math.max(t.length,r.length);F++)t[F]!==r[F]&&n.push(F);return n}function Au(u,D){let t=u;t.isTTY&&t.setRawMode(D)}class Cu{constructor(u,D=!0){L(this,"input"),L(this,"output"),L(this,"_abortSignal"),L(this,"rl"),L(this,"opts"),L(this,"_render"),L(this,"_track",!1),L(this,"_prevFrame",""),L(this,"_subscribers",new Map),L(this,"_cursor",0),L(this,"state","initial"),L(this,"error",""),L(this,"value");let{input:t=U2,output:r=I2,render:n,signal:F,...i}=u;this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=n.bind(this),this._track=D,this._abortSignal=F,this.input=t,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(u,D){let t=this._subscribers.get(u)??[];t.push(D),this._subscribers.set(u,t)}on(u,D){this.setSubscriber(u,{cb:D})}once(u,D){this.setSubscriber(u,{cb:D,once:!0})}emit(u,...D){let t=this._subscribers.get(u)??[],r=[];for(let n of t)n.cb(...D),n.once&&r.push(()=>t.splice(t.indexOf(n),1));for(let n of r)n()}prompt(){return new Promise((u,D)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),u(pD);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let t=new G2(0);t._write=(r,n,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(t),this.rl=XD.createInterface({input:this.input,output:t,tabSize:2,prompt:"",escapeCodeTimeout:50}),XD.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),Au(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(W.cursor.show),this.output.off("resize",this.render),Au(this.input,!1),u(this.value)}),this.once("cancel",()=>{this.output.write(W.cursor.show),this.output.off("resize",this.render),Au(this.input,!1),u(pD)})})}onKeypress(u,D){if(this.state==="error"&&(this.state="active"),D?.name&&(!this._track&&wu.aliases.has(D.name)&&this.emit("cursor",wu.aliases.get(D.name)),wu.actions.has(D.name)&&this.emit("cursor",D.name)),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),u&&this.emit("key",u.toLowerCase()),D?.name==="return"){if(this.opts.validate){let t=this.opts.validate(this.value);t&&(this.error=t instanceof Error?t.message:t,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}et([u,D?.name,D?.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(`
34
- `),Au(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let u=dD(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
35
- `).length-1;this.output.write(W.cursor.move(-999,u*-1))}render(){let u=dD(this._render(this)??"",process.stdout.columns,{hard:!0});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(W.cursor.hide);else{let D=O2(this._prevFrame,u);if(this.restoreCursor(),D&&D?.length===1){let t=D[0];this.output.write(W.cursor.move(0,t)),this.output.write(W.erase.lines(1));let r=u.split(`
36
- `);this.output.write(r[t]),this._prevFrame=u,this.output.write(W.cursor.move(0,r.length-t-1));return}if(D&&D?.length>1){let t=D[0];this.output.write(W.cursor.move(0,t)),this.output.write(W.erase.down());let r=u.split(`
37
- `).slice(t);this.output.write(r.join(`
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[f,C]of s.entries()){if(r+=C,_u.has(C)){let{groups:c}=new RegExp(`(?:\\${nt}(?<code>\\d+)m|\\${DD}(?<uri>.*)${uD})`).exec(s.slice(f).join(""))||{groups:{}};if(c.code!==void 0){let B=Number.parseFloat(c.code);n=B===H2?void 0:B}else c.uri!==void 0&&(F=c.uri.length===0?void 0:c.uri)}let E=X2.codes.get(Number(n));s[f+1]===`
40
- `?(F&&(r+=OD("")),n&&E&&(r+=jD(E))):C===`
41
- `&&(n&&E&&(r+=jD(n)),F&&(r+=OD(F)))}return r},j2,wu,pD,d2,p2=(u,D,t)=>(D in u)?d2(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,L=(u,D,t)=>(p2(u,typeof D!="symbol"?D+"":D,t),t),st,x2,ur=(u,D,t)=>(D in u)?x2(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,xD=(u,D,t)=>(ur(u,typeof D!="symbol"?D+"":D,t),t),Dr,tr,ir=(u,D,t)=>(D in u)?tr(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,ut=(u,D,t)=>(ir(u,typeof D!="symbol"?D+"":D,t),t),Ct,ft,nr,z=(u,D)=>nr?u:D,Fr,er,sr,Cr,T,tu,du,pu,fr,Dt,Er,mu=(u)=>{switch(u){case"initial":case"active":return h.cyan(Fr);case"cancel":return h.red(er);case"error":return h.yellow(sr);case"submit":return h.green(Cr)}},xu=(u)=>{let{cursor:D,options:t,style:r}=u,n=u.maxItems??Number.POSITIVE_INFINITY,F=Math.max(process.stdout.rows-4,0),i=Math.min(F,Math.max(n,5)),e=0;D>=e+i-3?e=Math.max(Math.min(D-i+3,t.length-i),0):D<e+2&&(e=Math.max(D-2,0));let s=i<t.length&&e>0,f=i<t.length&&e+i<t.length;return t.slice(e,e+i).map((C,E,c)=>{let B=E===0&&s,A=E===c.length-1&&f;return B||A?h.dim("..."):r(C,E+e===D)})},hr=(u)=>new ft({validate:u.validate,placeholder:u.placeholder,defaultValue:u.defaultValue,initialValue:u.initialValue,render(){let D=`${h.gray(T)}
42
- ${mu(this.state)} ${u.message}
43
- `,t=u.placeholder?h.inverse(u.placeholder[0])+h.dim(u.placeholder.slice(1)):h.inverse(h.hidden("_")),r=this.value?this.valueWithCursor:t;switch(this.state){case"error":return`${D.trim()}
44
- ${h.yellow(T)} ${r}
45
- ${h.yellow(tu)} ${h.yellow(this.error)}
46
- `;case"submit":return`${D}${h.gray(T)} ${h.dim(this.value||u.placeholder)}`;case"cancel":return`${D}${h.gray(T)} ${h.strikethrough(h.dim(this.value??""))}${this.value?.trim()?`
47
- ${h.gray(T)}`:""}`;default:return`${D}${h.cyan(T)} ${r}
48
- ${h.cyan(tu)}
49
- `}}}).prompt(),cr=(u)=>{let D=u.active??"Yes",t=u.inactive??"No";return new st({active:D,inactive:t,initialValue:u.initialValue??!0,render(){let r=`${h.gray(T)}
50
- ${mu(this.state)} ${u.message}
51
- `,n=this.value?D:t;switch(this.state){case"submit":return`${r}${h.gray(T)} ${h.dim(n)}`;case"cancel":return`${r}${h.gray(T)} ${h.strikethrough(h.dim(n))}
52
- ${h.gray(T)}`;default:return`${r}${h.cyan(T)} ${this.value?`${h.green(du)} ${D}`:`${h.dim(pu)} ${h.dim(D)}`} ${h.dim("/")} ${this.value?`${h.dim(pu)} ${h.dim(t)}`:`${h.green(du)} ${t}`}
53
- ${h.cyan(tu)}
54
- `}}}).prompt()},Br=(u)=>{let D=(t,r)=>{let n=t.label??String(t.value);switch(r){case"selected":return`${h.dim(n)}`;case"active":return`${h.green(du)} ${n} ${t.hint?h.dim(`(${t.hint})`):""}`;case"cancelled":return`${h.strikethrough(h.dim(n))}`;default:return`${h.dim(pu)} ${h.dim(n)}`}};return new Ct({options:u.options,initialValue:u.initialValue,render(){let t=`${h.gray(T)}
55
- ${mu(this.state)} ${u.message}
56
- `;switch(this.state){case"submit":return`${t}${h.gray(T)} ${D(this.options[this.cursor],"selected")}`;case"cancel":return`${t}${h.gray(T)} ${D(this.options[this.cursor],"cancelled")}
57
- ${h.gray(T)}`;default:return`${t}${h.cyan(T)} ${xu({cursor:this.cursor,options:this.options,maxItems:u.maxItems,style:(r,n)=>D(r,n?"active":"inactive")}).join(`
58
- ${h.cyan(T)} `)}
59
- ${h.cyan(tu)}
60
- `}}}).prompt()},or=(u)=>{let D=(t,r)=>{let n=t.label??String(t.value);return r==="active"?`${h.cyan(fr)} ${n} ${t.hint?h.dim(`(${t.hint})`):""}`:r==="selected"?`${h.green(Dt)} ${h.dim(n)}`:r==="cancelled"?`${h.strikethrough(h.dim(n))}`:r==="active-selected"?`${h.green(Dt)} ${n} ${t.hint?h.dim(`(${t.hint})`):""}`:r==="submitted"?`${h.dim(n)}`:`${h.dim(Er)} ${h.dim(n)}`};return new Dr({options:u.options,initialValues:u.initialValues,required:u.required??!0,cursorAt:u.cursorAt,validate(t){if(this.required&&t.length===0)return`Please select at least one option.
61
- ${h.reset(h.dim(`Press ${h.gray(h.bgWhite(h.inverse(" space ")))} to select, ${h.gray(h.bgWhite(h.inverse(" enter ")))} to submit`))}`},render(){let t=`${h.gray(T)}
62
- ${mu(this.state)} ${u.message}
63
- `,r=(n,F)=>{let i=this.value.includes(n.value);return F&&i?D(n,"active-selected"):i?D(n,"selected"):D(n,F?"active":"inactive")};switch(this.state){case"submit":return`${t}${h.gray(T)} ${this.options.filter(({value:n})=>this.value.includes(n)).map((n)=>D(n,"submitted")).join(h.dim(", "))||h.dim("none")}`;case"cancel":{let n=this.options.filter(({value:F})=>this.value.includes(F)).map((F)=>D(F,"cancelled")).join(h.dim(", "));return`${t}${h.gray(T)} ${n.trim()?`${n}
64
- ${h.gray(T)}`:""}`}case"error":{let n=this.error.split(`
65
- `).map((F,i)=>i===0?`${h.yellow(tu)} ${h.yellow(F)}`:` ${F}`).join(`
66
- `);return`${t+h.yellow(T)} ${xu({options:this.options,cursor:this.cursor,maxItems:u.maxItems,style:r}).join(`
67
- ${h.yellow(T)} `)}
68
- ${n}
69
- `}default:return`${t}${h.cyan(T)} ${xu({options:this.options,cursor:this.cursor,maxItems:u.maxItems,style:r}).join(`
70
- ${h.cyan(T)} `)}
71
- ${h.cyan(tu)}
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
- `+r.additional.join(`
75
- `)),delete r.additional}r.type=typeof r.type==="string"?r.type.toLowerCase():"log",r.tag=typeof r.tag==="string"?r.tag:"";let n=(i=!1)=>{let e=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&e>0){let s=[...this._lastLog.object.args];if(e>1)s.push(`(repeated ${e} times)`);this._log({...this._lastLog.object,args:s}),this._lastLog.count=1}if(i)this._lastLog.object=r,this._log(r)};clearTimeout(this._lastLog.timeout);let F=this._lastLog.time&&r.date?r.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=r.date,F<this.options.throttle)try{let i=JSON.stringify([r.type,r.tag,r.args]),e=this._lastLog.serialized===i;if(this._lastLog.serialized=i,e){if(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin){this._lastLog.timeout=setTimeout(n,this.options.throttle);return}}}catch{}n(!0)}_log(u){for(let D of this.options.reporters)D.log(u,{options:this.options})}}function Xu(u,D={},t=3){if(u===void 0)return t;if(typeof u==="number")return u;if(D[u]&&D[u].level!==void 0)return D[u].level;return t}N.prototype.add=N.prototype.addReporter;N.prototype.remove=N.prototype.removeReporter;N.prototype.clear=N.prototype.removeReporter;N.prototype.withScope=N.prototype.withTag;N.prototype.mock=N.prototype.mockTypes;N.prototype.pause=N.prototype.pauseLogs;N.prototype.resume=N.prototype.resumeLogs;function PD(u={}){return new N(u)}import{formatWithOptions as QD}from"util";import{sep as h2}from"path";function Ku(u,D){let t=process.cwd()+h2;return u.split(`
76
- `).splice(D.split(`
77
- `).length).map((n)=>n.trim().replace("file://","").replace(t,""))}function c2(u,D){return(D.__write||D.write).call(D,u)}var ku=(u)=>u?`[${u}]`:"";class ou{formatStack(u,D,t){let r=" ".repeat((t?.errorLevel||0)+1);return r+Ku(u,D).join(`
78
- ${r}`)}formatError(u,D){let t=u.message??QD(D,u),r=u.stack?this.formatStack(u.stack,t,D):"",n=D?.errorLevel||0,F=n>0?`${" ".repeat(n)}[cause]: `:"",i=u.cause?`
29
+ `).map((C)=>q9(C,u,i)).join(`
30
+ `)}function ki(D,u){if(typeof D=="string")return K0.aliases.get(D)===u;for(let i of D)if(i!==void 0&&ki(i,u))return!0;return!1}function k9(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 W0(D,u){let i=D;i.isTTY&&i.setRawMode(u)}class K2{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=S9,output:C=l9,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(Zi);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let i=new G9(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=Ti.createInterface({input:this.input,output:i,tabSize:2,prompt:"",escapeCodeTimeout:50}),Ti.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),W0(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(TD.cursor.show),this.output.off("resize",this.render),W0(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(TD.cursor.show),this.output.off("resize",this.render),W0(this.input,!1),D(Zi)})})}onKeypress(D,u){if(this.state==="error"&&(this.state="active"),u?.name&&(!this._track&&K0.aliases.has(u.name)&&this.emit("cursor",K0.aliases.get(u.name)),K0.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")}ki([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
+ `),W0(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let D=Yi(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
34
+ `).length-1;this.output.write(TD.cursor.move(-999,D*-1))}render(){let D=Yi(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(TD.cursor.hide);else{let u=k9(this._prevFrame,D);if(this.restoreCursor(),u&&u?.length===1){let i=u[0];this.output.write(TD.cursor.move(0,i)),this.output.write(TD.erase.lines(1));let C=D.split(`
35
+ `);this.output.write(C[i]),this._prevFrame=D,this.output.write(TD.cursor.move(0,C.length-i-1));return}if(u&&u?.length>1){let i=u[0];this.output.write(TD.cursor.move(0,i)),this.output.write(TD.erase.down());let C=D.split(`
36
+ `).slice(i);this.output.write(C.join(`
37
+ `)),this._prevFrame=D;return}this.output.write(TD.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}}function x9(){return ID.platform!=="win32"?ID.env.TERM!=="linux":!!ID.env.CI||!!ID.env.WT_SESSION||!!ID.env.TERMINUS_SUBLIME||ID.env.ConEmuTask==="{cmd::Cmder}"||ID.env.TERM_PROGRAM==="Terminus-Sublime"||ID.env.TERM_PROGRAM==="vscode"||ID.env.TERM==="xterm-256color"||ID.env.TERM==="alacritty"||ID.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function di(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,di);throw h}case"undefined":return;case"null":return null;case"symbol":return oi;default:case"default":return u.default??u.initial}};if(!u.type||u.type==="text")return await h4({message:D,defaultValue:u.default,placeholder:u.placeholder,initialValue:u.initial}).then(i);if(u.type==="confirm")return await r4({message:D,initialValue:u.initial}).then(i);if(u.type==="select")return await f4({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 c4({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 aF,yi,TD,H0,Ji,y9,G,N9,Pi,M9,Q9,L9=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},X9,xF=10,Ni=(D=0)=>(u)=>`\x1B[${u+D}m`,Mi=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,Qi=(D=0)=>(u,i,C)=>`\x1B[${38+D};2;${u};${i};${C}m`,e,Y9,Z9,V9,P0,H9=39,i8="\x07",qi="[",W9="]",gi="m",C8,Li=(D)=>`${P0.values().next().value}${qi}${D}${gi}`,Xi=(D)=>`${P0.values().next().value}${C8}${D}${i8}`,K9=(D)=>D.split(" ").map((u)=>W2(u)),eF=(D,u,i)=>{let C=[...u],h=!1,f=!1,E=W2(Wi(D[D.length-1]));for(let[B,s]of C.entries()){let A=W2(s);if(E+A<=i?D[D.length-1]+=s:(D.push(s),E=0),P0.has(s)&&(h=!0,f=C.slice(B+1).join("").startsWith(C8)),h){f?s===i8&&(h=!1,f=!1):s===gi&&(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())},P9=(D)=>{let u=D.split(" "),i=u.length;for(;i>0&&!(W2(u[i-1])>0);)i--;return i===u.length?D:u.slice(0,i).join(" ")+u.slice(i).join("")},q9=(D,u,i={})=>{if(i.trim!==!1&&D.trim()==="")return"";let C="",h,f,E=K9(D),B=[""];for(let[A,$]of D.split(" ").entries()){i.trim!==!1&&(B[B.length-1]=B[B.length-1].trimStart());let R=W2(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(""),eF(B,$,u);continue}if(R+E[A]>u&&R>0&&E[A]>0){if(i.wordWrap===!1&&R<u){eF(B,$,u);continue}B.push("")}if(R+E[A]>u&&i.wordWrap===!1){eF(B,$,u);continue}B[B.length-1]+=$}i.trim!==!1&&(B=B.map((A)=>P9(A)));let s=[...B.join(`
38
+ `)];for(let[A,$]of s.entries()){if(C+=$,P0.has($)){let{groups:m}=new RegExp(`(?:\\${qi}(?<code>\\d+)m|\\${C8}(?<uri>.*)${i8})`).exec(s.slice(A).join(""))||{groups:{}};if(m.code!==void 0){let l=Number.parseFloat(m.code);h=l===H9?void 0:l}else m.uri!==void 0&&(f=m.uri.length===0?void 0:m.uri)}let R=V9.codes.get(Number(h));s[A+1]===`
39
+ `?(f&&(C+=Xi("")),h&&R&&(C+=Li(R))):$===`
40
+ `&&(h&&R&&(C+=Li(h)),f&&(C+=Xi(f)))}return C},g9,K0,Zi,v9,j9=(D,u,i)=>(u in D)?v9(D,u,{enumerable:!0,configurable:!0,writable:!0,value:i}):D[u]=i,mD=(D,u,i)=>(j9(D,typeof u!="symbol"?u+"":u,i),i),vi,O9,o9=(D,u,i)=>(u in D)?O9(D,u,{enumerable:!0,configurable:!0,writable:!0,value:i}):D[u]=i,zi=(D,u,i)=>(o9(D,typeof u!="symbol"?u+"":u,i),i),d9,p9,a9=(D,u,i)=>(u in D)?p9(D,u,{enumerable:!0,configurable:!0,writable:!0,value:i}):D[u]=i,Vi=(D,u,i)=>(a9(D,typeof u!="symbol"?u+"":u,i),i),ji,Oi,e9,yD=(D,u)=>e9?D:u,D4,u4,F4,i4,o,u2,D8,u8,C4,Hi,E4,q0=(D)=>{switch(D){case"initial":case"active":return G.cyan(D4);case"cancel":return G.red(u4);case"error":return G.yellow(F4);case"submit":return G.green(i4)}},F8=(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?G.dim("..."):C($,R+B===u)})},h4=(D)=>new Oi({validate:D.validate,placeholder:D.placeholder,defaultValue:D.defaultValue,initialValue:D.initialValue,render(){let u=`${G.gray(o)}
41
+ ${q0(this.state)} ${D.message}
42
+ `,i=D.placeholder?G.inverse(D.placeholder[0])+G.dim(D.placeholder.slice(1)):G.inverse(G.hidden("_")),C=this.value?this.valueWithCursor:i;switch(this.state){case"error":return`${u.trim()}
43
+ ${G.yellow(o)} ${C}
44
+ ${G.yellow(u2)} ${G.yellow(this.error)}
45
+ `;case"submit":return`${u}${G.gray(o)} ${G.dim(this.value||D.placeholder)}`;case"cancel":return`${u}${G.gray(o)} ${G.strikethrough(G.dim(this.value??""))}${this.value?.trim()?`
46
+ ${G.gray(o)}`:""}`;default:return`${u}${G.cyan(o)} ${C}
47
+ ${G.cyan(u2)}
48
+ `}}}).prompt(),r4=(D)=>{let u=D.active??"Yes",i=D.inactive??"No";return new vi({active:u,inactive:i,initialValue:D.initialValue??!0,render(){let C=`${G.gray(o)}
49
+ ${q0(this.state)} ${D.message}
50
+ `,h=this.value?u:i;switch(this.state){case"submit":return`${C}${G.gray(o)} ${G.dim(h)}`;case"cancel":return`${C}${G.gray(o)} ${G.strikethrough(G.dim(h))}
51
+ ${G.gray(o)}`;default:return`${C}${G.cyan(o)} ${this.value?`${G.green(D8)} ${u}`:`${G.dim(u8)} ${G.dim(u)}`} ${G.dim("/")} ${this.value?`${G.dim(u8)} ${G.dim(i)}`:`${G.green(D8)} ${i}`}
52
+ ${G.cyan(u2)}
53
+ `}}}).prompt()},f4=(D)=>{let u=(i,C)=>{let h=i.label??String(i.value);switch(C){case"selected":return`${G.dim(h)}`;case"active":return`${G.green(D8)} ${h} ${i.hint?G.dim(`(${i.hint})`):""}`;case"cancelled":return`${G.strikethrough(G.dim(h))}`;default:return`${G.dim(u8)} ${G.dim(h)}`}};return new ji({options:D.options,initialValue:D.initialValue,render(){let i=`${G.gray(o)}
54
+ ${q0(this.state)} ${D.message}
55
+ `;switch(this.state){case"submit":return`${i}${G.gray(o)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${i}${G.gray(o)} ${u(this.options[this.cursor],"cancelled")}
56
+ ${G.gray(o)}`;default:return`${i}${G.cyan(o)} ${F8({cursor:this.cursor,options:this.options,maxItems:D.maxItems,style:(C,h)=>u(C,h?"active":"inactive")}).join(`
57
+ ${G.cyan(o)} `)}
58
+ ${G.cyan(u2)}
59
+ `}}}).prompt()},c4=(D)=>{let u=(i,C)=>{let h=i.label??String(i.value);return C==="active"?`${G.cyan(C4)} ${h} ${i.hint?G.dim(`(${i.hint})`):""}`:C==="selected"?`${G.green(Hi)} ${G.dim(h)}`:C==="cancelled"?`${G.strikethrough(G.dim(h))}`:C==="active-selected"?`${G.green(Hi)} ${h} ${i.hint?G.dim(`(${i.hint})`):""}`:C==="submitted"?`${G.dim(h)}`:`${G.dim(E4)} ${G.dim(h)}`};return new d9({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
+ ${G.reset(G.dim(`Press ${G.gray(G.bgWhite(G.inverse(" space ")))} to select, ${G.gray(G.bgWhite(G.inverse(" enter ")))} to submit`))}`},render(){let i=`${G.gray(o)}
61
+ ${q0(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}${G.gray(o)} ${this.options.filter(({value:h})=>this.value.includes(h)).map((h)=>u(h,"submitted")).join(G.dim(", "))||G.dim("none")}`;case"cancel":{let h=this.options.filter(({value:f})=>this.value.includes(f)).map((f)=>u(f,"cancelled")).join(G.dim(", "));return`${i}${G.gray(o)} ${h.trim()?`${h}
63
+ ${G.gray(o)}`:""}`}case"error":{let h=this.error.split(`
64
+ `).map((f,E)=>E===0?`${G.yellow(u2)} ${G.yellow(f)}`:` ${f}`).join(`
65
+ `);return`${i+G.yellow(o)} ${F8({options:this.options,cursor:this.cursor,maxItems:D.maxItems,style:C}).join(`
66
+ ${G.yellow(o)} `)}
67
+ ${h}
68
+ `}default:return`${i}${G.cyan(o)} ${F8({options:this.options,cursor:this.cursor,maxItems:D.maxItems,style:C}).join(`
69
+ ${G.cyan(o)} `)}
70
+ ${G.cyan(u2)}
71
+ `}}}).prompt()},oi;var ai=X0(()=>{TD=I9(),H0={exports:{}};y9=T9(),G=U9(y9);N9=J9();Pi={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}})(Pi);M9=Pi.exports,Q9=Ki(M9),X9=Ki(L9);e={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(e.modifier);Y9=Object.keys(e.color),Z9=Object.keys(e.bgColor);[...Y9,...Z9];V9=z9(),P0=new Set(["\x1B","›"]),C8=`${W9}8;;`;g9=["up","down","left","right","space","enter","cancel"],K0={actions:new Set(g9),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");Zi=Symbol("clack:cancel");v9=Object.defineProperty;vi=class vi extends K2{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(TD.cursor.move(0,-1)),this.value=u,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};O9=Object.defineProperty,d9=class extends K2{constructor(D){super(D,!1),zi(this,"options"),zi(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]}},p9=Object.defineProperty;ji=class ji extends K2{constructor(D){super(D,!1),Vi(this,"options"),Vi(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}};Oi=class Oi extends K2{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}${G.inverse(u)}${i.join("")}`}get cursor(){return this._cursor}constructor(D){super(D),this.on("finalize",()=>{this.value||(this.value=D.defaultValue)})}};e9=x9(),D4=yD("❯",">"),u4=yD("■","x"),F4=yD("▲","x"),i4=yD("✔","√"),o=yD(""),u2=yD(""),D8=yD("●",">"),u8=yD("○"," "),C4=yD("◻","[•]"),Hi=yD("◼","[+]"),E4=yD("◻","[ ]");`${G.gray(o)} `;oi=Symbol.for("cancel")});function f8(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var o4,d4=(D,u)=>o4(D,"name",{value:u,configurable:!0}),r8;var v0=X0(()=>{o4=Object.defineProperty,r8=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};d4(f8,"getDefaultExportFromCjs")});var cC={};x6(cC,{toFormData:()=>fC});function rC(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 fC(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 Fh(i[1]||i[2]),h,f,E,B,s,A,$=[],R=new Yu,m=_D((M)=>{E+=J.decode(M,{stream:!0})},"onPartData"),l=_D((M)=>{$.push(M)},"appendToFile"),S=_D(()=>{let M=new F2($,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=rC(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 p4,_D=(D,u)=>p4(D,"name",{value:u,configurable:!0}),HD=0,d,EC=1,_u,j0=10,O0=13,a4=32,q2=45,x4=58,e4=97,Dh=122,uh,Xu,hC=class{constructor(u){this.index=0,this.flags=0,this.onHeaderEnd=Xu,this.onHeaderField=Xu,this.onHeadersEnd=Xu,this.onHeaderValue=Xu,this.onPartBegin=Xu,this.onPartData=Xu,this.onPartEnd=Xu,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,x,uu)=>{(W===void 0||W!==x)&&this[Q](uu&&uu.subarray(W,x))},"callback"),v=_D((Q,W)=>{let x=Q+"Mark";x in this&&(W?(L(Q,this[x],i,u),delete this[x]):(L(Q,this[x],u.length,u),this[x]=0))},"dataCallback");for(i=0;i<C;i++)switch(S=u[i],A){case d.START_BOUNDARY:if(s===E.length-2){if(S===q2)$|=_u.LAST_BOUNDARY;else if(S!==O0)return;s++;break}else if(s-1===E.length-2){if($&_u.LAST_BOUNDARY&&S===q2)A=d.END,$=0;else if(!($&_u.LAST_BOUNDARY)&&S===j0)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===O0){M("onHeaderField"),A=d.HEADERS_ALMOST_DONE;break}if(s++,S===q2)break;if(S===x4){if(s===1)return;v("onHeaderField",!0),A=d.HEADER_VALUE_START;break}if(y=uh(S),y<e4||y>Dh)return;break;case d.HEADER_VALUE_START:if(S===a4)break;J("onHeaderValue"),A=d.HEADER_VALUE;case d.HEADER_VALUE:S===O0&&(v("onHeaderValue",!0),L("onHeaderEnd"),A=d.HEADER_VALUE_ALMOST_DONE);break;case d.HEADER_VALUE_ALMOST_DONE:if(S!==j0)return;A=d.HEADER_FIELD_START;break;case d.HEADERS_ALMOST_DONE:if(S!==j0)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===O0?$|=_u.PART_BOUNDARY:S===q2?$|=_u.LAST_BOUNDARY:s=0;else if(s-1===E.length)if($&_u.PART_BOUNDARY){if(s=0,S===j0){$&=~_u.PART_BOUNDARY,L("onPartEnd"),L("onPartBegin"),A=d.HEADER_FIELD_START;break}}else $&_u.LAST_BOUNDARY&&S===q2?(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")}},Fh;var nC=X0(()=>{o0();v0();p4=Object.defineProperty,d={START_BOUNDARY:HD++,HEADER_FIELD_START:HD++,HEADER_FIELD:HD++,HEADER_VALUE_START:HD++,HEADER_VALUE:HD++,HEADER_VALUE_ALMOST_DONE:HD++,HEADERS_ALMOST_DONE:HD++,PART_DATA_START:HD++,PART_DATA:HD++,END:HD++},_u={PART_BOUNDARY:EC,LAST_BOUNDARY:EC*=2},uh=_D((D)=>D|32,"lower"),Xu=_D(()=>{},"noop");_D(hC,"MultipartParser");Fh=hC;_D(rC,"_fileName");_D(fC,"toFormData")});import o2 from"node:http";import Ch from"node:https";import C2 from"node:zlib";import PD,{PassThrough as i3,pipeline as E2}from"node:stream";import{Buffer as rD}from"node:buffer";import{types as C3,deprecate as E3,promisify as Eh}from"node:util";import{format as hh}from"node:url";import{isIP as rh}from"node:net";import{promises as fh,statSync as GC,createReadStream as ch}from"node:fs";import{basename as nh}from"node:path";function UC(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 IC(){return sC||(sC=1,function(D,u){(function(i,C){C(u)})(Bh,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 x=16384,uu=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===x-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===x&&(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(uu,"SimpleQueue");let BD=uu,g8=Symbol("[[AbortSteps]]"),k8=Symbol("[[ErrorSteps]]"),R3=Symbol("[[CancelSteps]]"),b3=Symbol("[[PullSteps]]"),S3=Symbol("[[ReleaseSteps]]");function l3(F,r){F._ownerReadableStream=r,r._reader=F,r._state==="readable"?e2(F):r._state==="closed"?v8(F):G3(F,r._storedError)}c(l3,"ReadableStreamReaderGenericInitialize");function x2(F,r){let n=F._ownerReadableStream;return bD(n,r)}c(x2,"ReadableStreamReaderGenericCancel");function YD(F){let r=F._ownerReadableStream;r._state==="readable"?D0(F,TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):j8(F,TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),r._readableStreamController[S3](),r._reader=void 0,F._ownerReadableStream=void 0}c(YD,"ReadableStreamReaderGenericRelease");function s2(F){return TypeError("Cannot "+F+" a stream using a released reader")}c(s2,"readerLockException");function e2(F){F._closedPromise=$((r,n)=>{F._closedPromise_resolve=r,F._closedPromise_reject=n})}c(e2,"defaultReaderClosedPromiseInitialize");function G3(F,r){e2(F),D0(F,r)}c(G3,"defaultReaderClosedPromiseInitializeAsRejected");function v8(F){e2(F),U3(F)}c(v8,"defaultReaderClosedPromiseInitializeAsResolved");function D0(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(D0,"defaultReaderClosedPromiseReject");function j8(F,r){G3(F,r)}c(j8,"defaultReaderClosedPromiseResetToRejected");function U3(F){F._closedPromise_resolve!==void 0&&(F._closedPromise_resolve(void 0),F._closedPromise_resolve=void 0,F._closedPromise_reject=void 0)}c(U3,"defaultReaderClosedPromiseResolve");let O8=Number.isFinite||function(F){return typeof F=="number"&&isFinite(F)},p7=Math.trunc||function(F){return F<0?Math.ceil(F):Math.floor(F)};function o8(F){return typeof F=="object"||typeof F=="function"}c(o8,"isDictionary");function lD(F,r){if(F!==void 0&&!o8(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 d8(F){return typeof F=="object"&&F!==null||typeof F=="function"}c(d8,"isObject");function I3(F,r){if(!d8(F))throw TypeError(`${r} is not an object.`)}c(I3,"assertObject");function ZD(F,r,n){if(F===void 0)throw TypeError(`Parameter ${r} is required in '${n}'.`)}c(ZD,"assertRequiredArgument");function u0(F,r,n){if(F===void 0)throw TypeError(`${r} is required in '${n}'.`)}c(u0,"assertRequiredField");function F0(F){return Number(F)}c(F0,"convertUnrestrictedDouble");function T3(F){return F===0?0:F}c(T3,"censorNegativeZero");function p8(F){return T3(p7(F))}c(p8,"integerPart");function i0(F,r){let n=Number.MAX_SAFE_INTEGER,t=Number(F);if(t=T3(t),!O8(t))throw TypeError(`${r} is not a finite number`);if(t=p8(t),t<0||t>n)throw TypeError(`${r} is outside the accepted range of 0 to ${n}, inclusive`);return!O8(t)||t===0?0:t}c(i0,"convertUnsignedLongLongWithEnforceRange");function C0(F,r){if(!oD(F))throw TypeError(`${r} is not a ReadableStream.`)}c(C0,"assertReadableStream");function Gu(F){return new Fu(F)}c(Gu,"AcquireReadableStreamDefaultReader");function y3(F,r){F._reader._readRequests.push(r)}c(y3,"ReadableStreamAddReadRequest");function E0(F,r,n){let t=F._reader._readRequests.shift();n?t._closeSteps():t._chunkSteps(r)}c(E0,"ReadableStreamFulfillReadRequest");function t2(F){return F._reader._readRequests.length}c(t2,"ReadableStreamGetNumReadRequests");function J3(F){let r=F._reader;return!(r===void 0||!qD(r))}c(J3,"ReadableStreamHasDefaultReader");let a8=class{constructor(r){if(ZD(r,1,"ReadableStreamDefaultReader"),C0(r,"First parameter"),dD(r))throw TypeError("This stream has already been locked for exclusive reading by another reader");l3(this,r),this._readRequests=new BD}get closed(){return qD(this)?this._closedPromise:m($2("closed"))}cancel(r=void 0){return qD(this)?this._ownerReadableStream===void 0?m(s2("cancel")):x2(this,r):m($2("cancel"))}read(){if(!qD(this))return m($2("read"));if(this._ownerReadableStream===void 0)return m(s2("read from"));let r,n,t=$((w,_)=>{r=w,n=_});return qu(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(!qD(this))throw $2("releaseLock");this._ownerReadableStream!==void 0&&x8(this)}};c(a8,"ReadableStreamDefaultReader");let Fu=a8;Object.defineProperties(Fu.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),E(Fu.prototype.cancel,"cancel"),E(Fu.prototype.read,"read"),E(Fu.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Fu.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function qD(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_readRequests")?!1:F instanceof Fu}c(qD,"IsReadableStreamDefaultReader");function qu(F,r){let n=F._ownerReadableStream;n._disturbed=!0,n._state==="closed"?r._closeSteps():n._state==="errored"?r._errorSteps(n._storedError):n._readableStreamController[b3](r)}c(qu,"ReadableStreamDefaultReaderRead");function x8(F){YD(F);let r=TypeError("Reader was released");N3(F,r)}c(x8,"ReadableStreamDefaultReaderRelease");function N3(F,r){let n=F._readRequests;F._readRequests=new BD,n.forEach((t)=>{t._errorSteps(r)})}c(N3,"ReadableStreamDefaultReaderErrorReadRequests");function $2(F){return TypeError(`ReadableStreamDefaultReader.prototype.${F} can only be used on a ReadableStreamDefaultReader`)}c($2,"defaultReaderBrandCheckException");let a7=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),e8=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 qu(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=x2(n,r);return YD(n),M(t,()=>({value:r,done:!0}))}return YD(n),R({value:r,done:!0})}};c(e8,"ReadableStreamAsyncIteratorImpl");let D1=e8,u1={next(){return M3(this)?this._asyncIteratorImpl.next():m(Q3("next"))},return(F){return M3(this)?this._asyncIteratorImpl.return(F):m(Q3("return"))}};Object.setPrototypeOf(u1,a7);function F1(F,r){let n=Gu(F),t=new D1(n,r),w=Object.create(u1);return w._asyncIteratorImpl=t,w}c(F1,"AcquireReadableStreamAsyncIterator");function M3(F){if(!h(F)||!Object.prototype.hasOwnProperty.call(F,"_asyncIteratorImpl"))return!1;try{return F._asyncIteratorImpl instanceof D1}catch{return!1}}c(M3,"IsReadableStreamAsyncIterator");function Q3(F){return TypeError(`ReadableStreamAsyncIterator.${F} can only be used on a ReadableSteamAsyncIterator`)}c(Q3,"streamAsyncIteratorBrandCheckException");let i1=Number.isNaN||function(F){return F!==F};var L3,X3,Y3;function gu(F){return F.slice()}c(gu,"CreateArrayFromList");function Z3(F,r,n,t,w){new Uint8Array(F).set(new Uint8Array(n,t,w),r)}c(Z3,"CopyDataBlockBytes");let gD=c((F)=>(typeof F.transfer=="function"?gD=c((r)=>r.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?gD=c((r)=>structuredClone(r,{transfer:[r]}),"TransferArrayBuffer"):gD=c((r)=>r,"TransferArrayBuffer"),gD(F)),"TransferArrayBuffer"),iu=c((F)=>(typeof F.detached=="boolean"?iu=c((r)=>r.detached,"IsDetachedBuffer"):iu=c((r)=>r.byteLength===0,"IsDetachedBuffer"),iu(F)),"IsDetachedBuffer");function z3(F,r,n){if(F.slice)return F.slice(r,n);let t=n-r,w=new ArrayBuffer(t);return Z3(w,0,F,r,t),w}c(z3,"ArrayBufferSlice");function A2(F,r){let n=F[r];if(n!=null){if(typeof n!="function")throw TypeError(`${String(r)} is not a function`);return n}}c(A2,"GetMethod");function C1(F){let r={[Symbol.iterator]:()=>F.iterator},n=async function*(){return yield*r}(),t=n.next;return{iterator:n,nextMethod:t,done:!1}}c(C1,"CreateAsyncFromSyncIterator");let V3=(Y3=(L3=Symbol.asyncIterator)!==null&&L3!==void 0?L3:(X3=Symbol.for)===null||X3===void 0?void 0:X3.call(Symbol,"Symbol.asyncIterator"))!==null&&Y3!==void 0?Y3:"@@asyncIterator";function H3(F,r="sync",n){if(n===void 0)if(r==="async"){if(n=A2(F,V3),n===void 0){let _=A2(F,Symbol.iterator),b=H3(F,"sync",_);return C1(b)}}else n=A2(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(H3,"GetIterator");function E1(F){let r=Q(F.nextMethod,F.iterator,[]);if(!h(r))throw TypeError("The iterator.next() method must return an object");return r}c(E1,"IteratorNext");function h1(F){return!!F.done}c(h1,"IteratorComplete");function r1(F){return F.value}c(r1,"IteratorValue");function f1(F){return!(typeof F!="number"||i1(F)||F<0)}c(f1,"IsNonNegativeNumber");function W3(F){let r=z3(F.buffer,F.byteOffset,F.byteOffset+F.byteLength);return new Uint8Array(r)}c(W3,"CloneAsUint8Array");function h0(F){let r=F._queue.shift();return F._queueTotalSize-=r.size,F._queueTotalSize<0&&(F._queueTotalSize=0),r.value}c(h0,"DequeueValue");function r0(F,r,n){if(!f1(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(r0,"EnqueueValueWithSize");function c1(F){return F._queue.peek().value}c(c1,"PeekQueueValue");function kD(F){F._queue=new BD,F._queueTotalSize=0}c(kD,"ResetQueue");function K3(F){return F===DataView}c(K3,"isDataViewConstructor");function n1(F){return K3(F.constructor)}c(n1,"isDataView");function B1(F){return K3(F)?1:F.BYTES_PER_ELEMENT}c(B1,"arrayBufferViewElementSize");let s1=class{constructor(){throw TypeError("Illegal constructor")}get view(){if(!f0(this))throw t0("view");return this._view}respond(r){if(!f0(this))throw t0("respond");if(ZD(r,1,"respond"),r=i0(r,"First parameter"),this._associatedReadableByteStreamController===void 0)throw TypeError("This BYOB request has been invalidated");if(iu(this._view.buffer))throw TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");R2(this._associatedReadableByteStreamController,r)}respondWithNewView(r){if(!f0(this))throw t0("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(iu(r.buffer))throw TypeError("The given view's buffer has been detached and so cannot be used as a response");b2(this._associatedReadableByteStreamController,r)}};c(s1,"ReadableStreamBYOBRequest");let Uu=s1;Object.defineProperties(Uu.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),E(Uu.prototype.respond,"respond"),E(Uu.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Uu.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});let t1=class{constructor(){throw TypeError("Illegal constructor")}get byobRequest(){if(!Cu(this))throw vu("byobRequest");return s0(this)}get desiredSize(){if(!Cu(this))throw vu("desiredSize");return p3(this)}close(){if(!Cu(this))throw vu("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`);ku(this)}enqueue(r){if(!Cu(this))throw vu("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`);_2(this,r)}error(r=void 0){if(!Cu(this))throw vu("error");wD(this,r)}[R3](r){P3(this),kD(this);let n=this._cancelAlgorithm(r);return m2(this),n}[b3](r){let n=this._controlledReadableByteStream;if(this._queueTotalSize>0){d3(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(_)}y3(n,r),Eu(this)}[S3](){if(this._pendingPullIntos.length>0){let r=this._pendingPullIntos.peek();r.readerType="none",this._pendingPullIntos=new BD,this._pendingPullIntos.push(r)}}};c(t1,"ReadableByteStreamController");let vD=t1;Object.defineProperties(vD.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),E(vD.prototype.close,"close"),E(vD.prototype.enqueue,"enqueue"),E(vD.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(vD.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Cu(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_controlledReadableByteStream")?!1:F instanceof vD}c(Cu,"IsReadableByteStreamController");function f0(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_associatedReadableByteStreamController")?!1:F instanceof Uu}c(f0,"IsReadableStreamBYOBRequest");function Eu(F){if(!_1(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,Eu(F)),null),(n)=>(wD(F,n),null))}c(Eu,"ReadableByteStreamControllerCallPullIfNeeded");function P3(F){n0(F),F._pendingPullIntos=new BD}c(P3,"ReadableByteStreamControllerClearPendingPullIntos");function c0(F,r){let n=!1;F._state==="closed"&&(n=!0);let t=q3(r);r.readerType==="default"?E0(F,t,n):U1(F,t,n)}c(c0,"ReadableByteStreamControllerCommitPullIntoDescriptor");function q3(F){let{bytesFilled:r,elementSize:n}=F;return new F.viewConstructor(F.buffer,F.byteOffset,r/n)}c(q3,"ReadableByteStreamControllerConvertPullIntoDescriptor");function w2(F,r,n,t){F._queue.push({buffer:r,byteOffset:n,byteLength:t}),F._queueTotalSize+=t}c(w2,"ReadableByteStreamControllerEnqueueChunkToQueue");function g3(F,r,n,t){let w;try{w=z3(r,n,n+t)}catch(_){throw wD(F,_),_}w2(F,w,0,t)}c(g3,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function k3(F,r){r.bytesFilled>0&&g3(F,r.buffer,r.byteOffset,r.bytesFilled),Iu(F)}c(k3,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function v3(F,r){let n=Math.min(F._queueTotalSize,r.byteLength-r.bytesFilled),t=r.bytesFilled+n,w=n,_=!1,b=t%r.elementSize,U=t-b;U>=r.minimumFill&&(w=U-r.bytesFilled,_=!0);let I=F._queue;for(;w>0;){let N=I.peek(),Z=Math.min(w,N.byteLength),z=r.byteOffset+r.bytesFilled;Z3(r.buffer,z,N.buffer,N.byteOffset,Z),N.byteLength===Z?I.shift():(N.byteOffset+=Z,N.byteLength-=Z),F._queueTotalSize-=Z,j3(F,Z,r),w-=Z}return _}c(v3,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function j3(F,r,n){n.bytesFilled+=r}c(j3,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function O3(F){F._queueTotalSize===0&&F._closeRequested?(m2(F),xu(F._controlledReadableByteStream)):Eu(F)}c(O3,"ReadableByteStreamControllerHandleQueueDrain");function n0(F){F._byobRequest!==null&&(F._byobRequest._associatedReadableByteStreamController=void 0,F._byobRequest._view=null,F._byobRequest=null)}c(n0,"ReadableByteStreamControllerInvalidateBYOBRequest");function B0(F){for(;F._pendingPullIntos.length>0;){if(F._queueTotalSize===0)return;let r=F._pendingPullIntos.peek();v3(F,r)&&(Iu(F),c0(F._controlledReadableByteStream,r))}}c(B0,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function $1(F){let r=F._controlledReadableByteStream._reader;for(;r._readRequests.length>0;){if(F._queueTotalSize===0)return;let n=r._readRequests.shift();d3(F,n)}}c($1,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function A1(F,r,n,t){let w=F._controlledReadableByteStream,_=r.constructor,b=B1(_),{byteOffset:U,byteLength:I}=r,N=n*b,Z;try{Z=gD(r.buffer)}catch(O){t._errorSteps(O);return}let z={buffer:Z,bufferByteLength:Z.byteLength,byteOffset:U,byteLength:I,bytesFilled:0,minimumFill:N,elementSize:b,viewConstructor:_,readerType:"byob"};if(F._pendingPullIntos.length>0){F._pendingPullIntos.push(z),e3(w,t);return}if(w._state==="closed"){let O=new _(z.buffer,z.byteOffset,0);t._closeSteps(O);return}if(F._queueTotalSize>0){if(v3(F,z)){let O=q3(z);O3(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),e3(w,t),Eu(F)}c(A1,"ReadableByteStreamControllerPullInto");function w1(F,r){r.readerType==="none"&&Iu(F);let n=F._controlledReadableByteStream;if($0(n))for(;DF(n)>0;){let t=Iu(F);c0(n,t)}}c(w1,"ReadableByteStreamControllerRespondInClosedState");function m1(F,r,n){if(j3(F,r,n),n.readerType==="none"){k3(F,n),B0(F);return}if(n.bytesFilled<n.minimumFill)return;Iu(F);let t=n.bytesFilled%n.elementSize;if(t>0){let w=n.byteOffset+n.bytesFilled;g3(F,n.buffer,w-t,t)}n.bytesFilled-=t,c0(F._controlledReadableByteStream,n),B0(F)}c(m1,"ReadableByteStreamControllerRespondInReadableState");function o3(F,r){let n=F._pendingPullIntos.peek();n0(F),F._controlledReadableByteStream._state==="closed"?w1(F,n):m1(F,r,n),Eu(F)}c(o3,"ReadableByteStreamControllerRespondInternal");function Iu(F){return F._pendingPullIntos.shift()}c(Iu,"ReadableByteStreamControllerShiftPendingPullInto");function _1(F){let r=F._controlledReadableByteStream;return r._state!=="readable"||F._closeRequested||!F._started?!1:!!(J3(r)&&t2(r)>0||$0(r)&&DF(r)>0||p3(F)>0)}c(_1,"ReadableByteStreamControllerShouldCallPull");function m2(F){F._pullAlgorithm=void 0,F._cancelAlgorithm=void 0}c(m2,"ReadableByteStreamControllerClearAlgorithms");function ku(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}}m2(F),xu(r)}}c(ku,"ReadableByteStreamControllerClose");function _2(F,r){let n=F._controlledReadableByteStream;if(F._closeRequested||n._state!=="readable")return;let{buffer:t,byteOffset:w,byteLength:_}=r;if(iu(t))throw TypeError("chunk's buffer is detached and so cannot be enqueued");let b=gD(t);if(F._pendingPullIntos.length>0){let U=F._pendingPullIntos.peek();if(iu(U.buffer))throw TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");n0(F),U.buffer=gD(U.buffer),U.readerType==="none"&&k3(F,U)}if(J3(n))if($1(F),t2(n)===0)w2(F,b,w,_);else{F._pendingPullIntos.length>0&&Iu(F);let U=new Uint8Array(b,w,_);E0(n,U,!1)}else $0(n)?(w2(F,b,w,_),B0(F)):w2(F,b,w,_);Eu(F)}c(_2,"ReadableByteStreamControllerEnqueue");function wD(F,r){let n=F._controlledReadableByteStream;n._state==="readable"&&(P3(F),kD(F),m2(F),GF(n,r))}c(wD,"ReadableByteStreamControllerError");function d3(F,r){let n=F._queue.shift();F._queueTotalSize-=n.byteLength,O3(F);let t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);r._chunkSteps(t)}c(d3,"ReadableByteStreamControllerFillReadRequestFromQueue");function s0(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(Uu.prototype);b1(t,F,n),F._byobRequest=t}return F._byobRequest}c(s0,"ReadableByteStreamControllerGetBYOBRequest");function p3(F){let r=F._controlledReadableByteStream._state;return r==="errored"?null:r==="closed"?0:F._strategyHWM-F._queueTotalSize}c(p3,"ReadableByteStreamControllerGetDesiredSize");function R2(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=gD(n.buffer),o3(F,r)}c(R2,"ReadableByteStreamControllerRespond");function b2(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=gD(r.buffer),o3(F,t)}c(b2,"ReadableByteStreamControllerRespondWithNewView");function a3(F,r,n,t,w,_,b){r._controlledReadableByteStream=F,r._pullAgain=!1,r._pulling=!1,r._byobRequest=null,r._queue=r._queueTotalSize=void 0,kD(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 U=n();S(R(U),()=>(r._started=!0,Eu(r),null),(I)=>(wD(r,I),null))}c(a3,"SetUpReadableByteStreamController");function R1(F,r,n){let t=Object.create(vD.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((I)=>r.cancel(I),"cancelAlgorithm"):b=c(()=>R(void 0),"cancelAlgorithm");let U=r.autoAllocateChunkSize;if(U===0)throw TypeError("autoAllocateChunkSize must be greater than 0");a3(F,t,w,_,b,n,U)}c(R1,"SetUpReadableByteStreamControllerFromUnderlyingSource");function b1(F,r,n){F._associatedReadableByteStreamController=r,F._view=n}c(b1,"SetUpReadableStreamBYOBRequest");function t0(F){return TypeError(`ReadableStreamBYOBRequest.prototype.${F} can only be used on a ReadableStreamBYOBRequest`)}c(t0,"byobRequestBrandCheckException");function vu(F){return TypeError(`ReadableByteStreamController.prototype.${F} can only be used on a ReadableByteStreamController`)}c(vu,"byteStreamControllerBrandCheckException");function S1(F,r){lD(F,r);let n=F?.mode;return{mode:n===void 0?void 0:l1(n,`${r} has member 'mode' that`)}}c(S1,"convertReaderOptions");function l1(F,r){if(F=`${F}`,F!=="byob")throw TypeError(`${r} '${F}' is not a valid enumeration value for ReadableStreamReaderMode`);return F}c(l1,"convertReadableStreamReaderMode");function G1(F,r){var n;lD(F,r);let t=(n=F?.min)!==null&&n!==void 0?n:1;return{min:i0(t,`${r} has member 'min' that`)}}c(G1,"convertByobReadOptions");function x3(F){return new hu(F)}c(x3,"AcquireReadableStreamBYOBReader");function e3(F,r){F._reader._readIntoRequests.push(r)}c(e3,"ReadableStreamAddReadIntoRequest");function U1(F,r,n){let t=F._reader._readIntoRequests.shift();n?t._closeSteps(r):t._chunkSteps(r)}c(U1,"ReadableStreamFulfillReadIntoRequest");function DF(F){return F._reader._readIntoRequests.length}c(DF,"ReadableStreamGetNumReadIntoRequests");function $0(F){let r=F._reader;return!(r===void 0||!ru(r))}c($0,"ReadableStreamHasBYOBReader");let I1=class{constructor(r){if(ZD(r,1,"ReadableStreamBYOBReader"),C0(r,"First parameter"),dD(r))throw TypeError("This stream has already been locked for exclusive reading by another reader");if(!Cu(r._readableStreamController))throw TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");l3(this,r),this._readIntoRequests=new BD}get closed(){return ru(this)?this._closedPromise:m(S2("closed"))}cancel(r=void 0){return ru(this)?this._ownerReadableStream===void 0?m(s2("cancel")):x2(this,r):m(S2("cancel"))}read(r,n={}){if(!ru(this))return m(S2("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(iu(r.buffer))return m(TypeError("view's buffer has been detached"));let t;try{t=G1(n,"options")}catch(I){return m(I)}let w=t.min;if(w===0)return m(TypeError("options.min must be greater than 0"));if(n1(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(s2("read from"));let _,b,U=$((I,N)=>{_=I,b=N});return uF(this,r,w,{_chunkSteps:c((I)=>_({value:I,done:!1}),"_chunkSteps"),_closeSteps:c((I)=>_({value:I,done:!0}),"_closeSteps"),_errorSteps:c((I)=>b(I),"_errorSteps")}),U}releaseLock(){if(!ru(this))throw S2("releaseLock");this._ownerReadableStream!==void 0&&T1(this)}};c(I1,"ReadableStreamBYOBReader");let hu=I1;Object.defineProperties(hu.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),E(hu.prototype.cancel,"cancel"),E(hu.prototype.read,"read"),E(hu.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(hu.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function ru(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_readIntoRequests")?!1:F instanceof hu}c(ru,"IsReadableStreamBYOBReader");function uF(F,r,n,t){let w=F._ownerReadableStream;w._disturbed=!0,w._state==="errored"?t._errorSteps(w._storedError):A1(w._readableStreamController,r,n,t)}c(uF,"ReadableStreamBYOBReaderRead");function T1(F){YD(F);let r=TypeError("Reader was released");FF(F,r)}c(T1,"ReadableStreamBYOBReaderRelease");function FF(F,r){let n=F._readIntoRequests;F._readIntoRequests=new BD,n.forEach((t)=>{t._errorSteps(r)})}c(FF,"ReadableStreamBYOBReaderErrorReadIntoRequests");function S2(F){return TypeError(`ReadableStreamBYOBReader.prototype.${F} can only be used on a ReadableStreamBYOBReader`)}c(S2,"byobReaderBrandCheckException");function ju(F,r){let{highWaterMark:n}=F;if(n===void 0)return r;if(i1(n)||n<0)throw RangeError("Invalid highWaterMark");return n}c(ju,"ExtractHighWaterMark");function l2(F){let{size:r}=F;return r||(()=>1)}c(l2,"ExtractSizeAlgorithm");function G2(F,r){lD(F,r);let n=F?.highWaterMark,t=F?.size;return{highWaterMark:n===void 0?void 0:F0(n),size:t===void 0?void 0:y1(t,`${r} has member 'size' that`)}}c(G2,"convertQueuingStrategy");function y1(F,r){return AD(F,r),(n)=>F0(F(n))}c(y1,"convertQueuingStrategySize");function J1(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:N1(n,F,`${r} has member 'abort' that`),close:t===void 0?void 0:M1(t,F,`${r} has member 'close' that`),start:w===void 0?void 0:Q1(w,F,`${r} has member 'start' that`),write:b===void 0?void 0:L1(b,F,`${r} has member 'write' that`),type:_}}c(J1,"convertUnderlyingSink");function N1(F,r,n){return AD(F,n),(t)=>W(F,r,[t])}c(N1,"convertUnderlyingSinkAbortCallback");function M1(F,r,n){return AD(F,n),()=>W(F,r,[])}c(M1,"convertUnderlyingSinkCloseCallback");function Q1(F,r,n){return AD(F,n),(t)=>Q(F,r,[t])}c(Q1,"convertUnderlyingSinkStartCallback");function L1(F,r,n){return AD(F,n),(t,w)=>W(F,r,[t,w])}c(L1,"convertUnderlyingSinkWriteCallback");function iF(F,r){if(!Tu(F))throw TypeError(`${r} is not a WritableStream.`)}c(iF,"assertWritableStream");function X1(F){if(typeof F!="object"||F===null)return!1;try{return typeof F.aborted=="boolean"}catch{return!1}}c(X1,"isAbortSignal");let x7=typeof AbortController=="function";function Y1(){if(x7)return new AbortController}c(Y1,"createAbortController");let Z1=class{constructor(r={},n={}){r===void 0?r=null:I3(r,"First parameter");let t=G2(n,"Second parameter"),w=J1(r,"First parameter");if(EF(this),w.type!==void 0)throw RangeError("Invalid type is specified");let _=l2(t),b=ju(t,1);x1(this,w,b,_)}get locked(){if(!Tu(this))throw J2("locked");return yu(this)}abort(r=void 0){return Tu(this)?yu(this)?m(TypeError("Cannot abort a stream that already has a writer")):U2(this,r):m(J2("abort"))}close(){return Tu(this)?yu(this)?m(TypeError("Cannot close a stream that already has a writer")):GD(this)?m(TypeError("Cannot close an already-closing stream")):hF(this):m(J2("close"))}getWriter(){if(!Tu(this))throw J2("getWriter");return CF(this)}};c(Z1,"WritableStream");let fu=Z1;Object.defineProperties(fu.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),E(fu.prototype.abort,"abort"),E(fu.prototype.close,"close"),E(fu.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(fu.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function CF(F){return new jD(F)}c(CF,"AcquireWritableStreamDefaultWriter");function z1(F,r,n,t,w=1,_=()=>1){let b=Object.create(fu.prototype);EF(b);let U=Object.create(Ou.prototype);return BF(b,U,F,r,n,t,w,_),b}c(z1,"CreateWritableStream");function EF(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(EF,"InitializeWritableStream");function Tu(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_writableStreamController")?!1:F instanceof fu}c(Tu,"IsWritableStream");function yu(F){return F._writer!==void 0}c(yu,"IsWritableStreamLocked");function U2(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,U)=>{F._pendingAbortRequest={_promise:void 0,_resolve:b,_reject:U,_reason:r,_wasAlreadyErroring:w}});return F._pendingAbortRequest._promise=_,w||w0(F,r),_}c(U2,"WritableStreamAbort");function hF(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"&&U0(t),e1(F._writableStreamController),n}c(hF,"WritableStreamClose");function V1(F){return $((r,n)=>{let t={_resolve:r,_reject:n};F._writeRequests.push(t)})}c(V1,"WritableStreamAddWriteRequest");function A0(F,r){if(F._state==="writable"){w0(F,r);return}m0(F)}c(A0,"WritableStreamDealWithRejection");function w0(F,r){let n=F._writableStreamController;F._state="erroring",F._storedError=r;let t=F._writer;t!==void 0&&fF(t,r),!q1(F)&&n._started&&m0(F)}c(w0,"WritableStreamStartErroring");function m0(F){F._state="errored",F._writableStreamController[k8]();let r=F._storedError;if(F._writeRequests.forEach((w)=>{w._reject(r)}),F._writeRequests=new BD,F._pendingAbortRequest===void 0){I2(F);return}let n=F._pendingAbortRequest;if(F._pendingAbortRequest=void 0,n._wasAlreadyErroring){n._reject(r),I2(F);return}let t=F._writableStreamController[g8](n._reason);S(t,()=>(n._resolve(),I2(F),null),(w)=>(n._reject(w),I2(F),null))}c(m0,"WritableStreamFinishErroring");function H1(F){F._inFlightWriteRequest._resolve(void 0),F._inFlightWriteRequest=void 0}c(H1,"WritableStreamFinishInFlightWrite");function W1(F,r){F._inFlightWriteRequest._reject(r),F._inFlightWriteRequest=void 0,A0(F,r)}c(W1,"WritableStreamFinishInFlightWriteWithError");function K1(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&&AF(r)}c(K1,"WritableStreamFinishInFlightClose");function P1(F,r){F._inFlightCloseRequest._reject(r),F._inFlightCloseRequest=void 0,F._pendingAbortRequest!==void 0&&(F._pendingAbortRequest._reject(r),F._pendingAbortRequest=void 0),A0(F,r)}c(P1,"WritableStreamFinishInFlightCloseWithError");function GD(F){return!(F._closeRequest===void 0&&F._inFlightCloseRequest===void 0)}c(GD,"WritableStreamCloseQueuedOrInFlight");function q1(F){return!(F._inFlightWriteRequest===void 0&&F._inFlightCloseRequest===void 0)}c(q1,"WritableStreamHasOperationMarkedInFlight");function g1(F){F._inFlightCloseRequest=F._closeRequest,F._closeRequest=void 0}c(g1,"WritableStreamMarkCloseRequestInFlight");function k1(F){F._inFlightWriteRequest=F._writeRequests.shift()}c(k1,"WritableStreamMarkFirstWriteRequestInFlight");function I2(F){F._closeRequest!==void 0&&(F._closeRequest._reject(F._storedError),F._closeRequest=void 0);let r=F._writer;r!==void 0&&l0(r,F._storedError)}c(I2,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function _0(F,r){let n=F._writer;n!==void 0&&r!==F._backpressure&&(r?h6(n):U0(n)),F._backpressure=r}c(_0,"WritableStreamUpdateBackpressure");let v1=class{constructor(r){if(ZD(r,1,"WritableStreamDefaultWriter"),iF(r,"First parameter"),yu(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")!GD(r)&&r._backpressure?M2(this):wF(this),N2(this);else if(n==="erroring")G0(this,r._storedError),N2(this);else if(n==="closed")wF(this),C6(this);else{let t=r._storedError;G0(this,t),$F(this,t)}}get closed(){return cu(this)?this._closedPromise:m(nu("closed"))}get desiredSize(){if(!cu(this))throw nu("desiredSize");if(this._ownerWritableStream===void 0)throw du("desiredSize");return d1(this)}get ready(){return cu(this)?this._readyPromise:m(nu("ready"))}abort(r=void 0){return cu(this)?this._ownerWritableStream===void 0?m(du("abort")):j1(this,r):m(nu("abort"))}close(){if(!cu(this))return m(nu("close"));let r=this._ownerWritableStream;return r===void 0?m(du("close")):GD(r)?m(TypeError("Cannot close an already-closing stream")):rF(this)}releaseLock(){if(!cu(this))throw nu("releaseLock");this._ownerWritableStream!==void 0&&cF(this)}write(r=void 0){return cu(this)?this._ownerWritableStream===void 0?m(du("write to")):nF(this,r):m(nu("write"))}};c(v1,"WritableStreamDefaultWriter");let jD=v1;Object.defineProperties(jD.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),E(jD.prototype.abort,"abort"),E(jD.prototype.close,"close"),E(jD.prototype.releaseLock,"releaseLock"),E(jD.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(jD.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function cu(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_ownerWritableStream")?!1:F instanceof jD}c(cu,"IsWritableStreamDefaultWriter");function j1(F,r){let n=F._ownerWritableStream;return U2(n,r)}c(j1,"WritableStreamDefaultWriterAbort");function rF(F){let r=F._ownerWritableStream;return hF(r)}c(rF,"WritableStreamDefaultWriterClose");function O1(F){let r=F._ownerWritableStream,n=r._state;return GD(r)||n==="closed"?R(void 0):n==="errored"?m(r._storedError):rF(F)}c(O1,"WritableStreamDefaultWriterCloseWithErrorPropagation");function o1(F,r){F._closedPromiseState==="pending"?l0(F,r):E6(F,r)}c(o1,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function fF(F,r){F._readyPromiseState==="pending"?mF(F,r):r6(F,r)}c(fF,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function d1(F){let r=F._ownerWritableStream,n=r._state;return n==="errored"||n==="erroring"?null:n==="closed"?0:sF(r._writableStreamController)}c(d1,"WritableStreamDefaultWriterGetDesiredSize");function cF(F){let r=F._ownerWritableStream,n=TypeError("Writer was released and can no longer be used to monitor the stream's closedness");fF(F,n),o1(F,n),r._writer=void 0,F._ownerWritableStream=void 0}c(cF,"WritableStreamDefaultWriterRelease");function nF(F,r){let n=F._ownerWritableStream,t=n._writableStreamController,w=D6(t,r);if(n!==F._ownerWritableStream)return m(du("write to"));let _=n._state;if(_==="errored")return m(n._storedError);if(GD(n)||_==="closed")return m(TypeError("The stream is closing or closed and cannot be written to"));if(_==="erroring")return m(n._storedError);let b=V1(n);return u6(t,r,w),b}c(nF,"WritableStreamDefaultWriterWrite");let p1={},a1=class{constructor(){throw TypeError("Illegal constructor")}get abortReason(){if(!R0(this))throw S0("abortReason");return this._abortReason}get signal(){if(!R0(this))throw S0("signal");if(this._abortController===void 0)throw TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(r=void 0){if(!R0(this))throw S0("error");this._controlledWritableStream._state==="writable"&&tF(this,r)}[g8](r){let n=this._abortAlgorithm(r);return T2(this),n}[k8](){kD(this)}};c(a1,"WritableStreamDefaultController");let Ou=a1;Object.defineProperties(Ou.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ou.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function R0(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_controlledWritableStream")?!1:F instanceof Ou}c(R0,"IsWritableStreamDefaultController");function BF(F,r,n,t,w,_,b,U){r._controlledWritableStream=F,F._writableStreamController=r,r._queue=void 0,r._queueTotalSize=void 0,kD(r),r._abortReason=void 0,r._abortController=Y1(),r._started=!1,r._strategySizeAlgorithm=U,r._strategyHWM=b,r._writeAlgorithm=t,r._closeAlgorithm=w,r._abortAlgorithm=_;let I=b0(r);_0(F,I);let N=n(),Z=R(N);S(Z,()=>(r._started=!0,y2(r),null),(z)=>(r._started=!0,A0(F,z),null))}c(BF,"SetUpWritableStreamDefaultController");function x1(F,r,n,t){let w=Object.create(Ou.prototype),_,b,U,I;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?U=c(()=>r.close(),"closeAlgorithm"):U=c(()=>R(void 0),"closeAlgorithm"),r.abort!==void 0?I=c((N)=>r.abort(N),"abortAlgorithm"):I=c(()=>R(void 0),"abortAlgorithm"),BF(F,w,_,b,U,I,n,t)}c(x1,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function T2(F){F._writeAlgorithm=void 0,F._closeAlgorithm=void 0,F._abortAlgorithm=void 0,F._strategySizeAlgorithm=void 0}c(T2,"WritableStreamDefaultControllerClearAlgorithms");function e1(F){r0(F,p1,0),y2(F)}c(e1,"WritableStreamDefaultControllerClose");function D6(F,r){try{return F._strategySizeAlgorithm(r)}catch(n){return ou(F,n),1}}c(D6,"WritableStreamDefaultControllerGetChunkSize");function sF(F){return F._strategyHWM-F._queueTotalSize}c(sF,"WritableStreamDefaultControllerGetDesiredSize");function u6(F,r,n){try{r0(F,r,n)}catch(w){ou(F,w);return}let t=F._controlledWritableStream;if(!GD(t)&&t._state==="writable"){let w=b0(F);_0(t,w)}y2(F)}c(u6,"WritableStreamDefaultControllerWrite");function y2(F){let r=F._controlledWritableStream;if(!F._started||r._inFlightWriteRequest!==void 0)return;if(r._state==="erroring"){m0(r);return}if(F._queue.length===0)return;let n=c1(F);n===p1?F6(F):i6(F,n)}c(y2,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function ou(F,r){F._controlledWritableStream._state==="writable"&&tF(F,r)}c(ou,"WritableStreamDefaultControllerErrorIfNeeded");function F6(F){let r=F._controlledWritableStream;g1(r),h0(F);let n=F._closeAlgorithm();T2(F),S(n,()=>(K1(r),null),(t)=>(P1(r,t),null))}c(F6,"WritableStreamDefaultControllerProcessClose");function i6(F,r){let n=F._controlledWritableStream;k1(n);let t=F._writeAlgorithm(r);S(t,()=>{H1(n);let w=n._state;if(h0(F),!GD(n)&&w==="writable"){let _=b0(F);_0(n,_)}return y2(F),null},(w)=>(n._state==="writable"&&T2(F),W1(n,w),null))}c(i6,"WritableStreamDefaultControllerProcessWrite");function b0(F){return sF(F)<=0}c(b0,"WritableStreamDefaultControllerGetBackpressure");function tF(F,r){let n=F._controlledWritableStream;T2(F),w0(n,r)}c(tF,"WritableStreamDefaultControllerError");function J2(F){return TypeError(`WritableStream.prototype.${F} can only be used on a WritableStream`)}c(J2,"streamBrandCheckException$2");function S0(F){return TypeError(`WritableStreamDefaultController.prototype.${F} can only be used on a WritableStreamDefaultController`)}c(S0,"defaultControllerBrandCheckException$2");function nu(F){return TypeError(`WritableStreamDefaultWriter.prototype.${F} can only be used on a WritableStreamDefaultWriter`)}c(nu,"defaultWriterBrandCheckException");function du(F){return TypeError("Cannot "+F+" a stream using a released writer")}c(du,"defaultWriterLockException");function N2(F){F._closedPromise=$((r,n)=>{F._closedPromise_resolve=r,F._closedPromise_reject=n,F._closedPromiseState="pending"})}c(N2,"defaultWriterClosedPromiseInitialize");function $F(F,r){N2(F),l0(F,r)}c($F,"defaultWriterClosedPromiseInitializeAsRejected");function C6(F){N2(F),AF(F)}c(C6,"defaultWriterClosedPromiseInitializeAsResolved");function l0(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(l0,"defaultWriterClosedPromiseReject");function E6(F,r){$F(F,r)}c(E6,"defaultWriterClosedPromiseResetToRejected");function AF(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(AF,"defaultWriterClosedPromiseResolve");function M2(F){F._readyPromise=$((r,n)=>{F._readyPromise_resolve=r,F._readyPromise_reject=n}),F._readyPromiseState="pending"}c(M2,"defaultWriterReadyPromiseInitialize");function G0(F,r){M2(F),mF(F,r)}c(G0,"defaultWriterReadyPromiseInitializeAsRejected");function wF(F){M2(F),U0(F)}c(wF,"defaultWriterReadyPromiseInitializeAsResolved");function mF(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(mF,"defaultWriterReadyPromiseReject");function h6(F){M2(F)}c(h6,"defaultWriterReadyPromiseReset");function r6(F,r){G0(F,r)}c(r6,"defaultWriterReadyPromiseResetToRejected");function U0(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(U0,"defaultWriterReadyPromiseResolve");function f6(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof r8<"u")return r8}c(f6,"getGlobals");let e7=f6();function c6(F){if(!(typeof F=="function"||typeof F=="object")||F.name!=="DOMException")return!1;try{return new F,!0}catch{return!1}}c(c6,"isDOMExceptionConstructor");function n6(){let F=e7?.DOMException;return c6(F)?F:void 0}c(n6,"getFromGlobal");function B6(){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(B6,"createPolyfill");let DE=n6()||B6();function _F(F,r,n,t,w,_){let b=Gu(F),U=CF(r);F._disturbed=!0;let I=!1,N=R(void 0);return $((Z,z)=>{let O;if(_!==void 0){if(O=c(()=>{let T=_.reason!==void 0?_.reason:new DE("Aborted","AbortError"),H=[];t||H.push(()=>r._state==="writable"?U2(r,T):R(void 0)),w||H.push(()=>F._state==="readable"?bD(F,T):R(void 0)),fD(()=>Promise.all(H.map((j)=>j())),!0,T)},"abortAlgorithm"),_.aborted){O();return}_.addEventListener("abort",O)}function sD(){return $((T,H)=>{function j(cD){cD?T():l(pD(),j,H)}c(j,"next"),j(!1)})}c(sD,"pipeLoop");function pD(){return I?R(!0):l(U._readyPromise,()=>$((T,H)=>{qu(b,{_chunkSteps:c((j)=>{N=l(nF(U,j),void 0,C),T(!1)},"_chunkSteps"),_closeSteps:c(()=>T(!0),"_closeSteps"),_errorSteps:H})}))}if(c(pD,"pipeStep"),SD(F,b._closedPromise,(T)=>(t?tD(!0,T):fD(()=>U2(r,T),!0,T),null)),SD(r,U._closedPromise,(T)=>(w?tD(!0,T):fD(()=>bD(F,T),!0,T),null)),FD(F,b._closedPromise,()=>(n?tD():fD(()=>O1(U)),null)),GD(r)||r._state==="closed"){let T=TypeError("the destination writable stream closed before all data could be piped to it");w?tD(!0,T):fD(()=>bD(F,T),!0,T)}L(sD());function UD(){let T=N;return l(N,()=>T!==N?UD():void 0)}c(UD,"waitForWritesToFinish");function SD(T,H,j){T._state==="errored"?j(T._storedError):J(H,j)}c(SD,"isOrBecomesErrored");function FD(T,H,j){T._state==="closed"?j():y(H,j)}c(FD,"isOrBecomesClosed");function fD(T,H,j){if(I)return;I=!0,r._state==="writable"&&!GD(r)?y(UD(),cD):cD();function cD(){return S(T(),()=>aD(H,j),($u)=>aD(!0,$u)),null}c(cD,"doTheRest")}c(fD,"shutdownWithAction");function tD(T,H){I||(I=!0,r._state==="writable"&&!GD(r)?y(UD(),()=>aD(T,H)):aD(T,H))}c(tD,"shutdown");function aD(T,H){return cF(U),YD(b),_!==void 0&&_.removeEventListener("abort",O),T?z(H):Z(void 0),null}c(aD,"finalize")})}c(_F,"ReadableStreamPipeTo");let s6=class{constructor(){throw TypeError("Illegal constructor")}get desiredSize(){if(!Q2(this))throw X2("desiredSize");return I0(this)}close(){if(!Q2(this))throw X2("close");if(!Nu(this))throw TypeError("The stream is not in a state that permits close");Bu(this)}enqueue(r=void 0){if(!Q2(this))throw X2("enqueue");if(!Nu(this))throw TypeError("The stream is not in a state that permits enqueue");return Ju(this,r)}error(r=void 0){if(!Q2(this))throw X2("error");RD(this,r)}[R3](r){kD(this);let n=this._cancelAlgorithm(r);return L2(this),n}[b3](r){let n=this._controlledReadableStream;if(this._queue.length>0){let t=h0(this);this._closeRequested&&this._queue.length===0?(L2(this),xu(n)):pu(this),r._chunkSteps(t)}else y3(n,r),pu(this)}[S3](){}};c(s6,"ReadableStreamDefaultController");let OD=s6;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 Q2(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_controlledReadableStream")?!1:F instanceof OD}c(Q2,"IsReadableStreamDefaultController");function pu(F){if(!RF(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,pu(F)),null),(n)=>(RD(F,n),null))}c(pu,"ReadableStreamDefaultControllerCallPullIfNeeded");function RF(F){let r=F._controlledReadableStream;return!Nu(F)||!F._started?!1:!!(dD(r)&&t2(r)>0||I0(F)>0)}c(RF,"ReadableStreamDefaultControllerShouldCallPull");function L2(F){F._pullAlgorithm=void 0,F._cancelAlgorithm=void 0,F._strategySizeAlgorithm=void 0}c(L2,"ReadableStreamDefaultControllerClearAlgorithms");function Bu(F){if(!Nu(F))return;let r=F._controlledReadableStream;F._closeRequested=!0,F._queue.length===0&&(L2(F),xu(r))}c(Bu,"ReadableStreamDefaultControllerClose");function Ju(F,r){if(!Nu(F))return;let n=F._controlledReadableStream;if(dD(n)&&t2(n)>0)E0(n,r,!1);else{let t;try{t=F._strategySizeAlgorithm(r)}catch(w){throw RD(F,w),w}try{r0(F,r,t)}catch(w){throw RD(F,w),w}}pu(F)}c(Ju,"ReadableStreamDefaultControllerEnqueue");function RD(F,r){let n=F._controlledReadableStream;n._state==="readable"&&(kD(F),L2(F),GF(n,r))}c(RD,"ReadableStreamDefaultControllerError");function I0(F){let r=F._controlledReadableStream._state;return r==="errored"?null:r==="closed"?0:F._strategyHWM-F._queueTotalSize}c(I0,"ReadableStreamDefaultControllerGetDesiredSize");function t6(F){return!RF(F)}c(t6,"ReadableStreamDefaultControllerHasBackpressure");function Nu(F){let r=F._controlledReadableStream._state;return!F._closeRequested&&r==="readable"}c(Nu,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function bF(F,r,n,t,w,_,b){r._controlledReadableStream=F,r._queue=void 0,r._queueTotalSize=void 0,kD(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 U=n();S(R(U),()=>(r._started=!0,pu(r),null),(I)=>(RD(r,I),null))}c(bF,"SetUpReadableStreamDefaultController");function $6(F,r,n,t){let w=Object.create(OD.prototype),_,b,U;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?U=c((I)=>r.cancel(I),"cancelAlgorithm"):U=c(()=>R(void 0),"cancelAlgorithm"),bF(F,w,_,b,U,n,t)}c($6,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function X2(F){return TypeError(`ReadableStreamDefaultController.prototype.${F} can only be used on a ReadableStreamDefaultController`)}c(X2,"defaultControllerBrandCheckException$1");function A6(F,r){return Cu(F._readableStreamController)?m6(F):w6(F)}c(A6,"ReadableStreamTee");function w6(F,r){let n=Gu(F),t=!1,w=!1,_=!1,b=!1,U,I,N,Z,z,O=$((FD)=>{z=FD});function sD(){return t?(w=!0,R(void 0)):(t=!0,qu(n,{_chunkSteps:c((FD)=>{v(()=>{w=!1;let fD=FD,tD=FD;_||Ju(N._readableStreamController,fD),b||Ju(Z._readableStreamController,tD),t=!1,w&&sD()})},"_chunkSteps"),_closeSteps:c(()=>{t=!1,_||Bu(N._readableStreamController),b||Bu(Z._readableStreamController),(!_||!b)&&z(void 0)},"_closeSteps"),_errorSteps:c(()=>{t=!1},"_errorSteps")}),R(void 0))}c(sD,"pullAlgorithm");function pD(FD){if(_=!0,U=FD,b){let fD=gu([U,I]),tD=bD(F,fD);z(tD)}return O}c(pD,"cancel1Algorithm");function UD(FD){if(b=!0,I=FD,_){let fD=gu([U,I]),tD=bD(F,fD);z(tD)}return O}c(UD,"cancel2Algorithm");function SD(){}return c(SD,"startAlgorithm"),N=au(SD,sD,pD),Z=au(SD,sD,UD),J(n._closedPromise,(FD)=>(RD(N._readableStreamController,FD),RD(Z._readableStreamController,FD),(!_||!b)&&z(void 0),null)),[N,Z]}c(w6,"ReadableStreamDefaultTee");function m6(F){let r=Gu(F),n=!1,t=!1,w=!1,_=!1,b=!1,U,I,N,Z,z,O=$((T)=>{z=T});function sD(T){J(T._closedPromise,(H)=>(T!==r||(wD(N._readableStreamController,H),wD(Z._readableStreamController,H),(!_||!b)&&z(void 0)),null))}c(sD,"forwardReaderError");function pD(){ru(r)&&(YD(r),r=Gu(F),sD(r)),qu(r,{_chunkSteps:c((T)=>{v(()=>{t=!1,w=!1;let H=T,j=T;if(!_&&!b)try{j=W3(T)}catch(cD){wD(N._readableStreamController,cD),wD(Z._readableStreamController,cD),z(bD(F,cD));return}_||_2(N._readableStreamController,H),b||_2(Z._readableStreamController,j),n=!1,t?SD():w&&FD()})},"_chunkSteps"),_closeSteps:c(()=>{n=!1,_||ku(N._readableStreamController),b||ku(Z._readableStreamController),N._readableStreamController._pendingPullIntos.length>0&&R2(N._readableStreamController,0),Z._readableStreamController._pendingPullIntos.length>0&&R2(Z._readableStreamController,0),(!_||!b)&&z(void 0)},"_closeSteps"),_errorSteps:c(()=>{n=!1},"_errorSteps")})}c(pD,"pullWithDefaultReader");function UD(T,H){qD(r)&&(YD(r),r=x3(F),sD(r));let j=H?Z:N,cD=H?N:Z;uF(r,T,1,{_chunkSteps:c(($u)=>{v(()=>{t=!1,w=!1;let eu=H?b:_;if(H?_:b)eu||b2(j._readableStreamController,$u);else{let D2;try{D2=W3($u)}catch(YF){wD(j._readableStreamController,YF),wD(cD._readableStreamController,YF),z(bD(F,YF));return}eu||b2(j._readableStreamController,$u),_2(cD._readableStreamController,D2)}n=!1,t?SD():w&&FD()})},"_chunkSteps"),_closeSteps:c(($u)=>{n=!1;let eu=H?b:_,D2=H?_:b;eu||ku(j._readableStreamController),D2||ku(cD._readableStreamController),$u!==void 0&&(eu||b2(j._readableStreamController,$u),!D2&&cD._readableStreamController._pendingPullIntos.length>0&&R2(cD._readableStreamController,0)),(!eu||!D2)&&z(void 0)},"_closeSteps"),_errorSteps:c(()=>{n=!1},"_errorSteps")})}c(UD,"pullWithBYOBReader");function SD(){if(n)return t=!0,R(void 0);n=!0;let T=s0(N._readableStreamController);return T===null?pD():UD(T._view,!1),R(void 0)}c(SD,"pull1Algorithm");function FD(){if(n)return w=!0,R(void 0);n=!0;let T=s0(Z._readableStreamController);return T===null?pD():UD(T._view,!0),R(void 0)}c(FD,"pull2Algorithm");function fD(T){if(_=!0,U=T,b){let H=gu([U,I]),j=bD(F,H);z(j)}return O}c(fD,"cancel1Algorithm");function tD(T){if(b=!0,I=T,_){let H=gu([U,I]),j=bD(F,H);z(j)}return O}c(tD,"cancel2Algorithm");function aD(){}return c(aD,"startAlgorithm"),N=lF(aD,SD,fD),Z=lF(aD,FD,tD),sD(r),[N,Z]}c(m6,"ReadableByteStreamTee");function _6(F){return h(F)&&typeof F.getReader<"u"}c(_6,"isReadableStreamLike");function R6(F){return _6(F)?S6(F.getReader()):b6(F)}c(R6,"ReadableStreamFrom");function b6(F){let r,n=H3(F,"async"),t=C;function w(){let b;try{b=E1(n)}catch(I){return m(I)}let U=R(b);return M(U,(I)=>{if(!h(I))throw TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(h1(I))Bu(r._readableStreamController);else{let N=r1(I);Ju(r._readableStreamController,N)}})}c(w,"pullAlgorithm");function _(b){let U=n.iterator,I;try{I=A2(U,"return")}catch(z){return m(z)}if(I===void 0)return R(void 0);let N;try{N=Q(I,U,[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=au(t,w,_,0),r}c(b6,"ReadableStreamFromIterable");function S6(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)Bu(r._readableStreamController);else{let U=b.value;Ju(r._readableStreamController,U)}})}c(t,"pullAlgorithm");function w(_){try{return R(F.cancel(_))}catch(b){return m(b)}}return c(w,"cancelAlgorithm"),r=au(n,t,w,0),r}c(S6,"ReadableStreamFromDefaultReader");function l6(F,r){lD(F,r);let n=F,t=n?.autoAllocateChunkSize,w=n?.cancel,_=n?.pull,b=n?.start,U=n?.type;return{autoAllocateChunkSize:t===void 0?void 0:i0(t,`${r} has member 'autoAllocateChunkSize' that`),cancel:w===void 0?void 0:G6(w,n,`${r} has member 'cancel' that`),pull:_===void 0?void 0:U6(_,n,`${r} has member 'pull' that`),start:b===void 0?void 0:I6(b,n,`${r} has member 'start' that`),type:U===void 0?void 0:T6(U,`${r} has member 'type' that`)}}c(l6,"convertUnderlyingDefaultOrByteSource");function G6(F,r,n){return AD(F,n),(t)=>W(F,r,[t])}c(G6,"convertUnderlyingSourceCancelCallback");function U6(F,r,n){return AD(F,n),(t)=>W(F,r,[t])}c(U6,"convertUnderlyingSourcePullCallback");function I6(F,r,n){return AD(F,n),(t)=>Q(F,r,[t])}c(I6,"convertUnderlyingSourceStartCallback");function T6(F,r){if(F=`${F}`,F!=="bytes")throw TypeError(`${r} '${F}' is not a valid enumeration value for ReadableStreamType`);return F}c(T6,"convertReadableStreamType");function y6(F,r){return lD(F,r),{preventCancel:!!F?.preventCancel}}c(y6,"convertIteratorOptions");function SF(F,r){lD(F,r);let n=F?.preventAbort,t=F?.preventCancel,w=F?.preventClose,_=F?.signal;return _!==void 0&&J6(_,`${r} has member 'signal' that`),{preventAbort:!!n,preventCancel:!!t,preventClose:!!w,signal:_}}c(SF,"convertPipeOptions");function J6(F,r){if(!X1(F))throw TypeError(`${r} is not an AbortSignal.`)}c(J6,"assertAbortSignal");function N6(F,r){lD(F,r);let n=F?.readable;u0(n,"readable","ReadableWritablePair"),C0(n,`${r} has member 'readable' that`);let t=F?.writable;return u0(t,"writable","ReadableWritablePair"),iF(t,`${r} has member 'writable' that`),{readable:n,writable:t}}c(N6,"convertReadableWritablePair");let M6=class{constructor(r={},n={}){r===void 0?r=null:I3(r,"First parameter");let t=G2(n,"Second parameter"),w=l6(r,"First parameter");if(T0(this),w.type==="bytes"){if(t.size!==void 0)throw RangeError("The strategy for a byte stream cannot have a size function");let _=ju(t,0);R1(this,w,_)}else{let _=l2(t),b=ju(t,1);$6(this,w,b,_)}}get locked(){if(!oD(this))throw su("locked");return dD(this)}cancel(r=void 0){return oD(this)?dD(this)?m(TypeError("Cannot cancel a stream that already has a reader")):bD(this,r):m(su("cancel"))}getReader(r=void 0){if(!oD(this))throw su("getReader");return S1(r,"First parameter").mode===void 0?Gu(this):x3(this)}pipeThrough(r,n={}){if(!oD(this))throw su("pipeThrough");ZD(r,1,"pipeThrough");let t=N6(r,"First parameter"),w=SF(n,"Second parameter");if(dD(this))throw TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(yu(t.writable))throw TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let _=_F(this,t.writable,w.preventClose,w.preventAbort,w.preventCancel,w.signal);return L(_),t.readable}pipeTo(r,n={}){if(!oD(this))return m(su("pipeTo"));if(r===void 0)return m("Parameter 1 is required in 'pipeTo'.");if(!Tu(r))return m(TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let t;try{t=SF(n,"Second parameter")}catch(w){return m(w)}return dD(this)?m(TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):yu(r)?m(TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):_F(this,r,t.preventClose,t.preventAbort,t.preventCancel,t.signal)}tee(){if(!oD(this))throw su("tee");let r=A6(this);return gu(r)}values(r=void 0){if(!oD(this))throw su("values");let n=y6(r,"First parameter");return F1(this,n.preventCancel)}[V3](r){return this.values(r)}static from(r){return R6(r)}};c(M6,"ReadableStream");let hD=M6;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,V3,{value:hD.prototype.values,writable:!0,configurable:!0});function au(F,r,n,t=1,w=()=>1){let _=Object.create(hD.prototype);T0(_);let b=Object.create(OD.prototype);return bF(_,b,F,r,n,t,w),_}c(au,"CreateReadableStream");function lF(F,r,n){let t=Object.create(hD.prototype);T0(t);let w=Object.create(vD.prototype);return a3(t,w,F,r,n,0,void 0),t}c(lF,"CreateReadableByteStream");function T0(F){F._state="readable",F._reader=void 0,F._storedError=void 0,F._disturbed=!1}c(T0,"InitializeReadableStream");function oD(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_readableStreamController")?!1:F instanceof hD}c(oD,"IsReadableStream");function dD(F){return F._reader!==void 0}c(dD,"IsReadableStreamLocked");function bD(F,r){if(F._disturbed=!0,F._state==="closed")return R(void 0);if(F._state==="errored")return m(F._storedError);xu(F);let n=F._reader;if(n!==void 0&&ru(n)){let w=n._readIntoRequests;n._readIntoRequests=new BD,w.forEach((_)=>{_._closeSteps(void 0)})}let t=F._readableStreamController[R3](r);return M(t,C)}c(bD,"ReadableStreamCancel");function xu(F){F._state="closed";let r=F._reader;if(r!==void 0&&(U3(r),qD(r))){let n=r._readRequests;r._readRequests=new BD,n.forEach((t)=>{t._closeSteps()})}}c(xu,"ReadableStreamClose");function GF(F,r){F._state="errored",F._storedError=r;let n=F._reader;n!==void 0&&(D0(n,r),qD(n)?N3(n,r):FF(n,r))}c(GF,"ReadableStreamError");function su(F){return TypeError(`ReadableStream.prototype.${F} can only be used on a ReadableStream`)}c(su,"streamBrandCheckException$1");function UF(F,r){lD(F,r);let n=F?.highWaterMark;return u0(n,"highWaterMark","QueuingStrategyInit"),{highWaterMark:F0(n)}}c(UF,"convertQueuingStrategyInit");let Q6=c((F)=>F.byteLength,"byteLengthSizeFunction");E(Q6,"size");let L6=class{constructor(r){ZD(r,1,"ByteLengthQueuingStrategy"),r=UF(r,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!TF(this))throw IF("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!TF(this))throw IF("size");return Q6}};c(L6,"ByteLengthQueuingStrategy");let y0=L6;Object.defineProperties(y0.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(y0.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function IF(F){return TypeError(`ByteLengthQueuingStrategy.prototype.${F} can only be used on a ByteLengthQueuingStrategy`)}c(IF,"byteLengthBrandCheckException");function TF(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_byteLengthQueuingStrategyHighWaterMark")?!1:F instanceof y0}c(TF,"IsByteLengthQueuingStrategy");let X6=c(()=>1,"countSizeFunction");E(X6,"size");let Y6=class{constructor(r){ZD(r,1,"CountQueuingStrategy"),r=UF(r,"First parameter"),this._countQueuingStrategyHighWaterMark=r.highWaterMark}get highWaterMark(){if(!JF(this))throw yF("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!JF(this))throw yF("size");return X6}};c(Y6,"CountQueuingStrategy");let J0=Y6;Object.defineProperties(J0.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(J0.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function yF(F){return TypeError(`CountQueuingStrategy.prototype.${F} can only be used on a CountQueuingStrategy`)}c(yF,"countBrandCheckException");function JF(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_countQueuingStrategyHighWaterMark")?!1:F instanceof J0}c(JF,"IsCountQueuingStrategy");function Z6(F,r){lD(F,r);let n=F?.cancel,t=F?.flush,w=F?.readableType,_=F?.start,b=F?.transform,U=F?.writableType;return{cancel:n===void 0?void 0:W6(n,F,`${r} has member 'cancel' that`),flush:t===void 0?void 0:z6(t,F,`${r} has member 'flush' that`),readableType:w,start:_===void 0?void 0:V6(_,F,`${r} has member 'start' that`),transform:b===void 0?void 0:H6(b,F,`${r} has member 'transform' that`),writableType:U}}c(Z6,"convertTransformer");function z6(F,r,n){return AD(F,n),(t)=>W(F,r,[t])}c(z6,"convertTransformerFlushCallback");function V6(F,r,n){return AD(F,n),(t)=>Q(F,r,[t])}c(V6,"convertTransformerStartCallback");function H6(F,r,n){return AD(F,n),(t,w)=>W(F,r,[t,w])}c(H6,"convertTransformerTransformCallback");function W6(F,r,n){return AD(F,n),(t)=>W(F,r,[t])}c(W6,"convertTransformerCancelCallback");let K6=class{constructor(r={},n={},t={}){r===void 0&&(r=null);let w=G2(n,"Second parameter"),_=G2(t,"Third parameter"),b=Z6(r,"First parameter");if(b.readableType!==void 0)throw RangeError("Invalid readableType specified");if(b.writableType!==void 0)throw RangeError("Invalid writableType specified");let U=ju(_,0),I=l2(_),N=ju(w,1),Z=l2(w),z,O=$((sD)=>{z=sD});P6(this,O,N,Z,U,I),k6(this,b),b.start!==void 0?z(b.start(this._transformStreamController)):z(void 0)}get readable(){if(!NF(this))throw XF("readable");return this._readable}get writable(){if(!NF(this))throw XF("writable");return this._writable}};c(K6,"TransformStream");let N0=K6;Object.defineProperties(N0.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(N0.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function P6(F,r,n,t,w,_){function b(){return r}c(b,"startAlgorithm");function U(O){return O6(F,O)}c(U,"writeAlgorithm");function I(O){return o6(F,O)}c(I,"abortAlgorithm");function N(){return d6(F)}c(N,"closeAlgorithm"),F._writable=z1(b,U,N,I,n,t);function Z(){return p6(F)}c(Z,"pullAlgorithm");function z(O){return a6(F,O)}c(z,"cancelAlgorithm"),F._readable=au(b,Z,z,w,_),F._backpressure=void 0,F._backpressureChangePromise=void 0,F._backpressureChangePromise_resolve=void 0,Y2(F,!0),F._transformStreamController=void 0}c(P6,"InitializeTransformStream");function NF(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_transformStreamController")?!1:F instanceof N0}c(NF,"IsTransformStream");function MF(F,r){RD(F._readable._readableStreamController,r),M0(F,r)}c(MF,"TransformStreamError");function M0(F,r){z2(F._transformStreamController),ou(F._writable._writableStreamController,r),Q0(F)}c(M0,"TransformStreamErrorWritableAndUnblockWrite");function Q0(F){F._backpressure&&Y2(F,!1)}c(Q0,"TransformStreamUnblockWrite");function Y2(F,r){F._backpressureChangePromise!==void 0&&F._backpressureChangePromise_resolve(),F._backpressureChangePromise=$((n)=>{F._backpressureChangePromise_resolve=n}),F._backpressure=r}c(Y2,"TransformStreamSetBackpressure");let q6=class{constructor(){throw TypeError("Illegal constructor")}get desiredSize(){if(!Z2(this))throw V2("desiredSize");let r=this._controlledTransformStream._readable._readableStreamController;return I0(r)}enqueue(r=void 0){if(!Z2(this))throw V2("enqueue");QF(this,r)}error(r=void 0){if(!Z2(this))throw V2("error");v6(this,r)}terminate(){if(!Z2(this))throw V2("terminate");j6(this)}};c(q6,"TransformStreamDefaultController");let tu=q6;Object.defineProperties(tu.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),E(tu.prototype.enqueue,"enqueue"),E(tu.prototype.error,"error"),E(tu.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(tu.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function Z2(F){return!h(F)||!Object.prototype.hasOwnProperty.call(F,"_controlledTransformStream")?!1:F instanceof tu}c(Z2,"IsTransformStreamDefaultController");function g6(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(g6,"SetUpTransformStreamDefaultController");function k6(F,r){let n=Object.create(tu.prototype),t,w,_;r.transform!==void 0?t=c((b)=>r.transform(b,n),"transformAlgorithm"):t=c((b)=>{try{return QF(n,b),R(void 0)}catch(U){return m(U)}},"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"),g6(F,n,t,w,_)}c(k6,"SetUpTransformStreamDefaultControllerFromTransformer");function z2(F){F._transformAlgorithm=void 0,F._flushAlgorithm=void 0,F._cancelAlgorithm=void 0}c(z2,"TransformStreamDefaultControllerClearAlgorithms");function QF(F,r){let n=F._controlledTransformStream,t=n._readable._readableStreamController;if(!Nu(t))throw TypeError("Readable side is not in a state that permits enqueue");try{Ju(t,r)}catch(w){throw M0(n,w),n._readable._storedError}t6(t)!==n._backpressure&&Y2(n,!0)}c(QF,"TransformStreamDefaultControllerEnqueue");function v6(F,r){MF(F._controlledTransformStream,r)}c(v6,"TransformStreamDefaultControllerError");function LF(F,r){let n=F._transformAlgorithm(r);return M(n,void 0,(t)=>{throw MF(F._controlledTransformStream,t),t})}c(LF,"TransformStreamDefaultControllerPerformTransform");function j6(F){let r=F._controlledTransformStream,n=r._readable._readableStreamController;Bu(n);let t=TypeError("TransformStream terminated");M0(r,t)}c(j6,"TransformStreamDefaultControllerTerminate");function O6(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 LF(n,r)})}return LF(n,r)}c(O6,"TransformStreamDefaultSinkWriteAlgorithm");function o6(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 z2(n),S(w,()=>(t._state==="errored"?Mu(n,t._storedError):(RD(t._readableStreamController,r),L0(n)),null),(_)=>(RD(t._readableStreamController,_),Mu(n,_),null)),n._finishPromise}c(o6,"TransformStreamDefaultSinkAbortAlgorithm");function d6(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 z2(r),S(t,()=>(n._state==="errored"?Mu(r,n._storedError):(Bu(n._readableStreamController),L0(r)),null),(w)=>(RD(n._readableStreamController,w),Mu(r,w),null)),r._finishPromise}c(d6,"TransformStreamDefaultSinkCloseAlgorithm");function p6(F){return Y2(F,!1),F._backpressureChangePromise}c(p6,"TransformStreamDefaultSourcePullAlgorithm");function a6(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 z2(n),S(w,()=>(t._state==="errored"?Mu(n,t._storedError):(ou(t._writableStreamController,r),Q0(F),L0(n)),null),(_)=>(ou(t._writableStreamController,_),Q0(F),Mu(n,_),null)),n._finishPromise}c(a6,"TransformStreamDefaultSourceCancelAlgorithm");function V2(F){return TypeError(`TransformStreamDefaultController.prototype.${F} can only be used on a TransformStreamDefaultController`)}c(V2,"defaultControllerBrandCheckException");function L0(F){F._finishPromise_resolve!==void 0&&(F._finishPromise_resolve(),F._finishPromise_resolve=void 0,F._finishPromise_reject=void 0)}c(L0,"defaultControllerFinishPromiseResolve");function Mu(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(Mu,"defaultControllerFinishPromiseReject");function XF(F){return TypeError(`TransformStream.prototype.${F} can only be used on a TransformStream`)}c(XF,"streamBrandCheckException"),i.ByteLengthQueuingStrategy=y0,i.CountQueuingStrategy=J0,i.ReadableByteStreamController=vD,i.ReadableStream=hD,i.ReadableStreamBYOBReader=hu,i.ReadableStreamBYOBRequest=Uu,i.ReadableStreamDefaultController=OD,i.ReadableStreamDefaultReader=Fu,i.TransformStream=N0,i.TransformStreamDefaultController=tu,i.WritableStream=fu,i.WritableStreamDefaultController=Ou,i.WritableStreamDefaultWriter=jD})}(x0,x0.exports)),x0.exports}function $C(){if(tC)return BC;tC=1;let D=65536;if(!globalThis.ReadableStream)try{let u=zD("node:process"),{emitWarning:i}=u;try{u.emitWarning=()=>{},Object.assign(globalThis,zD("node:stream/web")),u.emitWarning=i}catch(C){throw u.emitWarning=i,C}}catch{Object.assign(globalThis,IC())}try{let{Blob:u}=zD("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 BC}async function*e0(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,AC),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+AC)).arrayBuffer();C+=f.byteLength,yield new Uint8Array(f)}}}function yC(D,u=Hu){var i=`${wC()}${wC()}`.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+t8(E)+`"\r
74
+ \r
75
+ ${f.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
76
+ `)}\r
77
+ `):C.push(h+t8(E)+`"; filename="${t8(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 D3(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 PD))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 B3?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 YC(D=[]){return new Du(D.reduce((u,i,C,h)=>(C%2===0&&u.push(h.slice(C,C+2)),u),[]).filter(([u,i])=>{try{return u3(u),A8(u,String(i)),!0}catch{return!1}}))}function w8(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 VC(D){if(!zC.has(D))throw TypeError(`Invalid referrerPolicy: ${D}`);return D}function HC(D){if(/^(http|ws)s:$/.test(D.protocol))return!0;let u=D.host.replace(/(^\[)|(]$)/g,""),i=rh(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 zu(D){return/^about:(blank|srcdoc)$/.test(D)||D.protocol==="data:"||/^(blob|filesystem):$/.test(D.protocol)?!0:HC(D)}function WC(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=w8(h),E=w8(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 zu(f)&&!zu(B)?"no-referrer":E.toString();case"strict-origin-when-cross-origin":return f.origin===B.origin?f:zu(f)&&!zu(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 zu(f)&&!zu(B)?"no-referrer":f;default:throw TypeError(`Invalid referrerPolicy: ${C}`)}}function KC(D){let u=(D.get("referrer-policy")||"").split(/[,\s]+/),i="";for(let C of u)C&&zC.has(C)&&(i=C);return i}function kC(){if(_C)return $8;if(_C=1,!globalThis.DOMException)try{let{MessageChannel:D}=zD("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 T8(D,u){return new Promise((i,C)=>{let h=new d2(D,u),{parsedURL:f,options:E}=yh(h);if(!Yh.has(f.protocol))throw TypeError(`node-fetch cannot load ${D}. URL scheme "${f.protocol.replace(/:$/,"")}" is not supported.`);if(f.protocol==="data:"){let S=UC(h.url),y=new WD(S,{headers:{"Content-Type":S.typeFull}});i(y);return}let B=(f.protocol==="https:"?Ch:o2).request,{signal:s}=h,A=null,$=c(()=>{let S=new gC("The operation was aborted.");C(S),h.body&&h.body instanceof PD.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()}),dC(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=YC(S.rawHeaders);if(U8(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 x={headers:new Du(h.headers),follow:h.follow,counter:h.counter+1,agent:h.agent,compress:h.compress,method:h.method,body:G8(h),signal:h.signal,size:h.size,referrer:h.referrer,referrerPolicy:h.referrerPolicy};if(!mh(h.url,W)||!_h(h.url,W))for(let BD of["authorization","www-authenticate","cookie","cookie2"])x.headers.delete(BD);if(S.statusCode!==303&&h.body&&u.body instanceof PD.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")&&(x.method="GET",x.body=void 0,x.headers.delete("content-length"));let uu=KC(y);uu&&(x.referrerPolicy=uu),i(T8(new d2(W,x))),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=E2(S,new i3,(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 WD(J,M),i(A);return}let v={flush:C2.Z_SYNC_FLUSH,finishFlush:C2.Z_SYNC_FLUSH};if(L==="gzip"||L==="x-gzip"){J=E2(J,C2.createGunzip(v),(Q)=>{Q&&C(Q)}),A=new WD(J,M),i(A);return}if(L==="deflate"||L==="x-deflate"){let Q=E2(S,new i3,(W)=>{W&&C(W)});Q.once("data",(W)=>{(W[0]&15)===8?J=E2(J,C2.createInflate(),(x)=>{x&&C(x)}):J=E2(J,C2.createInflateRaw(),(x)=>{x&&C(x)}),A=new WD(J,M),i(A)}),Q.once("end",()=>{A||(A=new WD(J,M),i(A))});return}if(L==="br"){J=E2(J,C2.createBrotliDecompress(),(Q)=>{Q&&C(Q)}),A=new WD(J,M),i(A);return}A=new WD(J,M),i(A)}),lh(m,h).catch(C)})}function dC(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=pC.get(D);return console.assert(u!=null,"'this' is expected an Event object, but got",D),u}function _8(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 Vu(D,u){pC.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,y8(h))}}function y8(D){return{get(){return p(this).event[D]},set(u){p(this).event[D]=u},configurable:!0,enumerable:!0}}function aC(D){return{value(){let u=p(this).event;return u[D].apply(u,arguments)},configurable:!0,enumerable:!0}}function xC(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?aC(f):y8(f))}}return C}function J8(D){if(D==null||D===Object.prototype)return Vu;let u=m8.get(D);return u==null&&(u=xC(J8(Object.getPrototypeOf(D)),D),m8.set(D,u)),u}function eC(D,u){return new(J8(Object.getPrototypeOf(u)))(D,u)}function D7(D){return p(D).immediateStopped}function u7(D,u){p(D).eventPhase=u}function F7(D,u){p(D).currentTarget=u}function R8(D,u){p(D).passiveListener=u}function O2(D){return D!==null&&typeof D=="object"}function f2(D){let u=i7.get(D);if(u==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return u}function C7(D){return{get(){let u=f2(this).get(D);for(;u!=null;){if(u.listenerType===F3)return u.listener;u=u.next}return null},set(u){typeof u!="function"&&!O2(u)&&(u=null);let i=f2(this),C=null,h=i.get(D);for(;h!=null;)h.listenerType===F3?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:F3,passive:!1,once:!1,next:null};C===null?i.set(D,f):C.next=f}},configurable:!0,enumerable:!0}}function N8(D,u){Object.defineProperty(D,`on${u}`,C7(u))}function b8(D){function u(){KD.call(this)}c(u,"CustomEventTarget"),u.prototype=Object.create(KD.prototype,{constructor:{value:u,configurable:!0,writable:!0}});for(let i=0;i<D.length;++i)N8(u.prototype,D[i]);return u}function KD(){if(this instanceof KD){i7.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return b8(arguments[0]);if(arguments.length>0){let D=Array(arguments.length);for(let u=0;u<arguments.length;++u)D[u]=arguments[u];return b8(D)}throw TypeError("Cannot call a class as a function")}function h7(){let D=Object.create(f3.prototype);return KD.call(D),c3.set(D,!1),D}function r7(D){c3.get(D)===!1&&(c3.set(D,!0),D.dispatchEvent({type:"abort"}))}function S8(D){let u=f7.get(D);if(u==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${D===null?"null":typeof D}`);return u}function l8(){!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 ih,SC=(D)=>{throw TypeError(D)},c=(D,u)=>ih(D,"name",{value:u,configurable:!0}),lC=(D,u,i)=>u.has(D)||SC("Cannot "+i),DD=(D,u,i)=>(lC(D,u,"read from private field"),i?i.call(D):u.get(D)),eD=(D,u,i)=>u.has(D)?SC("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(D):u.set(D,i),MD=(D,u,i,C)=>(lC(D,u,"write to private field"),C?C.call(D,i):u.set(D,i),i),Ru,d0,i2,c8,g2,p0,a0,n8,JD,B8,h2,r2,s8,BC,x0,Bh,sC,tC,AC=65536,TC,Hu,sh,F2,v2,th,$h,wC,Ah,mC,t8,Zu,Yu,JC,B3,NC,QD,h3,MC,r3,wh,mh,_h,Rh,$D,QC=class{constructor(u,{size:i=0}={}){let C=null;u===null?u=null:MC(u)?u=rD.from(u.toString()):r3(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 PD||(u instanceof Yu?(u=yC(u),C=u.type.split("=")[1]):u=rD.from(String(u))));let h=u;rD.isBuffer(u)?h=PD.Readable.from(u):r3(u)&&(h=PD.Readable.from(u.stream())),this[$D]={body:u,stream:h,boundary:C,disturbed:!1,error:null},this.size=i,u instanceof PD&&u.on("error",(f)=>{let E=f instanceof B3?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 D3(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 Yu,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(() => (nC(),cC));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 Hu([i],{type:u})}async json(){let u=await this.text();return JSON.parse(u)}async text(){let u=await D3(this);return new TextDecoder().decode(u)}buffer(){return D3(this)}},j2,G8,bh,LC,Sh,lh,u3,A8,XC,Du,Gh,U8,ND,ZC,WD,Uh,zC,Ih="strict-origin-when-cross-origin",CD,k2,Th,PC,d2,yh,qC,gC,$8,_C,Jh,Nh,I8,Mh,Qh,Lh,Xh,vC,jC,OC,oC,Yh,pC,m8,i7,RC=1,bC=2,F3=3,E7,f3,c3,n3,f7,Zh,zh,c7;var o0=X0(()=>{v0();ih=Object.defineProperty;c(UC,"dataUriToBuffer");BC={},x0={exports:{}},Bh=x0.exports;c(IC,"requirePonyfill_es2018");c($C,"requireStreams"),$C();/*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */c(e0,"toIterator");TC=(g2=class{constructor(D=[],u={}){if(eD(this,Ru,[]),eD(this,d0,""),eD(this,i2,0),eD(this,c8,"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 g2?f=h:f=i.encode(`${h}`),MD(this,i2,DD(this,i2)+(ArrayBuffer.isView(f)?f.byteLength:f.size)),DD(this,Ru).push(f)}MD(this,c8,`${u.endings===void 0?"transparent":u.endings}`);let C=u.type===void 0?"":String(u.type);MD(this,d0,/^[\x20-\x7E]*$/.test(C)?C:"")}get size(){return DD(this,i2)}get type(){return DD(this,d0)}async text(){let D=new TextDecoder,u="";for await(let i of e0(DD(this,Ru),!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 e0(DD(this,Ru),!1))D.set(i,u),u+=i.length;return D.buffer}stream(){let D=e0(DD(this,Ru),!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=DD(this,Ru),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 g2([],{type:String(i).toLowerCase()});return MD($,i2,E),MD($,Ru,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])}},Ru=new WeakMap,d0=new WeakMap,i2=new WeakMap,c8=new WeakMap,c(g2,"Blob"),g2);Object.defineProperties(TC.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Hu=TC,sh=(n8=class extends Hu{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);eD(this,p0,0),eD(this,a0,""),i===null&&(i={});let C=i.lastModified===void 0?Date.now():Number(i.lastModified);Number.isNaN(C)||MD(this,p0,C),MD(this,a0,String(u))}get name(){return DD(this,a0)}get lastModified(){return DD(this,p0)}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](D){return!!D&&D instanceof Hu&&/^(File)$/.test(D[Symbol.toStringTag])}},p0=new WeakMap,a0=new WeakMap,c(n8,"File"),n8),F2=sh;/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */({toStringTag:v2,iterator:th,hasInstance:$h}=Symbol),wC=Math.random,Ah="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),mC=c((D,u,i)=>(D+="",/^(Blob|File)$/.test(u&&u[v2])?[(i=i!==void 0?i+"":u[v2]=="File"?u.name:"blob",D),u.name!==i||u[v2]=="blob"?new F2([u],i,u):u]:[D,u+""]),"f"),t8=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"),Zu=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"),Yu=(B8=class{constructor(...D){if(eD(this,JD,[]),D.length)throw TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[v2](){return"FormData"}[th](){return this.entries()}static[$h](D){return D&&typeof D=="object"&&D[v2]==="FormData"&&!Ah.some((u)=>typeof D[u]!="function")}append(...D){Zu("append",arguments,2),DD(this,JD).push(mC(...D))}delete(D){Zu("delete",arguments,1),D+="",MD(this,JD,DD(this,JD).filter(([u])=>u!==D))}get(D){Zu("get",arguments,1),D+="";for(var u=DD(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 Zu("getAll",arguments,1),u=[],D+="",DD(this,JD).forEach((i)=>i[0]===D&&u.push(i[1])),u}has(D){return Zu("has",arguments,1),D+="",DD(this,JD).some((u)=>u[0]===D)}forEach(D,u){Zu("forEach",arguments,1);for(var[i,C]of this)D.call(u,C,i,this)}set(...D){Zu("set",arguments,2);var u=[],i=!0;D=mC(...D),DD(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*DD(this,JD)}*keys(){for(var[D]of this)yield D}*values(){for(var[,D]of this)yield D}},JD=new WeakMap,c(B8,"FormData"),B8);c(yC,"formDataToBlob");JC=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(JC,"FetchBaseError");B3=JC,NC=class extends B3{constructor(u,i,C){super(u,i),C&&(this.code=this.errno=C.code,this.erroredSysCall=C.syscall)}};c(NC,"FetchError");QD=NC,h3=Symbol.toStringTag,MC=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[h3]==="URLSearchParams","isURLSearchParameters"),r3=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[h3]),"isBlob"),wh=c((D)=>typeof D=="object"&&(D[h3]==="AbortSignal"||D[h3]==="EventTarget"),"isAbortSignal"),mh=c((D,u)=>{let i=new URL(u).hostname,C=new URL(D).hostname;return i===C||i.endsWith(`.${C}`)},"isDomainOrSubdomain"),_h=c((D,u)=>{let i=new URL(u).protocol,C=new URL(D).protocol;return i===C},"isSameProtocol"),Rh=Eh(PD.pipeline),$D=Symbol("Body internals");c(QC,"Body");j2=QC;j2.prototype.buffer=E3(j2.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer"),Object.defineProperties(j2.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:E3(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});c(D3,"consumeBody");G8=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 PD&&typeof h.getBoundary!="function"&&(i=new i3({highWaterMark:u}),C=new i3({highWaterMark:u}),h.pipe(i),h.pipe(C),D[$D].stream=i,h=C),h},"clone"),bh=E3((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"),LC=c((D,u)=>D===null?null:typeof D=="string"?"text/plain;charset=UTF-8":MC(D)?"application/x-www-form-urlencoded;charset=UTF-8":r3(D)?D.type||null:rD.isBuffer(D)||C3.isAnyArrayBuffer(D)||ArrayBuffer.isView(D)?null:D instanceof Yu?`multipart/form-data; boundary=${u[$D].boundary}`:D&&typeof D.getBoundary=="function"?`multipart/form-data;boundary=${bh(D)}`:D instanceof PD?null:"text/plain;charset=UTF-8","extractContentType"),Sh=c((D)=>{let{body:u}=D[$D];return u===null?0:r3(u)?u.size:rD.isBuffer(u)?u.length:u&&typeof u.getLengthSync=="function"&&u.hasKnownLength&&u.hasKnownLength()?u.getLengthSync():null},"getTotalBytes"),lh=c(async(D,{body:u})=>{u===null?D.end():await Rh(u,D)},"writeToStream"),u3=typeof o2.validateHeaderName=="function"?o2.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}},A8=typeof o2.validateHeaderValue=="function"?o2.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}},XC=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])=>(u3(C),A8(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)=>(u3(E),A8(E,String(B)),URLSearchParams.prototype[h].call(C,String(E).toLowerCase(),String(B)));case"delete":case"has":case"getAll":return(E)=>(u3(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(XC,"Headers");Du=XC;Object.defineProperties(Du.prototype,["get","entries","forEach","values"].reduce((D,u)=>(D[u]={enumerable:!0},D),{}));c(YC,"fromRawHeaders");Gh=new Set([301,302,303,307,308]),U8=c((D)=>Gh.has(D),"isRedirect"),ND=Symbol("Response internals"),ZC=class D extends j2{constructor(u=null,i={}){super(u,i);let C=i.status!=null?i.status:200,h=new Du(i.headers);if(u!==null&&!h.has("Content-Type")){let f=LC(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(G8(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(!U8(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 Du(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(ZC,"Response");WD=ZC;Object.defineProperties(WD.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}});Uh=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(w8,"stripURLForUseAsAReferrer");zC=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(VC,"validateReferrerPolicy");c(HC,"isOriginPotentiallyTrustworthy");c(zu,"isUrlPotentiallyTrustworthy");c(WC,"determineRequestsReferrer");c(KC,"parseReferrerPolicyFromHeader");CD=Symbol("Request internals"),k2=c((D)=>typeof D=="object"&&typeof D[CD]=="object","isRequest"),Th=E3(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),PC=class D extends j2{constructor(u,i={}){let C;if(k2(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()),!k2(i)&&"data"in i&&Th(),(i.body!=null||k2(u)&&u.body!==null)&&(h==="GET"||h==="HEAD"))throw TypeError("Request with GET/HEAD method cannot have body");let f=i.body?i.body:k2(u)&&u.body!==null?G8(u):null;super(f,{size:i.size||u.size||0});let E=new Du(i.headers||u.headers||{});if(f!==null&&!E.has("Content-Type")){let A=LC(f,this);A&&E.set("Content-Type",A)}let B=k2(u)?u.signal:null;if("signal"in i&&(B=i.signal),B!=null&&!wh(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 hh(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=VC(u)}clone(){return new D(this)}get[Symbol.toStringTag](){return"Request"}};c(PC,"Request");d2=PC;Object.defineProperties(d2.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}});yh=c((D)=>{let{parsedURL:u}=D[CD],i=new Du(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=Sh(D);typeof B=="number"&&!Number.isNaN(B)&&(C=String(B))}C&&i.set("Content-Length",C),D.referrerPolicy===""&&(D.referrerPolicy=Ih),D.referrer&&D.referrer!=="no-referrer"?D[CD].referrer=WC(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=Uh(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"),qC=class extends B3{constructor(u,i="aborted"){super(u,i)}};c(qC,"AbortError");gC=qC;/*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */c(kC,"requireNodeDomexception");Jh=kC(),Nh=f8(Jh),{stat:I8}=fh,Mh=c((D,u)=>vC(GC(D),D,u),"blobFromSync"),Qh=c((D,u)=>I8(D).then((i)=>vC(i,D,u)),"blobFrom"),Lh=c((D,u)=>I8(D).then((i)=>jC(i,D,u)),"fileFrom"),Xh=c((D,u)=>jC(GC(D),D,u),"fileFromSync"),vC=c((D,u,i="")=>new Hu([new oC({path:u,size:D.size,lastModified:D.mtimeMs,start:0})],{type:i}),"fromBlob"),jC=c((D,u,i="")=>new F2([new oC({path:u,size:D.size,lastModified:D.mtimeMs,start:0})],nh(u),{type:i,lastModified:D.mtimeMs}),"fromFile"),OC=class D{constructor(u){eD(this,h2),eD(this,r2),MD(this,h2,u.path),MD(this,r2,u.start),this.size=u.size,this.lastModified=u.lastModified}slice(u,i){return new D({path:DD(this,h2),lastModified:this.lastModified,size:i-u,start:DD(this,r2)+u})}async*stream(){let{mtimeMs:u}=await I8(DD(this,h2));if(u>this.lastModified)throw new Nh("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*ch(DD(this,h2),{start:DD(this,r2),end:DD(this,r2)+this.size-1})}get[Symbol.toStringTag](){return"Blob"}};h2=new WeakMap,r2=new WeakMap,c(OC,"BlobDataItem");oC=OC,Yh=new Set(["data:","http:","https:"]);c(T8,"fetch$1");c(dC,"fixResponseChunkedTransferBadEnding");pC=new WeakMap,m8=new WeakMap;c(p,"pd");c(_8,"setCancelFlag");c(Vu,"Event"),Vu.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(){_8(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||_8(p(this))},initEvent(){}},Object.defineProperty(Vu.prototype,"constructor",{value:Vu,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(Vu.prototype,window.Event.prototype),m8.set(window.Event.prototype,Vu));c(y8,"defineRedirectDescriptor");c(aC,"defineCallDescriptor");c(xC,"defineWrapper");c(J8,"getWrapper");c(eC,"wrapEvent");c(D7,"isStopped");c(u7,"setEventPhase");c(F7,"setCurrentTarget");c(R8,"setPassiveListener");i7=new WeakMap;c(O2,"isObject");c(f2,"getListeners");c(C7,"defineEventAttributeDescriptor");c(N8,"defineEventAttribute");c(b8,"defineCustomEventTarget");c(KD,"EventTarget"),KD.prototype={addEventListener(D,u,i){if(u==null)return;if(typeof u!="function"&&!O2(u))throw TypeError("'listener' should be a function or an object.");let C=f2(this),h=O2(i),f=(h?!!i.capture:!!i)?RC:bC,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=f2(this),h=(O2(i)?!!i.capture:!!i)?RC:bC,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=f2(this),i=D.type,C=u.get(i);if(C==null)return!0;let h=eC(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,R8(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!==F3&&typeof C.listener.handleEvent=="function"&&C.listener.handleEvent(h);if(D7(h))break;C=C.next}return R8(h,null),u7(h,0),F7(h,null),!h.defaultPrevented}},Object.defineProperty(KD.prototype,"constructor",{value:KD,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(KD.prototype,window.EventTarget.prototype);E7=class extends KD{constructor(){throw super(),TypeError("AbortSignal cannot be constructed directly")}get aborted(){let u=c3.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(E7,"AbortSignal");f3=E7;N8(f3.prototype,"abort");c(h7,"createAbortSignal");c(r7,"abortSignal");c3=new WeakMap;Object.defineProperties(f3.prototype,{aborted:{enumerable:!0}}),typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(f3.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});n3=(s8=class{constructor(){f7.set(this,h7())}get signal(){return S8(this)}abort(){r7(S8(this))}},c(s8,"AbortController"),s8),f7=new WeakMap;c(S8,"getSignal"),Object.defineProperties(n3.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(n3.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});Zh=Object.defineProperty,zh=c((D,u)=>Zh(D,"name",{value:u,configurable:!0}),"e"),c7=T8;l8();c(l8,"s"),zh(l8,"checkNodeEnvironment")});var Ai=fE($i(),1),{program:T5,createCommand:y5,createArgument:J5,createOption:N5,CommanderError:M5,InvalidArgumentError:Q5,InvalidOptionArgumentError:L5,Command:wi,Argument:X5,Option:Y5,Help:Z5}=Ai.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},OF={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 kF(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 oF(D,u,i=".",C){if(!kF(u))return oF(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(kF(E)&&kF(h[f]))h[f]=oF(E,h[f],(i?`${i}.`:"")+f.toString(),C);else h[f]=E}return h}function F9(D){return(...u)=>u.reduce((i,C)=>oF(i,C,"",D),{})}var i9=F9();function C9(D){return Object.prototype.toString.call(D)==="[object Object]"}function E9(D){if(!C9(D))return!1;if(!D.message&&!D.args)return!1;if(D.stack)return!1;return!0}var vF=!1,mi=[];class iD{options;_lastLog;_mockFn;constructor(D={}){let u=D.types||OF;this.options=i9({...D,defaults:{...D.defaults},level:jF(D.level,u),reporters:[...D.reporters||[]]},{types:OF,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=jF(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(){vF=!0}resumeLogs(){vF=!1;let D=mi.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(vF){mi.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:jF(D.level,this.options.types)};if(!i&&u.length===1&&E9(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 jF(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 _i(D={}){return new iD(D)}import{formatWithOptions as Ri}from"node:util";import{sep as h9}from"node:path";function pF(D,u){let i=process.cwd()+h9;return D.split(`
88
+ `).splice(u.split(`
89
+ `).length).map((h)=>h.trim().replace("file://","").replace(i,""))}function r9(D,u){return(u.__write||u.write).call(u,D)}var dF=(D)=>D?`[${D}]`:"";class z0{formatStack(D,u,i){let C=" ".repeat((i?.errorLevel||0)+1);return C+pF(D,u).join(`
90
+ ${C}`)}formatError(D,u){let i=D.message??Ri(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(u.cause,{...D,errorLevel:n+1}):"";return F+t+`
81
- `+r+i}formatArgs(u,D){let t=u.map((r)=>{if(r&&typeof r.stack==="string")return this.formatError(r,D);return r});return QD(D,...t)}formatDate(u,D){return D.date?u.toLocaleTimeString():""}filterAndJoin(u){return u.filter(Boolean).join(" ")}formatLogObj(u,D){let t=this.formatArgs(u.args,D);if(u.type==="box")return`
82
- `+[ku(u.tag),u.title&&u.title,...t.split(`
83
- `)].filter(Boolean).map((r)=>" > "+r).join(`
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 Ri(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
+ `+[dF(D.tag),D.title&&D.title,...i.split(`
95
+ `)].filter(Boolean).map((C)=>" > "+C).join(`
84
96
  `)+`
85
- `;return this.filterAndJoin([ku(u.type),ku(u.tag),t])}log(u,D){let t=this.formatLogObj(u,{columns:D.options.stdout.columns||0,...D.options.formatOptions});return c2(t+`
86
- `,u.level<2?D.options.stderr||process.stderr:D.options.stdout||process.stdout)}}import ot from"process";import*as lu from"tty";var{env:V={},argv:YD=[],platform:B2=""}=typeof process>"u"?{}:process,o2="NO_COLOR"in V||YD.includes("--no-color"),l2="FORCE_COLOR"in V||YD.includes("--color"),$2=B2==="win32",qD=V.TERM==="dumb",A2=lu&&lu.isatty&&lu.isatty(1)&&V.TERM&&!qD,w2="CI"in V&&(("GITHUB_ACTIONS"in V)||("GITLAB_CI"in V)||("CIRCLECI"in V)),_2=!o2&&(l2||$2&&!qD||A2||w2);function ZD(u,D,t,r,n=D.slice(0,Math.max(0,u))+r,F=D.slice(Math.max(0,u+t.length)),i=F.indexOf(t)){return n+(i<0?F:ZD(i,F,t,r))}function m2(u,D,t,r,n){return u<0?t+D+r:t+ZD(u,D,r,n)+r}function b2(u,D,t=u,r=u.length+1){return(n)=>n||!(n===""||n===void 0)?m2((""+n).indexOf(D,r),n,u,D,t):""}function l(u,D,t){return b2(`\x1B[${u}m`,`\x1B[${D}m`,t)}var WD={reset:l(0,0),bold:l(1,22,"\x1B[22m\x1B[1m"),dim:l(2,22,"\x1B[22m\x1B[2m"),italic:l(3,23),underline:l(4,24),inverse:l(7,27),hidden:l(8,28),strikethrough:l(9,29),black:l(30,39),red:l(31,39),green:l(32,39),yellow:l(33,39),blue:l(34,39),magenta:l(35,39),cyan:l(36,39),white:l(37,39),gray:l(90,39),bgBlack:l(40,49),bgRed:l(41,49),bgGreen:l(42,49),bgYellow:l(43,49),bgBlue:l(44,49),bgMagenta:l(45,49),bgCyan:l(46,49),bgWhite:l(47,49),blackBright:l(90,39),redBright:l(91,39),greenBright:l(92,39),yellowBright:l(93,39),blueBright:l(94,39),magentaBright:l(95,39),cyanBright:l(96,39),whiteBright:l(97,39),bgBlackBright:l(100,49),bgRedBright:l(101,49),bgGreenBright:l(102,49),bgYellowBright:l(103,49),bgBlueBright:l(104,49),bgMagentaBright:l(105,49),bgCyanBright:l(106,49),bgWhiteBright:l(107,49)};function R2(u=_2){return u?WD:Object.fromEntries(Object.keys(WD).map((D)=>[D,String]))}var g=R2();function S2(u,D="reset"){return g[u]||g[D]}var T2=[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 H(u){return u.replace(new RegExp(T2,"g"),"")}var zD={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},y2={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function aD(u,D={}){let t={...D,style:{...y2,...D.style}},r=u.split(`
87
- `),n=[],F=S2(t.style.borderColor),i={...typeof t.style.borderStyle==="string"?zD[t.style.borderStyle]||zD.solid:t.style.borderStyle};if(F)for(let B in i)i[B]=F(i[B]);let e=t.style.padding%2===0?t.style.padding:t.style.padding+1,s=r.length+e,f=Math.max(...r.map((B)=>H(B).length),t.title?H(t.title).length:0)+e,C=f+e,E=t.style.marginLeft>0?" ".repeat(t.style.marginLeft):"";if(t.style.marginTop>0)n.push("".repeat(t.style.marginTop));if(t.title){let B=F?F(t.title):t.title,A=i.h.repeat(Math.floor((f-H(t.title).length)/2)),S=i.h.repeat(f-H(t.title).length-H(A).length+e);n.push(`${E}${i.tl}${A}${B}${S}${i.tr}`)}else n.push(`${E}${i.tl}${i.h.repeat(C)}${i.tr}`);let c=t.style.valign==="center"?Math.floor((s-r.length)/2):t.style.valign==="top"?s-r.length-e:s-r.length;for(let B=0;B<s;B++)if(B<c||B>=c+r.length)n.push(`${E}${i.v}${" ".repeat(C)}${i.v}`);else{let A=r[B-c],S=" ".repeat(e),M=" ".repeat(f-H(A).length);n.push(`${E}${i.v}${S}${A}${M}${i.v}`)}if(n.push(`${E}${i.bl}${i.h.repeat(C)}${i.br}`),t.style.marginBottom>0)n.push("".repeat(t.style.marginBottom));return n.join(`
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
- ${r}`+Ku(u,D).map((n)=>" "+n.replace(/^at +/,(F)=>g.gray(F)).replace(/\((.+)\)/,(F,i)=>`(${g.cyan(i)})`)).join(`
90
- ${r}`)}formatType(u,D,t){let r=Kr[u.type]||vr[u.level]||"gray";if(D)return dr(r)(g.black(` ${u.type.toUpperCase()} `));let n=typeof $t[u.type]==="string"?$t[u.type]:u.icon||u.type;return n?Or(r)(n):""}formatLogObj(u,D){let[t,...r]=this.formatArgs(u.args,D).split(`
91
- `);if(u.type==="box")return aD(bu(t+(r.length>0?`
92
- `+r.join(`
93
- `):"")),{title:u.title?bu(u.title):void 0,style:u.style});let n=this.formatDate(u.date,D),F=n&&g.gray(n),i=u.badge??u.level<2,e=this.formatType(u,i,D),s=u.tag?g.gray(u.tag):"",f,C=this.filterAndJoin([e,bu(t)]),E=this.filterAndJoin(D.columns?[s,F]:[s]),c=(D.columns||0)-At(C)-At(E)-2;if(f=c>0&&(D.columns||0)>=80?C+" ".repeat(c)+E:(E?`${g.gray(`[${E}]`)} `:"")+C,f+=bu(r.length>0?`
94
- `+r.join(`
95
- `):""),u.type==="trace"){let B=Error("Trace: "+u.message);f+=this.formatStack(B.stack||"",B.message)}return i?`
96
- `+f+`
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([dF(D.type),dF(D.tag),i])}log(D,u){let i=this.formatLogObj(D,{columns:u.options.stdout.columns||0,...u.options.formatOptions});return r9(i+`
98
+ `,D.level<2?u.options.stderr||process.stderr:u.options.stdout||process.stdout)}}import xi from"node:process";import*as V0 from"node:tty";var{env:wu={},argv:li=[],platform:f9=""}=typeof process>"u"?{}:process,c9="NO_COLOR"in wu||li.includes("--no-color"),n9="FORCE_COLOR"in wu||li.includes("--color"),B9=f9==="win32",Gi=wu.TERM==="dumb",s9=V0&&V0.isatty&&V0.isatty(1)&&wu.TERM&&!Gi,t9="CI"in wu&&(("GITHUB_ACTIONS"in wu)||("GITLAB_CI"in wu)||("CIRCLECI"in wu)),$9=!c9&&(n9||B9&&!Gi||s9||t9);function Ui(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:Ui(E,f,i,C))}function A9(D,u,i,C,h){return D<0?i+u+C:i+Ui(D,u,C,h)+C}function w9(D,u,i=D,C=D.length+1){return(h)=>h||!(h===""||h===void 0)?A9((""+h).indexOf(u,C),h,D,u,i):""}function Y(D,u,i){return w9(`\x1B[${D}m`,`\x1B[${u}m`,i)}var bi={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=$9){return D?bi:Object.fromEntries(Object.keys(bi).map((u)=>[u,String]))}var nD=m9();function _9(D,u="reset"){return nD[D]||nD[u]}var R9=[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 Au(D){return D.replace(new RegExp(R9,"g"),"")}var Si={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:""}},b9={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function Ii(D,u={}){let i={...u,style:{...b9,...u.style}},C=D.split(`
99
+ `),h=[],f=_9(i.style.borderColor),E={...typeof i.style.borderStyle==="string"?Si[i.style.borderStyle]||Si.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)=>Au(l).length),i.title?Au(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-Au(i.title).length)/2)),y=E.h.repeat(A-Au(i.title).length-Au(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-Au(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 k0=Object.create(null),P2=(D)=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(D?k0:globalThis),mu=new Proxy(k0,{get(D,u){return P2()[u]??k0[u]},has(D,u){let i=P2();return u in i||u in k0},set(D,u,i){let C=P2(!0);return C[u]=i,!0},deleteProperty(D,u){if(!u)return!1;let i=P2(!0);return delete i[u],!0},ownKeys(){let D=P2(!0);return Object.keys(D)}}),n4=typeof process<"u"&&process.env&&"development"||"",B4=[["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 s4(){if(globalThis.process?.env)for(let D of B4){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 FC=s4();FC.name;function Lu(D){return D?D!=="false":!1}var t4=globalThis.process?.platform||"",E8=Lu(mu.CI)||FC.ci!==!1,iC=Lu(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),$4=Lu(mu.DEBUG),h8=n4==="test"||Lu(mu.TEST);Lu(mu.MINIMAL);var A4=/^win/i.test(t4);!Lu(mu.NO_COLOR)&&(Lu(mu.FORCE_COLOR)||(iC||A4)&&mu.TERM);var w4=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(w4?.split(".")[0]);var m4=globalThis.process||Object.create(null),ei={versions:{}};new Proxy(m4,{get(D,u){if(u==="env")return mu;if(u in D)return D[u];if(u in ei)return ei[u]}});var _4=globalThis.process?.release?.name==="node",R4=!!globalThis.Bun||!!globalThis.process?.versions?.bun,b4=!!globalThis.Deno,S4=!!globalThis.fastly,l4=!!globalThis.Netlify,G4=!!globalThis.EdgeRuntime,U4=globalThis.navigator?.userAgent==="Cloudflare-Workers",I4=[[l4,"netlify"],[G4,"edge-light"],[U4,"workerd"],[S4,"fastly"],[b4,"deno"],[R4,"bun"],[_4,"node"]];function T4(){let D=I4.find((u)=>u[0]);if(D)return{name:D[1]}}var y4=T4();y4?.name;function J4({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 N4=J4();function M4(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(N4,"")}function Q4(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 L4(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function X4(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 Y4(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function Z4(D,{ambiguousAsWide:u=!1}={}){if(Y4(D),L4(D)||X4(D)||u&&Q4(D))return 2;return 1}var z4=()=>{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},V4=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:(D)=>D.split("")},H4=/^\p{Default_Ignorable_Code_Point}$/u;function W4(D,u={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:i=!0,countAnsiEscapeCodes:C=!1}=u;if(!C)D=M4(D);if(D.length===0)return 0;let h=0,f={ambiguousAsWide:!i};for(let{segment:E}of V4.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(H4.test(E))continue;if(z4().test(E)){h+=2;continue}h+=Z4(B,f)}return h}function K4(){let{env:D}=xi,{TERM:u,TERM_PROGRAM:i}=D;if(xi.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 P4={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},q4={0:"red",1:"yellow"},g4=K4(),VD=(D,u)=>g4?D:u,DC={error:VD("✖","×"),fatal:VD("✖","×"),ready:VD("✔","√"),warn:VD("⚠","‼"),info:VD("ℹ","i"),success:VD("✔","√"),debug:VD("⚙","D"),trace:VD("→","→"),fail:VD("✖","×"),start:VD("◐","o"),log:""};function uC(D){if(typeof Intl!=="object"||!Intl.Segmenter)return Au(D).length;return W4(D)}class CC extends z0{formatStack(D,u,i){let C=" ".repeat((i?.errorLevel||0)+1);return`
101
+ ${C}`+pF(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=P4[D.type]||q4[D.level]||"gray";if(u)return v4(C)(nD.black(` ${D.type.toUpperCase()} `));let h=typeof DC[D.type]==="string"?DC[D.type]:D.icon||D.type;return h?k4(C)(h):""}formatLogObj(D,u){let[i,...C]=this.formatArgs(D.args,u).split(`
103
+ `);if(D.type==="box")return Ii(g0(i+(C.length>0?`
104
+ `+C.join(`
105
+ `):"")),{title:D.title?g0(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,g0(i)]),R=this.filterAndJoin(u.columns?[s,f]:[s]),m=(u.columns||0)-uC($)-uC(R)-2;if(A=m>0&&(u.columns||0)>=80?$+" ".repeat(m)+R:(R?`${nD.gray(`[${R}]`)} `:"")+$,A+=g0(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 g0(D){return D.replace(/`([^`]+)`/gm,(u,i)=>nD.cyan(i)).replace(/\s+_([^_]+)_\s+/gm,(u,i)=>` ${nD.underline(i)} `)}function k4(D="white"){return nD[D]||nD.white}function v4(D="bgWhite"){return nD[`bg${D[0].toUpperCase()}${D.slice(1)}`]||nD.bgWhite}function j4(D={}){let u=O4();if(process.env.CONSOLA_LEVEL)u=Number.parseInt(process.env.CONSOLA_LEVEL)??u;return _i({level:u,defaults:{level:u},stdout:process.stdout,stderr:process.stderr,prompt:(...C)=>Promise.resolve().then(() => (ai(),pi)).then((h)=>h.prompt(...C)),reporters:D.reporters||[D.fancy??!(E8||h8)?new CC:new z0],...D})}function O4(){if($4)return ED.debug;if(h8)return ED.warn;return ED.info}var k=j4();import lr from"node:http";import Gr from"node:https";o0();o0();v0();var bu=!!globalThis.process?.env?.FORCE_NODE_FETCH,M8=!bu&&globalThis.fetch||c7,bf=!bu&&globalThis.Blob||Hu,Sf=!bu&&globalThis.File||F2,lf=!bu&&globalThis.FormData||Yu,n7=!bu&&globalThis.Headers||Du,Gf=!bu&&globalThis.Request||d2,Uf=!bu&&globalThis.Response||WD,B7=!bu&&globalThis.AbortController||n3;var Vh=/"(?:_|\\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*:/,Hh=/"(?: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*:/,Wh=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Kh(D,u){if(D==="__proto__"||D==="constructor"&&u&&typeof u==="object"&&"prototype"in u){Ph(D);return}return u}function Ph(D){console.warn(`[destr] Dropping "${D}" key to prevent prototype pollution.`)}function s7(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(!Wh.test(D)){if(u.strict)throw SyntaxError("[destr] Invalid JSON");return D}try{if(Vh.test(D)||Hh.test(D)){if(u.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(D,Kh)}return JSON.parse(D)}catch(C){if(u.strict)throw C;return D}}var Jf=String.fromCharCode;var qh=/#/g,gh=/&/g,kh=/\//g,vh=/=/g;var Y8=/\+/g,jh=/%5e/gi,Oh=/%60/gi;var oh=/%7c/gi;var dh=/%20/gi;function ph(D){return encodeURI(""+D).replace(oh,"|")}function L8(D){return ph(typeof D==="string"?D:JSON.stringify(D)).replace(Y8,"%2B").replace(dh,"+").replace(qh,"%23").replace(gh,"%26").replace(Oh,"`").replace(jh,"^").replace(kh,"%2F")}function Q8(D){return L8(D).replace(vh,"%3D")}function $7(D=""){try{return decodeURIComponent(""+D)}catch{return""+D}}function ah(D){return $7(D.replace(Y8," "))}function xh(D){return $7(D.replace(Y8," "))}function eh(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=ah(C[1]);if(h==="__proto__"||h==="constructor")continue;let f=xh(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 Dr(D,u){if(typeof u==="number"||typeof u==="boolean")u=String(u);if(!u)return Q8(D);if(Array.isArray(u))return u.map((i)=>`${Q8(D)}=${L8(i)}`).join("&");return`${Q8(D)}=${L8(u)}`}function ur(D){return Object.keys(D).filter((u)=>D[u]!==void 0).map((u)=>Dr(u,D[u])).filter(Boolean).join("&")}var Fr=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,ir=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Cr=/^([/\\]\s*){2,}[^/\\]/;var Er=/\/$|\/\?|\/#/,hr=/^\.?\//;function A7(D,u={}){if(typeof u==="boolean")u={acceptRelative:u};if(u.strict)return Fr.test(D);return ir.test(D)||(u.acceptRelative?Cr.test(D):!1)}function X8(D="",u){if(!u)return D.endsWith("/");return Er.test(D)}function rr(D="",u){if(!u)return(X8(D)?D.slice(0,-1):D)||"/";if(!X8(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 fr(D="",u){if(!u)return D.endsWith("/")?D:D+"/";if(X8(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 w7(D,u){if(cr(u)||A7(D))return D;let i=rr(u);if(D.startsWith(i)){let C=D[i.length];if(!C||C==="/"||C==="?")return D}return Br(i,D)}function m7(D,u){let i=R7(D),C={...eh(i.search),...u};return i.search=ur(C),sr(i)}function cr(D){return!D||D==="/"}function nr(D){return D&&D!=="/"}function Br(D,...u){let i=D||"";for(let C of u.filter((h)=>nr(h)))if(i){let h=C.replace(hr,"");i=fr(i)+h}else i=C;return i}var _7=Symbol.for("ufo:protocolRelative");function R7(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(!A7(D,{acceptRelative:!0}))return u?R7(u+D):t7(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:$}=t7(B);return{protocol:C.toLowerCase(),auth:h?h.slice(0,Math.max(0,h.length-1)):"",host:E,pathname:s,search:A,hash:$,[_7]:!C}}function t7(D=""){let[u="",i="",C=""]=(D.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:u,search:i,hash:C}}function sr(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[_7]?(D.protocol||"")+"//":"")+h+f+u+i+C}class p2 extends Error{constructor(D,u){super(D,u);if(this.name="FetchError",u?.cause&&!this.cause)this.cause=u.cause}}function S7(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 p2(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}var tr=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function b7(D="GET"){return tr.has(D.toUpperCase())}function $r(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"}var Ar=new Set(["image/svg","application/xml","application/xhtml","application/html"]),wr=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function mr(D=""){if(!D)return"json";let u=D.split(";").shift()||"";if(wr.test(u))return"json";if(u==="text/event-stream")return"stream";if(Ar.has(u)||u.startsWith("text/"))return"text";return"blob"}function _r(D,u,i,C){let h=Rr(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 Rr(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 s3(D,u){if(u)if(Array.isArray(u))for(let i of u)await i(D);else await u(D)}var br=new Set([408,409,425,429,500,502,503,504]),Sr=new Set([101,204,205,304]);function Z8(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 $=b7(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):br.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=S7(B);if(Error.captureStackTrace)Error.captureStackTrace(A,f);throw A}let f=async function(s,A={}){let $={request:s,options:_r(s,A,D.defaults,i),response:void 0,error:void 0};if($.options.method)$.options.method=$.options.method.toUpperCase();if($.options.onRequest){if(await s3($,$.options.onRequest),!($.options.headers instanceof i))$.options.headers=new i($.options.headers||{})}if(typeof $.request==="string"){if($.options.baseURL)$.request=w7($.request,$.options.baseURL);if($.options.query)$.request=m7($.request,$.options.query),delete $.options.query;if("query"in $.options)delete $.options.query;if("params"in $.options)delete $.options.params}if($.options.body&&b7($.options.method)){if($r($.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 s3($,$.options.onRequestError);return await h($)}finally{if(R)clearTimeout(R)}if(($.response.body||$.response._bodyInit)&&!Sr.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||s7;$.response._data=y(S);break}case"stream":{$.response._data=$.response.body||$.response._bodyInit;break}default:$.response._data=await $.response[l]()}}if($.options.onResponse)await s3($,$.options.onResponse);if(!$.options.ignoreResponseError&&$.response.status>=400&&$.response.status<600){if($.options.onResponseError)await s3($,$.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={})=>Z8({...D,...s,defaults:{...D.defaults,...s.defaults,...B}}),E}function Ur(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||"false"))return M8;let u={keepAlive:!0},i=new lr.Agent(u),C=new Gr.Agent(u),h={agent(f){return f.protocol==="http:"?i:C}};return function(E,B){return M8(E,{...h,...B})}}var Ir=globalThis.fetch?(...D)=>globalThis.fetch(...D):Ur(),Tr=globalThis.Headers||n7,yr=globalThis.AbortController||B7,l7=Z8({fetch:Ir,Headers:Tr,AbortController:yr});import{existsSync as U7,readFileSync as Qr}from"node:fs";import{join as G7}from"node:path";import{mkdirSync as Jr}from"node:fs";import{homedir as Nr}from"node:os";import{join as z8}from"node:path";var Wu="http://localhost:8000",Mr="e2e",t3=z8(Nr(),".mitsein");function $3(){return Jr(t3,{recursive:!0,mode:448}),t3}function Ku(D=Mr){return z8(t3,"oauth",`${D}.json`)}function A3(){return z8(t3,"openapi.json")}class X extends Error{code;detail;constructor(D,u=1,i){super(D);this.name="CliError",this.code=u,this.detail=i}}class V8 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 c2 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 r}}}function Kn(u){try{return new URL(u).hostname}catch{return""}}function vn(u){let D=Kn(u);return D==="localhost"||D==="127.0.0.1"||D==="::1"||D==="0.0.0.0"}function jn(u){let D=[];if(u)D.push(u);D.push(process.cwd());for(let t of D){let r=t;for(let n=0;n<10;n++){let F=gt(r,"scripts","dev-token.sh");if(Lt(F))return F;let i=gt(r,"..");if(i===r)break;r=i}}return null}function On(u,D){let t=[u,"--raw"];if(D)t.push("--real");let r=Bun.spawnSync(["bash",...t],{timeout:1e4,stdout:"pipe",stderr:"pipe"}),n=r.stdout.toString().trim();return{ok:r.success&&n.length>0,stdout:n}}function dn(u,D){if(u)return{token:u,endpoint:D??p};return null}function pn(){let u=process.env.MITSEIN_TOKEN;if(u)return{token:u,endpoint:process.env.MITSEIN_API_URL??p};return null}function xn(u,D){let t=x(u);if(!Lt(t))return null;try{let r=kn(t,"utf8"),n=JSON.parse(r),F=n.access_token;if(F)return{token:F,endpoint:D??n.endpoint??p}}catch{}return null}function u0(u,D,t,r){let n=u??p;if(!vn(n))return null;let F=jn(t);if(!F)return null;try{let{ok:i,stdout:e}=r(F,D);if(i)return{token:e,endpoint:n}}catch{}return null}function Y(u={}){let D=u.profile??"e2e",t=u.spawnDevToken??On,r=dn(u.token,u.endpoint);if(r)return r;let n=pn();if(n)return n;let F=xn(D,u.endpoint);if(F)return F;let i=u0(u.endpoint,u.real??!1,u.projectRoot,t);if(i)return i;throw new fD}function D0(u){return u.replace(/\/$/,"")}function K(u,D){if(u)process.stderr.write(`[debug] ${D}
100
- `)}function t0(u){let D="HTTP error",t;if(u!==null&&typeof u==="object"&&!Array.isArray(u)){let r=u;D=typeof r.message==="string"?r.message:D,t=r.detail??r.error}return{message:D,detail:t}}async function hu(u){try{return await u}catch(D){if(D instanceof Eu){let t=D.statusCode??D.status??0,{message:r,detail:n}=t0(D.data);throw new iu(t||599,r,n)}throw D}}class y{timeoutMs;debug;fetchImpl;baseUrl;bearerToken;constructor(u,D={}){this.debug=D.debug??!1,this.timeoutMs=D.timeoutSec===void 0||D.timeoutSec===0?void 0:D.timeoutSec*1000,this.baseUrl=D0(u.endpoint),this.bearerToken=u.token;let t=this.debug;this.fetchImpl=D.fetcher??Mt.create({baseURL:this.baseUrl,timeout:this.timeoutMs,headers:{Authorization:`Bearer ${u.token}`,"Content-Type":"application/json"},retry:0,onRequest({request:r}){K(t,`${r.method} ${r.url}`)},onResponse({response:r}){K(t,`\u2192 ${r.status} (${r.headers.get("content-length")??"?"} bytes)`)}})}static fromOptions(u){let{timeoutSec:D,debug:t,fetcher:r,...n}=u,F=Y(n);return new y(F,{timeoutSec:D,debug:t,fetcher:r})}async get(u,D){let t=u.startsWith("/")?u:`/${u}`;return hu(this.fetchImpl(t,{method:"GET",query:D??void 0}))}async post(u,D){let t=u.startsWith("/")?u:`/${u}`;if(this.debug&&D!==void 0&&D!==null)K(this.debug,`body: ${JSON.stringify(D)}`);return hu(this.fetchImpl(t,{method:"POST",body:D===void 0||D===null?void 0:D}))}async postForm(u,D){let t=u.startsWith("/")?u:`/${u}`,r={};for(let[f,C]of Object.entries(D??{}))if(C!==void 0&&C!==null)r[f]=String(C);if(this.debug)K(this.debug,`POST ${t}`),K(this.debug,`form: ${JSON.stringify(r)}`);let n=`${this.baseUrl}${t}`,F=new URLSearchParams(r),i=new AbortController,e=this.timeoutMs,s=e===void 0?null:setTimeout(()=>i.abort(),e);try{let f=await fetch(n,{method:"POST",headers:{Authorization:`Bearer ${this.bearerToken}`,"Content-Type":"application/x-www-form-urlencoded"},body:F,signal:i.signal});if(K(this.debug,`\u2192 ${f.status} (${f.headers.get("content-length")??"?"} bytes)`),f.ok){if((f.headers.get("content-type")??"").includes("application/json"))return f.json();return f.text()}let C=`HTTP ${f.status}`,E;try{let c=await f.json();C=typeof c.message==="string"?c.message:C,E=c.detail??c.error}catch{}throw new iu(f.status,C,E)}catch(f){if(f instanceof iu)throw f;if(f instanceof Error&&f.name==="AbortError")throw new iu(599,"Request aborted or timed out");throw f}finally{if(s)clearTimeout(s)}}async patch(u,D){let t=u.startsWith("/")?u:`/${u}`;if(this.debug&&D!==void 0&&D!==null)K(this.debug,`body: ${JSON.stringify(D)}`);return hu(this.fetchImpl(t,{method:"PATCH",body:D===void 0||D===null?void 0:D}))}async put(u,D){let t=u.startsWith("/")?u:`/${u}`;if(this.debug&&D!==void 0&&D!==null)K(this.debug,`body: ${JSON.stringify(D)}`);return hu(this.fetchImpl(t,{method:"PUT",body:D===void 0||D===null?void 0:D}))}async delete(u){let D=u.startsWith("/")?u:`/${u}`;return hu(this.fetchImpl(D,{method:"DELETE"}))}}var ED=!1;function _(u){ED=u}function Qt(){return ED}function Wt(){return process.stdout.isTTY===!0}function $(u,D){if(ED){process.stdout.write(`${JSON.stringify(u,i0)}
101
- `);return}if(D){D(u);return}if(u!==null&&typeof u==="object"&&!Array.isArray(u)){Pt(u);return}if(Array.isArray(u)){for(let t of u){if(t!==null&&typeof t==="object"&&!Array.isArray(t))Pt(t);else process.stdout.write(`${String(t)}
111
+ `),process.exit(130);throw C}}}function Lr(D){try{return new URL(D).hostname}catch{return""}}function Xr(D){let u=Lr(D);return u==="localhost"||u==="127.0.0.1"||u==="::1"||u==="0.0.0.0"}function Yr(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=G7(C,"scripts","dev-token.sh");if(U7(f))return f;let E=G7(C,"..");if(E===C)break;C=E}}return null}function Zr(D,u){let{execFileSync:i}=zD("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 zr(D,u){if(D)return{token:D,endpoint:u??Wu};return null}function Vr(){let D=process.env.MITSEIN_TOKEN;if(D)return{token:D,endpoint:process.env.MITSEIN_API_URL??Wu};return null}function Hr(D,u){let i=Ku(D);if(!U7(i))return null;try{let C=Qr(i,"utf8"),h=JSON.parse(C),f=h.access_token;if(f)return{token:f,endpoint:u??h.endpoint??Wu}}catch{}return null}function Wr(D,u,i,C){let h=D??Wu;if(!Xr(h))return null;let f=Yr(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??Zr,C=zr(D.token,D.endpoint);if(C)return C;let h=Vr();if(h)return h;let f=Hr(u,D.endpoint);if(f)return f;let E=Wr(D.endpoint,D.real??!1,D.projectRoot,i);if(E)return E;throw new V8}function Kr(D){return D.replace(/\/$/,"")}function Su(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 a2(D){try{return await D}catch(u){if(u instanceof p2){let i=u.statusCode??u.status??0,{message:C,detail:h}=Pr(u.data);throw new c2(i||599,C,h)}throw u}}class a{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=Kr(D.endpoint),this.bearerToken=D.token;let i=this.debug;this.fetchImpl=u.fetcher??l7.create({baseURL:this.baseUrl,timeout:this.timeoutMs,headers:{Authorization:`Bearer ${D.token}`,"Content-Type":"application/json"},retry:0,onRequest({request:C}){Su(i,`${C.method} ${C.url}`)},onResponse({response:C}){Su(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 a(f,{timeoutSec:u,debug:i,fetcher:C})}async get(D,u){let i=D.startsWith("/")?D:`/${D}`;return a2(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)Su(this.debug,`body: ${JSON.stringify(u)}`);return a2(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)Su(this.debug,`POST ${i}`),Su(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(Su(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 c2(A.status,$,R)}catch(A){if(A instanceof c2)throw A;if(A instanceof Error&&A.name==="AbortError")throw new c2(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)Su(this.debug,`body: ${JSON.stringify(u)}`);return a2(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)Su(this.debug,`body: ${JSON.stringify(u)}`);return a2(this.fetchImpl(i,{method:"PUT",body:u===void 0||u===null?void 0:u}))}async delete(D){let u=D.startsWith("/")?D:`/${D}`;return a2(this.fetchImpl(u,{method:"DELETE"}))}}var H8=!1;function P(D){H8=D}function T7(){return H8}function y7(){return process.stdout.isTTY===!0}function V(D,u){if(H8){process.stdout.write(`${JSON.stringify(D,qr)}
113
+ `);return}if(u){u(D);return}if(D!==null&&typeof D==="object"&&!Array.isArray(D)){I7(D);return}if(Array.isArray(D)){for(let i of D){if(i!==null&&typeof i==="object"&&!Array.isArray(i))I7(i);else process.stdout.write(`${String(i)}
102
114
  `);process.stdout.write(`
103
- `)}return}process.stdout.write(`${u===void 0?"":String(u)}
104
- `)}function i0(u,D){if(typeof D==="bigint")return D.toString();return D}function Pt(u){for(let[D,t]of Object.entries(u))process.stdout.write(`${D}: ${String(t)}
105
- `)}function r0(u){let D=new Date(u*1000),t=String(D.getHours()).padStart(2,"0"),r=String(D.getMinutes()).padStart(2,"0"),n=String(D.getSeconds()).padStart(2,"0");return`${t}:${r}:${n}`}function zt(u,D){return u.length>D?`${u.slice(0,D)}...`:u}function Yt(u){let D=u.data;if(typeof D!=="object"||D===null){process.stdout.write(`\x1B[2m${String(D)}\x1B[0m
106
- `);return}let t=u.event_type,r=typeof D.content==="string"?D.content:"",n=r0(u.timestamp);if(t==="assistant"||t==="text"||t==="message")process.stdout.write(`\x1B[2m[${n}]\x1B[0m \x1B[1massistant:\x1B[0m ${r}
107
- `);else if(t==="tool_call"){let F=(typeof D.name==="string"?D.name:null)??(typeof D.tool_name==="string"?D.tool_name:null)??"?",i=D.arguments??D.args??"";if(typeof i==="string")i=zt(i,80);else i=JSON.stringify(i);process.stdout.write(`\x1B[2m[${n}]\x1B[0m \x1B[33mtool_call:\x1B[0m ${F}(${String(i)})
108
- `)}else if(t==="tool_result"){let F=D.output??D.result??D.content??"";if(typeof F==="string")F=zt(F,100);else F=JSON.stringify(F);process.stdout.write(`\x1B[2m[${n}]\x1B[0m \x1B[32mtool_result:\x1B[0m ${String(F)}
109
- `)}else if(t==="status"){let F=typeof D.status==="string"?D.status:"";process.stdout.write(`\x1B[2m[${n}]\x1B[0m \x1B[34mstatus:\x1B[0m ${F}
110
- `)}else if(t==="error")process.stdout.write(`\x1B[2m[${n}]\x1B[0m \x1B[1m\x1B[31merror:\x1B[0m ${r}
111
- `);else{let F=JSON.stringify(D).slice(0,120);process.stdout.write(`\x1B[2m[${n}]\x1B[0m \x1B[2m${t}:\x1B[0m ${F}
112
- `)}}function qt(u){let D=String(u.status??""),t=Number(u.duration_ms??0)/1000,r=u.events_count;if(D==="succeeded")process.stdout.write(`
113
- \x1B[1m\x1B[32m\u2713\x1B[0m run completed in ${t.toFixed(1)}s (${r} events)
114
- `);else if(D==="failed"){let n=String(u.error??"");process.stdout.write(`
115
- \x1B[1m\x1B[31m\u2717\x1B[0m run failed in ${t.toFixed(1)}s: ${n}
116
- `)}else if(D==="disconnected")process.stdout.write(`
117
- \x1B[2mdisconnected after ${t.toFixed(1)}s (${r} events)\x1B[0m
118
- `)}function Zt(u,D){return u&&!D&&Wt()}function n0(u){return u.replace(/\/$/,"")}function F0(u,D=!1){let t=u.trim().split(`
119
- `),r=[];for(let i of t){if(i.startsWith(":")){if(D)process.stderr.write(`[debug] SSE comment: ${i}
120
- `);continue}if(i.startsWith("data: "))r.push(i.slice(6));else if(i.startsWith("data:"))r.push(i.slice(5))}if(r.length===0)return null;let n=r.join(`
121
- `),F=Date.now()/1000;try{let i=JSON.parse(n);return{event_type:typeof i==="object"&&i!==null&&"type"in i&&typeof i.type==="string"?i.type:"message",data:i,raw:n,timestamp:F}}catch{return{event_type:"unknown",data:n,raw:n,timestamp:F}}}async function*at(u){let D=`${n0(u.endpoint)}${u.path.startsWith("/")?u.path:`/${u.path}`}`;if(u.debug)process.stderr.write(`[debug] SSE connecting to ${D}
122
- `);let t=Date.now(),r=u.timeoutSec===void 0||u.timeoutSec===null||u.timeoutSec===0?null:u.timeoutSec*1000,n=await fetch(D,{headers:{Authorization:`Bearer ${u.token}`,Accept:"text/event-stream"},signal:u.signal});if(!n.ok)throw new o(`SSE connection failed: HTTP ${n.status}`,3);if(u.debug)process.stderr.write(`[debug] SSE connected (${n.status})
123
- `);let F=n.body;if(!F)throw new o("SSE response has no body",3);let i=F.getReader(),e=new TextDecoder,s="";try{for(;;){let{done:f,value:C}=await i.read();if(f)break;s+=e.decode(C,{stream:!0});let E;while((E=s.indexOf(`
115
+ `)}return}process.stdout.write(`${D===void 0?"":String(D)}
116
+ `)}function qr(D,u){if(typeof u==="bigint")return u.toString();return u}function I7(D){for(let[u,i]of Object.entries(D))process.stdout.write(`${u}: ${String(i)}
117
+ `)}function gr(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 J7(D,u){return D.length>u?`${D.slice(0,u)}...`:D}function N7(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=gr(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=J7(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=J7(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 M7(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 Q7(D,u){return D&&!u&&y7()}function kr(D){return D.replace(/\/$/,"")}function vr(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*L7(D){let u=`${kr(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 c=s.slice(0,E);s=s.slice(E+2);let B=F0(c,u.debug??!1);if(B!==null){if(yield B,r!==null&&Date.now()-t>r)throw new o("Stream timeout",124)}}}}finally{i.releaseLock()}}function e0(u,D,t){if(t&&!t.has(u.event_type))return;if(D)if(typeof u.data==="object"&&u.data!==null){let r={ts:u.timestamp,...u.data};process.stdout.write(`${JSON.stringify(r)}
126
- `)}else process.stdout.write(`${JSON.stringify({ts:u.timestamp,type:u.event_type,raw:u.data})}
127
- `);else Yt(u)}async function uu(u){let D=Date.now(),t=[],r="unknown",n=null,F=[],i=[],e=u.stream_output??!1,s=u.json_mode??Qt(),f=u.event_filter??null,C=u.debug??!1,E=u.eventStream==null,c=E?new AbortController:null,B=()=>{c?.abort()};if(E)process.once("SIGINT",B);let A=`/api/agent-run/${u.agent_run_id}/stream`,S=u.eventStream??at({endpoint:u.endpoint,path:A,token:u.token,timeoutSec:u.timeout??void 0,debug:C,signal:c?.signal});try{try{for await(let G of S){if(t.push({type:G.event_type,data:G.data}),u.on_event?.(G),e)e0(G,s,f);if(typeof G.data==="object"&&G.data!==null){let{data:P,event_type:j}=G;if(j==="status"){let Du=typeof P.status==="string"?P.status:"";if(Du==="completed"){r="succeeded";break}if(Du==="failed"||Du==="error"){r="failed",n=(typeof P.content==="string"?P.content:null)??(typeof P.error==="string"?P.error:null)??null;break}}else if(j==="error"){r="failed",n=(typeof P.content==="string"?P.content:null)??String(G.data);break}else if(j==="assistant"||j==="text"||j==="message"){let Du=typeof P.content==="string"?P.content:"";if(Du)F.push(Du)}else if(j==="tool_call"||j==="tool_result")i.push(P)}}}catch(G){if(G!==null&&typeof G==="object"&&G.name==="AbortError"){if(!s)process.stderr.write(`
137
+ `))!==-1){let m=s.slice(0,R);s=s.slice(R+2);let l=vr(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 jr(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 N7(D)}async function Pu(D){let u=Date.now(),i=[],C="unknown",h=null,f=[],E=[],B=D.stream_output??!1,s=D.json_mode??T7(),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??L7({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)jr(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
- `);r="disconnected"}else throw G}}finally{if(E)process.off("SIGINT",B)}let M=Date.now()-D,X={status:r,agent_run_id:u.agent_run_id,duration_ms:M,events_count:t.length};if(F.length>0)X.assistant_message=F.join("");if(i.length>0)X.tool_calls=i;if(n)X.error=n;if(Zt(e,s))qt(X);if(r==="failed")throw new o(`Run failed: ${n??"unknown error"}`,1,X);return X}function m(u){return u.optsWithGlobals()}function ru(u){if(!u)return null;let D=u.split(",").map((t)=>t.trim()).filter((t)=>t.length>0);return D.length>0?new Set(D):null}function I(u){let D=u.timeout??"30",t=Number.parseFloat(D);if(!Number.isFinite(t))return 30;if(t===0)return;return t}function Xt(u){u.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(w(async function(r,n){let F=m(this),i=this.opts();if(_(Boolean(F.json)),i.wait&&i.stream)throw new o("--wait and --stream are mutually exclusive",2);let e=Y({token:F.token,endpoint:F.endpoint,profile:F.profile??"e2e",real:F.real}),s=new y(e,{debug:F.debug,timeoutSec:I(F)}),f=await s.post("/api/message/add",{thread_id:r,content:n}),C={};if(i.model)C.model_name=i.model;let c=(await s.postForm(`/api/thread/${r}/agent/start`,C)).agent_run_id??"";if(!i.wait&&!i.stream){$({message:f,agent_run_id:c,status:"started"});return}let B=i.timeout??"120",A=Number.parseFloat(B),S=Number.isFinite(A)&&A===0?null:Number.isFinite(A)?A:120,M=await uu({endpoint:e.endpoint,token:e.token,agent_run_id:c,timeout:S??void 0,stream_output:Boolean(i.stream),json_mode:Boolean(F.json),debug:F.debug,event_filter:ru(i.filter)});if(i.wait&&!i.stream)$(M)}))}import{readFileSync as kt}from"fs";import{existsSync as Ht,readFileSync as s0,writeFileSync as C0}from"fs";function hD(u){let D=u.replace(/([a-z0-9])([A-Z])/g,"$1-$2");return D=D.replace(/[_\s/]+/g,"-"),D=D.replace(/-+/g,"-"),D=D.replace(/^-+|-+$/g,""),D.toLowerCase()}class Vt{_spec;_operations=new Map;_byId=new Map;constructor(u){this._spec=u,this.parse()}parse(){let u=this._spec.paths;if(u===null||typeof u!=="object"||Array.isArray(u))return;for(let[D,t]of Object.entries(u)){if(t===null||typeof t!=="object"||Array.isArray(t))continue;let r=t;if("$ref"in r&&Object.keys(r).length===1)continue;for(let n of["get","post","put","patch","delete"]){let F=r[n];if(F===null||typeof F!=="object"||Array.isArray(F))continue;let i=F,e=typeof i.operationId==="string"?i.operationId:"",s=Array.isArray(i.tags)?i.tags:["untagged"],f=typeof s[0]==="string"?s[0]:"untagged",C=hD(f),E=typeof i.summary==="string"?i.summary:"",c=Array.isArray(i.parameters)?i.parameters:[],B=i.requestBody!==null&&typeof i.requestBody==="object"&&!Array.isArray(i.requestBody)?i.requestBody:null,A=e?hD(e):`${n}-${hD(D)}`,S={operation_id:A,tag:C,method:n,path:D,summary:E,parameters:c,request_body:B},M=this._operations.get(C)??[];M.push(S),this._operations.set(C,M),this._byId.set(A,S)}}}get tags(){return[...this._operations.keys()].sort()}operationsForTag(u){return this._operations.get(u)??[]}getOperation(u){return this._byId.get(u)}get allOperations(){return[...this._byId.values()]}}function cD(u){let D=s0(u,"utf8");try{return JSON.parse(D)}catch{let t=D.trim();if(t.startsWith("openapi:")||t.startsWith("swagger:"))throw new o(`File ${u} appears to be YAML; install a YAML parser or use JSON.`,2);throw new o(`Failed to parse ${u} as JSON`,2)}}async function f0(u,D){let t=`${u.replace(/\/$/,"")}/openapi.json`,r;try{r=await fetch(t,{signal:AbortSignal.timeout(1e4)})}catch(F){throw new o(`Failed to fetch OpenAPI spec from ${t}: ${F}`,3)}if(!r.ok)throw new o(`Failed to fetch OpenAPI spec from ${t}: HTTP ${r.status}`,3);let n=await r.json();try{Uu(),C0(D,`${JSON.stringify(n,null,2)}
130
- `,"utf8")}catch{}return n}async function BD(u={}){let D=process.env.MITSEIN_OPENAPI_PATH;if(D)return cD(D);let t=Iu();if(!u.refresh&&Ht(t))try{return cD(t)}catch{}if(u.endpoint)return f0(u.endpoint,t);if(Ht(t))return cD(t);throw new o("No OpenAPI spec available. Run `mitsein dev openapi --refresh` or set MITSEIN_OPENAPI_PATH.",2)}async function Gu(u={}){let D=await BD(u);return new Vt(D)}function E0(u){let D={},t=0;while(t<u.length){let r=u[t];if(r===void 0)break;if(r.startsWith("--")){let n=r.replace(/^-+/,""),F=u[t+1];if(F!==void 0&&!F.startsWith("--"))D[n]=F,t+=2;else D[n]="true",t+=1}else t+=1}return D}function h0(u,D){if(D){let t=kt(0,"utf8");try{return JSON.parse(t)}catch(r){throw new o(`Invalid JSON from stdin: ${r}`,2)}}if(u===void 0)return;if(u.startsWith("@")){let t=u.slice(1);try{let r=kt(t,"utf8");return JSON.parse(r)}catch(r){if(r.code==="ENOENT")throw new o(`File not found: ${t}`,2);throw new o(`Invalid JSON in ${t}: ${r}`,2)}}try{return JSON.parse(u)}catch(t){throw new o(`Invalid JSON body: ${t}`,2)}}async function c0(u,D,t,r){let{path:n,method:F}=D,i=[...n.matchAll(/\{(\w+)\}/g)].map((s)=>s[1]??""),e={...r};for(let s of i)if(s in e){let f=e[s];delete e[s],n=n.replace(`{${s}}`,f??"")}else throw new o(`Missing required path parameter: --${s}`,2);if(F==="get"){let s=Object.keys(e).length>0?{...e}:void 0;return u.get(n,s)}if(F==="post")return u.post(n,t);if(F==="patch")return u.patch(n,t);if(F==="put")return u.put(n,t);if(F==="delete")return u.delete(n);throw new o(`Unsupported HTTP method: ${F}`,2)}function B0(u){let D=u;R.log(` \x1B[1m${D.tag??""}\x1B[0m (${D.operations??0} operations)`)}function o0(u){let D=u,t=D.method??"",r=t==="GET"?"\x1B[32m":t==="POST"?"\x1B[34m":t==="PATCH"?"\x1B[33m":t==="DELETE"?"\x1B[31m":"\x1B[37m",n=(D.operation??"").padEnd(30);R.log(` ${r}${t.padEnd(6)}\x1B[0m ${n} ${D.summary??""}`)}function Kt(u){let D=u.command("api").description("Auto-generated API commands from OpenAPI spec");D.command("list-tags").description("List all available API tags").option("--endpoint <url>","API base URL").action(w(async function(){let r=m(this),n=this.opts();_(Boolean(r.json));let F=await Gu({endpoint:n.endpoint??r.endpoint});for(let i of F.tags){let e=F.operationsForTag(i);$({tag:i,operations:e.length},B0)}})),D.command("list-ops <tag>").description("List operations for a tag").option("--endpoint <url>","API base URL").action(w(async function(r){let n=m(this),F=this.opts();_(Boolean(n.json));let i=await Gu({endpoint:F.endpoint??n.endpoint}),e=i.operationsForTag(r);if(e.length===0)throw new o(`Unknown tag '${r}'. Available: ${i.tags.join(", ")}`,2);for(let s of e)$({operation:s.operation_id,method:s.method.toUpperCase(),path:s.path,summary:s.summary},o0)})),D.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(w(async function(r,n){let F=m(this),i=this.opts();_(Boolean(F.json));let e=await Gu({endpoint:i.endpoint??F.endpoint}),s=e.getOperation(n);if(s===void 0){let M=e.operationsForTag(r);if(M.length===0){let G=e.tags.length>0?e.tags.join(", "):"(none \u2014 run `mitsein dev openapi --refresh`)";throw new o(`Unknown tag '${r}'. Available tags: ${G}`,2)}let X=M.map((G)=>G.operation_id).join(", ");throw new o(`Unknown operation '${n}' in tag '${r}'. Available: ${X}`,2)}if(s.tag!==r)throw new o(`Operation '${n}' belongs to tag '${s.tag}', not '${r}'.`,2);let f=h0(i.body,Boolean(i.bodyStdin)),C=E0(this.args.slice(2)),E=i.timeout??F.timeout??"30",c=Number.parseFloat(E),B=Number.isFinite(c)&&c===0?void 0:Number.isFinite(c)?c:30,A=y.fromOptions({token:i.token??F.token,endpoint:i.endpoint??F.endpoint,profile:F.profile??"e2e",real:F.real,timeoutSec:B,debug:Boolean(i.debug??F.debug)}),S=await c0(A,s,f,C);$(S)}))}import{existsSync as pt,readFileSync as R0,unlinkSync as S0}from"fs";import{createServer as _0}from"http";import{parse as m0}from"querystring";import{execFileSync as oD}from"child_process";import{chmodSync as l0,mkdirSync as $0,writeFileSync as A0}from"fs";import{dirname as w0}from"path";var vt=19284;function Nu(u,D,t){Uu();let r=x(u);$0(w0(r),{recursive:!0,mode:448});let n={access_token:t.access_token??"",user_email:t.user_email??"",user_id:t.user_id??"",endpoint:D,created_at:Date.now()/1000,expires_in:t.expires_in??86400};A0(r,`${JSON.stringify(n,null,2)}
131
- `,"utf8"),l0(r,384)}function Ju(u){try{if(process.platform==="darwin")oD("open",[u],{stdio:"ignore"});else if(process.platform==="win32")oD("cmd",["/c","start","",u],{stdio:"ignore"});else oD("xdg-open",[u],{stdio:"ignore"})}catch{}}function jt(u){return(u??process.env.MITSEIN_API_URL??p).replace(/\/$/,"")}function nu(u,D){let t=u[D];if(Array.isArray(t))return t[0];return t}async function Ot(u,D,t,r){let n={};if(await new Promise((F,i)=>{let e=!1,s,f=()=>{if(e)return;if(e=!0,s!==void 0)clearTimeout(s);C.close(()=>F())},C=_0((E,c)=>{let B=E.url??"",A="";try{A=new URL(B,"http://127.0.0.1").pathname}catch{A=""}if(A!=="/callback"){c.writeHead(404),c.end(),f();return}let S=B.includes("?")?m0(B.split("?",2)[1]??""):{};if(S.error){c.writeHead(200,{"Content-Type":"text/html"});let M=nu(S,"error_description")??nu(S,"error")??"Unknown error";c.end(`<html><body><h2>Login failed</h2><p>${String(M)}</p></body></html>`),n.error=String(M),f();return}if(S.account)n.account=nu(S,"account")??"";if(S.email)n.email=nu(S,"email")??"";if(S.token)n.token=nu(S,"token")??"";if(S.session_id)n.session_id=nu(S,"session_id")??"";c.writeHead(200,{"Content-Type":"text/html"}),c.end("<html><body><h2>Login successful!</h2><p>You can close this window.</p></body></html>"),n.success=!0,f()});C.once("error",(E)=>{if(!e){if(e=!0,s!==void 0)clearTimeout(s);i(E)}}),s=setTimeout(()=>f(),300000),C.listen(vt,"127.0.0.1",()=>{let E=`${u}/api/auth/cognito/login?provider=${encodeURIComponent(D)}`;if(!r)R.log(`
132
- Opening browser for login...`),R.log(`If browser does not open, visit: ${E}
133
- `);if(Ju(E),!r)R.log("Waiting for browser login...")})}),n.error!==void 0)throw new o(`Login failed: ${String(n.error)}`,1);if(n.success===!0){let F={access_token:String(n.token??""),user_email:String(n.email??""),user_id:String(n.account??"")};Nu(t,u,F),$({status:"logged_in",email:F.user_email,profile:t},()=>{R.success(`Logged in as ${F.user_email}`)});return}throw new o("Login timed out. Try again.",124)}async function b0(u){await new Promise((D)=>setTimeout(D,u))}async function dt(u,D,t){let r=await fetch(`${u}/api/auth/cli/device`,{method:"POST",signal:AbortSignal.timeout(1e4)});if(!r.ok)throw new o(`Failed to create device code: HTTP ${r.status}`,3);let n=await r.json(),{device_code:F,user_code:i,verification_url:e,expires_in:s}=n,f=n.interval??5,C=`${e}?user_code=${encodeURIComponent(i)}`;if(!t)R.log(`
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(Q7(B,s))M7(M);if(C==="failed")throw new X(`Run failed: ${h??"unknown error"}`,1,M);return M}function q(D){return D.optsWithGlobals()}function n2(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 X7(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 a(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 Pu({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:n2(E.filter)});if(E.wait&&!E.stream)V(J)}))}import{readFileSync as z7}from"node:fs";import{existsSync as Y7,readFileSync as Or,writeFileSync as or}from"node:fs";function W8(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 Z7{_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",$=W8(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?W8(B):`${h}-${W8(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 K8(D){let u=Or(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 dr(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{$3(),or(u,`${JSON.stringify(h,null,2)}
142
+ `,"utf8")}catch{}return h}async function P8(D={}){let u=process.env.MITSEIN_OPENAPI_PATH;if(u)return K8(u);let i=A3();if(!D.refresh&&Y7(i))try{return K8(i)}catch{}if(D.endpoint)return dr(D.endpoint,i);if(Y7(i))return K8(i);throw new X("No OpenAPI spec available. Run `mitsein dev openapi --refresh` or set MITSEIN_OPENAPI_PATH.",2)}async function w3(D={}){let u=await P8(D);return new Z7(u)}function pr(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 ar(D,u){if(u){let i=z7(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=z7(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 xr(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 er(D){let u=D;k.log(` \x1B[1m${u.tag??""}\x1B[0m (${u.operations??0} operations)`)}function D5(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 V7(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 w3({endpoint:h.endpoint??C.endpoint});for(let E of f.tags){let B=f.operationsForTag(E);V({tag:E,operations:B.length},er)}})),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 w3({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},D5)})),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 w3({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=ar(E.body,Boolean(E.bodyStdin)),$=pr(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=a.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 xr(S,s,A,$);V(y)}))}import{existsSync as q7,readFileSync as f5,unlinkSync as c5}from"node:fs";import{createServer as E5}from"node:http";import{parse as h5}from"node:querystring";import{execFileSync as q8}from"node:child_process";import{chmodSync as u5,mkdirSync as F5,writeFileSync as i5}from"node:fs";import{dirname as C5}from"node:path";var H7=19284;function m3(D,u,i){$3();let C=Ku(D);F5(C5(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};i5(C,`${JSON.stringify(h,null,2)}
143
+ `,"utf8"),u5(C,384)}function _3(D){try{if(process.platform==="darwin")q8("open",[D],{stdio:"ignore"});else if(process.platform==="win32")q8("cmd",["/c","start","",D],{stdio:"ignore"});else q8("xdg-open",[D],{stdio:"ignore"})}catch{}}function W7(D){return(D??process.env.MITSEIN_API_URL??Wu).replace(/\/$/,"")}function B2(D,u){let i=D[u];if(Array.isArray(i))return i[0];return i}async function K7(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())},$=E5((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("?")?h5(l.split("?",2)[1]??""):{};if(y.error){m.writeHead(200,{"Content-Type":"text/html"});let J=B2(y,"error_description")??B2(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=B2(y,"account")??"";if(y.email)h.email=B2(y,"email")??"";if(y.token)h.token=B2(y,"token")??"";if(y.session_id)h.session_id=B2(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(H7,"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(_3(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??"")};m3(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 r5(D){await new Promise((u)=>setTimeout(u,D))}async function P7(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
- `),R.log("Open this URL in your browser:"),R.log(C),R.log(`Or go to ${e} and enter code:`),R.log(i),R.log(`Waiting for authorization (expires in ${Math.floor(s/60)} min)...`);Ju(C);let E=Date.now()+s*1000;while(Date.now()<E){await b0(f*1000);try{let B=await(await fetch(`${u}/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(),A=B.status;if(A==="authorized"){Nu(D,u,B),$({status:"logged_in",email:B.user_email??"",profile:D},()=>{R.success(`
136
- Logged in as ${B.user_email??""}`)});return}if(A==="expired")throw new o("Device code expired. Run `mitsein auth login` again.",1);if(!t)process.stderr.write(".")}catch(c){if(c instanceof o)throw c;if(!t)R.log(`
137
- Poll error: ${c}, retrying...`)}}throw new o("Login timed out. Run `mitsein auth login` again.",124)}function xt(u){let D=u.command("auth").description("Authentication management");D.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(w(async function(){let r=m(this),n=this.opts();_(Boolean(r.json));let F=jt(n.endpoint??r.endpoint);if(n.deviceCode)await dt(F,n.profile??"default",Boolean(r.json));else await Ot(F,n.provider??"google",n.profile??"default",Boolean(r.json))})),D.command("logout").description("Remove saved credentials for a profile").option("--profile <name>","Profile","default").action(w(async function(){let r=m(this),n=this.opts();_(Boolean(r.json));let F=n.profile??"default",i=x(F);if(pt(i))S0(i),$({status:"logged_out",profile:F},()=>{R.success(`Logged out from profile '${F}'`)});else $({status:"not_logged_in",profile:F},()=>{R.log(`Not logged in (profile '${F}')`)})})),D.command("whoami").description("Show current identity").option("--profile <name>","Profile","default").option("--endpoint <url>","API base URL (display only)").action(w(async function(){let r=m(this),n=this.opts();_(Boolean(r.json)),n.endpoint;let F=n.profile??"default",i=x(F);if(!pt(i))throw new o("Not logged in. Run `mitsein auth login`.",2);let e=JSON.parse(R0(i,"utf8"));$({email:e.user_email??"unknown",user_id:e.user_id??"unknown",profile:F,endpoint:e.endpoint??""},(s)=>{let f=s;R.success(`Logged in as ${f.email}`),R.log(` User ID: ${f.user_id}`),R.log(` Profile: ${f.profile}`),R.log(` Endpoint: ${f.endpoint}`)})}))}function T0(u){let D=typeof u==="object"&&u!==null?u:null;if(Boolean(D&&(D.status==="ok"||D.ok===!0)))process.stdout.write(`\u2713 Backend is healthy
138
- `);else process.stdout.write(`\u2717 Backend is unhealthy
139
- `)}function y0(u){let D=u;process.stdout.write(`\u2713 ${D.title??""} v${D.version??""}
140
- `),process.stdout.write(` ${D.paths??0} paths
141
- `),process.stdout.write(` Cached at: ${D.cached_at??""}
142
- `)}function ui(u){let D=u.command("dev").description("Development utilities");D.command("token").description("Print the resolved dev token").action(w(async function(){let r=m(this);if(r.real)process.stderr.write(`\u26A0\uFE0F Using --real: this token accesses real data, not e2e sandbox.
143
- `);let n=Y({token:r.token,endpoint:r.endpoint,profile:r.profile??"e2e",real:r.real});$(n.token)})),D.command("health").description("Check backend health (GET /health)").action(w(async function(){let r=m(this),F=await y.fromOptions({token:r.token,endpoint:r.endpoint,profile:r.profile??"e2e",real:r.real,timeoutSec:I(r),debug:r.debug}).get("/health");$(F,T0)})),D.command("openapi").description("Fetch and cache OpenAPI spec from backend").option("--refresh","Force re-fetch from backend",!1).action(w(async function(){let r=m(this),n=this.opts();_(Boolean(r.json));let F=await BD({endpoint:r.endpoint,refresh:Boolean(n.refresh)}),i=Iu(),e=F.paths,s=e!==null&&typeof e==="object"&&!Array.isArray(e)?Object.keys(e).length:0,f=F.info??{};$({title:String(f.title??""),version:String(f.version??""),paths:s,cached_at:i},y0)}))}function Di(u){let D=u.command("messages").description("Message list and send (no agent)");D.command("list <thread_id>").description("List messages for a thread").option("--offset <n>","Pagination offset","0").option("--limit <n>","Max results","20").action(w(async function(r){let n=m(this),F=this.opts();_(Boolean(n.json));let i=y.fromOptions({token:n.token,endpoint:n.endpoint,profile:n.profile??"e2e",real:n.real,timeoutSec:I(n),debug:n.debug}),e=Number.parseInt(String(F.offset??"0"),10),s=Number.parseInt(String(F.limit??"20"),10),f=await i.post("/api/message/list",{thread_id:r,limit:Number.isFinite(s)?s:20,offset:Number.isFinite(e)?e:0});$(f)})),D.command("send <thread_id> <content>").description("Add a user message (does not start the agent)").action(w(async function(r,n){let F=m(this);_(Boolean(F.json));let e=await y.fromOptions({token:F.token,endpoint:F.endpoint,profile:F.profile??"e2e",real:F.real,timeoutSec:I(F),debug:F.debug}).post("/api/message/add",{thread_id:r,content:n});$(e)}))}function ti(u){let D=u.command("project").description("Project management");D.command("list").description("List projects").option("--offset <n>","Pagination offset","0").option("--limit <n>","Max results","20").action(w(async function(){let r=m(this),n=this.opts();_(Boolean(r.json));let F=y.fromOptions({token:r.token,endpoint:r.endpoint,profile:r.profile??"e2e",real:r.real,timeoutSec:I(r),debug:r.debug}),i=Number.parseInt(String(n.offset??"0"),10),e=Number.parseInt(String(n.limit??"20"),10),s=await F.post("/api/project/list",{offset:Number.isFinite(i)?i:0,limit:Number.isFinite(e)?e:20});$(s)})),D.command("get <project_id>").description("Get project details").action(w(async function(r){let n=m(this);_(Boolean(n.json));let i=await y.fromOptions({token:n.token,endpoint:n.endpoint,profile:n.profile??"e2e",real:n.real,timeoutSec:I(n),debug:n.debug}).post("/api/project/get",{project_id:r});$(i)})),D.command("delete <project_id>").description("Delete a project").action(w(async function(r){let n=m(this);_(Boolean(n.json));let i=await y.fromOptions({token:n.token,endpoint:n.endpoint,profile:n.profile??"e2e",real:n.real,timeoutSec:I(n),debug:n.debug}).post("/api/project/delete",{project_id:r});$(i)}))}function ii(u){let D=u.command("run").description("Agent run management");D.command("list <thread_id>").description("List agent runs for a thread").action(w(async function(r){let n=m(this);_(Boolean(n.json));let i=await y.fromOptions({token:n.token,endpoint:n.endpoint,profile:n.profile??"e2e",real:n.real,timeoutSec:I(n),debug:n.debug}).post(`/api/thread/${r}/agent-runs`);$(i)})),D.command("get <run_id>").description("Get agent run status").action(w(async function(r){let n=m(this);_(Boolean(n.json));let i=await y.fromOptions({token:n.token,endpoint:n.endpoint,profile:n.profile??"e2e",real:n.real,timeoutSec:I(n),debug:n.debug}).post(`/api/agent-run/${r}`);$(i)})),D.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(w(async function(r){let n=m(this),F=this.opts();_(Boolean(n.json));let i=Y({token:n.token,endpoint:n.endpoint,profile:n.profile??"e2e",real:n.real}),e=F.timeout??"120",s=Number.parseFloat(e),f=Number.isFinite(s)&&s===0?null:Number.isFinite(s)?s:120;await uu({endpoint:i.endpoint,token:i.token,agent_run_id:r,timeout:f??void 0,stream_output:!0,json_mode:Boolean(n.json),debug:n.debug,event_filter:ru(F.filter)})})),D.command("wait <run_id>").description("Block until agent run completes").option("--timeout <sec>","Timeout (0 = no limit)","120").action(w(async function(r){let n=m(this),F=this.opts();_(Boolean(n.json));let i=Y({token:n.token,endpoint:n.endpoint,profile:n.profile??"e2e",real:n.real}),e=F.timeout??"120",s=Number.parseFloat(e),f=Number.isFinite(s)&&s===0?null:Number.isFinite(s)?s:120,C=await uu({endpoint:i.endpoint,token:i.token,agent_run_id:r,timeout:f??void 0,stream_output:!1,json_mode:Boolean(n.json),debug:n.debug});$(C)})),D.command("cancel <run_id>").description("Cancel a running agent").action(w(async function(r){let n=m(this);_(Boolean(n.json));let i=await y.fromOptions({token:n.token,endpoint:n.endpoint,profile:n.profile??"e2e",real:n.real,timeoutSec:I(n),debug:n.debug}).post(`/api/agent-run/${r}/stop`);$(i)}))}function ri(u){let D=u.command("thread").description("Thread management and messaging");D.command("list").description("List threads").option("--offset <n>","Pagination offset","0").option("--limit <n>","Max results","20").action(w(async function(){let r=m(this);_(Boolean(r.json));let n=y.fromOptions({token:r.token,endpoint:r.endpoint,profile:r.profile??"e2e",real:r.real,timeoutSec:I(r),debug:r.debug}),F=Number.parseInt(String(this.opts().offset??"0"),10),i=Number.parseInt(String(this.opts().limit??"20"),10),e=await n.post("/api/thread/list",{offset:Number.isFinite(F)?F:0,limit:Number.isFinite(i)?i:20});$(e)})),D.command("get <thread_id>").description("Get thread details").action(w(async function(r){let n=m(this);_(Boolean(n.json));let i=await y.fromOptions({token:n.token,endpoint:n.endpoint,profile:n.profile??"e2e",real:n.real,timeoutSec:I(n),debug:n.debug}).post("/api/thread/get",{thread_id:r});$(i)})),D.command("create").description("Create a new thread").option("--title <title>","Thread title","").action(w(async function(){let r=m(this),{title:n}=this.opts();_(Boolean(r.json));let i=await y.fromOptions({token:r.token,endpoint:r.endpoint,profile:r.profile??"e2e",real:r.real,timeoutSec:I(r),debug:r.debug}).post("/api/thread/create",{title:n??""});$(i)})),D.command("history <thread_id>").description("Show message history for a thread").option("--limit <n>","Max messages","50").action(w(async function(r){let n=m(this),{limit:F}=this.opts();_(Boolean(n.json));let i=y.fromOptions({token:n.token,endpoint:n.endpoint,profile:n.profile??"e2e",real:n.real,timeoutSec:I(n),debug:n.debug}),e=Number.parseInt(String(F??"50"),10),s=await i.post("/api/message/list",{thread_id:r,limit:Number.isFinite(e)?e:50});$(s)})),D.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(w(async function(r,n){let F=m(this),i=this.opts();if(_(Boolean(F.json)),i.wait&&i.stream)throw new o("--wait and --stream are mutually exclusive",2);let e=Y({token:F.token,endpoint:F.endpoint,profile:F.profile??"e2e",real:F.real}),s=new y(e,{debug:F.debug,timeoutSec:I(F)}),f=await s.post("/api/message/add",{thread_id:r,content:n}),C={};if(i.model)C.model_name=i.model;let c=(await s.postForm(`/api/thread/${r}/agent/start`,C)).agent_run_id??"";if(!i.wait&&!i.stream){$({message:f,agent_run_id:c,status:"started"});return}let B=i.timeout??"120",A=Number.parseFloat(B),S=Number.isFinite(A)&&A===0?null:Number.isFinite(A)?A:120,M=await uu({endpoint:e.endpoint,token:e.token,agent_run_id:c,timeout:S??void 0,stream_output:Boolean(i.stream),json_mode:Boolean(F.json),debug:F.debug,event_filter:ru(i.filter)});if(i.wait&&!i.stream)$(M)}))}import{readFileSync as U0}from"fs";import{join as I0}from"path";function G0(){let u=I0(import.meta.dir,"..","..","package.json");try{return JSON.parse(U0(u,"utf8")).version??"0.1.0-dev"}catch{return"0.1.0-dev"}}function ni(){$(G0())}var q=new gD;q.name("mitsein").description("Mitsein CLI \u2014 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",(u,D)=>{let r=(D??u).optsWithGlobals();_(Boolean(r.json))});q.command("version").description("Print CLI version").action(()=>{ni()});ui(q);Kt(q);ri(q);ii(q);Di(q);Xt(q);ti(q);xt(q);try{await q.parseAsync(process.argv,{from:"node"})}catch(u){if(u instanceof o){if(R.error(`Error: ${u.message}`),u.detail!=null&&u.detail!=="")R.error(String(u.detail));process.exit(u.code)}R.error(u),process.exit(1)}
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)...`);_3($);let R=Date.now()+s*1000;while(Date.now()<R){await r5(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"){m3(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 g7(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=W7(h.endpoint??C.endpoint);if(h.deviceCode)await P7(f,h.profile??"default",Boolean(C.json));else await K7(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=Ku(f);if(q7(E))c5(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=Ku(f);if(!q7(E))throw new X("Not logged in. Run `mitsein auth login`.",2);let B=JSON.parse(f5(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}`)})}))}function n5(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 k7(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),f=await a.fromOptions({token:C.token,endpoint:C.endpoint,profile:C.profile??"e2e",real:C.real,timeoutSec:uD(C),debug:C.debug}).get("/health");V(f,n5)})),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 P8({endpoint:C.endpoint,refresh:Boolean(h.refresh)}),E=A3(),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 v7(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=a.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 a.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 j7(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=a.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 a.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 a.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 O7(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 a.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 a.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 Pu({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:n2(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 Pu({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 a.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 o7(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=a.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 a.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 a.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=a.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 a(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 Pu({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:n2(E.filter)});if(E.wait&&!E.stream)V(J)}))}import{readFileSync as s5}from"node:fs";import{dirname as t5,join as $5}from"node:path";import{fileURLToPath as A5}from"node:url";function w5(){let D=t5(A5(import.meta.url)),u=$5(D,"..","..","package.json");try{return JSON.parse(s5(u,"utf8")).version??"0.1.0-dev"}catch{return"0.1.0-dev"}}function d7(){V(w5())}var XD=new wi;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(()=>{d7()});k7(XD);V7(XD);o7(XD);O7(XD);v7(XD);X7(XD);j7(XD);g7(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)}